Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(merge transform): Support nested fields and arrays #1936

Merged
6 commits merged into from
Mar 16, 2020

Conversation

MOZGIII
Copy link
Contributor

@MOZGIII MOZGIII commented Feb 26, 2020

This PR supersedes #1825. We couldn't advance with that approach, so we have to try again.

This is merely a rebase to master after #1902 has been merged.

So, the core problem is the Map values don't respect the invariants required by the Discriminant. This PR adds tests, that demonstrate the failure scenario. For things to work properly, all tests introduced in this PR have to pass.

This PR only adds tests that now fail. What to do with this PR is a question to me. We can merge it to master to force-break it, and then fix it later, or we can add fix here and then merge it.

/cc @a-rodin

…es_matter

These are designed to help with ensuring the nested fields are properly
supported.
The design is as follows:
- The `map_values_key_order` test checks that the discriminant for two
  values with different key order still produce the same discriminant;
  this will pass without nested fields support (i.e. on current master),
  but not because it correctly distinguishes the streams - but because the
  map values are not considered for comparison at all. For the purpose of
  the discriminant, events are the same because no fields contributed to
  the calculation. The invariant is still checked and passes. But to ensure
  the actual correctness, the second test - `map_values_matter` - is
  added.
- The `map_values_matter` test checks that nested fields do actually
  contribute to the discriminant calculation.

Signed-off-by: MOZGIII <mike-n@narod.ru>
This ensures the Map values are not confused with other variants, and also
validates another edge case that has to be properly supported for proper
nested field implementation - that `Value::Map` values are not ignored.

- rename `map_values_matter` to `map_values_matter_1`
- add `map_values_matter_2`

Signed-off-by: MOZGIII <mike-n@narod.ru>
@ghost
Copy link

ghost commented Feb 26, 2020

Let's keep this PR open until the tests are fixed.

@binarylogic binarylogic assigned ghost Mar 2, 2020
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
…-nested-events-semantics-rebase

Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
@github-actions
Copy link

github-actions bot commented Mar 14, 2020

Great PR! Please pay attention to the following items before merging:

Files matching src/**:

  • For each failure path, is there sufficient context logged for users to investigate the issue?
  • Do the tests ensure that behavior is sane for inputs that don't meet normal assumptions (e.g. missing field, non-string, etc)?
  • Did you add adequate documentation?

This is an automatically generated QA checklist based on modified files

@ghost
Copy link

ghost commented Mar 14, 2020

@MOZGIII I implemented value_eq for new value kinds (arrays, maps, and null values). On the way, #2062 was created because otherwise the tests didn't pass. I expect #2062 to be merged first, and then it would be possible to merge master to this branch and merge this PR after.

Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
@ghost ghost changed the title fix(testing): Discriminant nested events semantics (rebase) fix(merge transform): Support nested fields and arrays Mar 16, 2020
@ghost ghost merged commit 7ecec0e into master Mar 16, 2020
@binarylogic binarylogic deleted the discriminant-nested-events-semantics-rebase branch March 16, 2020 17:18
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants