-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
chore(remap): condition without subfields is set to Remap source #6255
Conversation
Signed-off-by: Stephen Wakely <[email protected]>
Thanks! Just making sure these tests are adequate. We've been bitten by these types of changes in the past. Would it make sense to add a behavior test for the new remap syntax? |
I have already moved all the behaviour tests over to Remap in a previous PR, but I have left them specifying the [[tests.outputs.conditions]]
type = "remap"
source = '''
.a.b == 123 && \
.x.y == 456 && \
.x.z == 789
''' you can do: conditions = ['''
.a.b == 123 && \
.x.y == 456 && \
.x.z == 789
'''] I didn't like the way this looked at first, so I hesitated to change it. But I'm actually warming to it now that I type this comment. I'll move them over... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I echo @pablosichert's test concerns, but otherwise LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions, otherwise LGTM
Signed-off-by: Stephen Wakely <[email protected]>
src/conditions/mod.rs
Outdated
.unwrap(); | ||
|
||
assert_eq!( | ||
r#"Map(RemapConfig { source: ".nork == true" }"#, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r#"Map(RemapConfig { source: ".nork == true" }"#, | |
r#"Map(RemapConfig { source: ".nork == true" })"#, |
Same for 2 tests above. Rest looks good 👍
Signed-off-by: Stephen Wakely <[email protected]>
Ref #4791
This updates the conditions such that if you don't specify a subfield it will take the value as the remap source.
So both these examples work and are equivalent:
check_fields
conditions work and can be set as before. A deprecation warning is still emitted.Signed-off-by: Stephen Wakely [email protected]