-
Notifications
You must be signed in to change notification settings - Fork 365
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
MergeYaml should avoid adding query with no result as key at end of file #4297
Merged
timtebeek
merged 10 commits into
openrewrite:main
from
adastraperangusta:mergeyaml_report
Jul 2, 2024
Merged
MergeYaml should avoid adding query with no result as key at end of file #4297
timtebeek
merged 10 commits into
openrewrite:main
from
adastraperangusta:mergeyaml_report
Jul 2, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in case the jsonpath is a query which yelds no result, avoid merging the yaml at end of file with the query as a key
timtebeek
changed the title
[MergeYaml recipe] avoid adding query with no result as key at end of file
MergeYaml should avoid adding query with no result as key at end of file
Jul 1, 2024
) * Fix StackOverflowError in case of circular import deps Check if import dependency was already resolved before * Format test, remove unnecessary paths and add issue link * Replace Streams with for loop as per convention To limit object allocations * Swap argument order for consistency * Verify merged managed dependency version --------- Co-authored-by: Daniil Zhyliaiev <dzhyliaiev@playtika.com> Co-authored-by: Tim te Beek <tim@moderne.io>
…ontexts where services.gradle.org is unavailable
…lectors, when services.gradle.org cannot be reached
timtebeek
approved these changes
Jul 2, 2024
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.
Thanks for the immediate fix @adastraperangusta ! Nice to see a test that was previously disabled now passes too.
We expect to do a release either today or tomorrow, but until then you can use our snapshot versions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In case the jsonpath is a query which yelds no result, avoid merging the yaml snippet at end of file with the query as a key.
What's changed?
In case the jsonpath has no match in a given yaml file, the MergeYaml recipe appends the yaml snippet at the end of the file under the jsonpath used as a key.
When this key is a JsonPath query using function, this creates an invalid key.
What's your motivation?
Applying MergeYaml on yaml files which don't match the query adds an extra block which is not needed.
Checking this type of key seems easier than using "preconditions"
Any additional context
Maybe the MergeYaml recipe should have an optional "mergeIfKeyNotFound" property set to true by default.
Checklist