feat(yaml): add advanced yamlpath support #1741
Merged
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.
Fix #1412
Thanks @mavimo for introducing me the jsonschema library and sorry that it took me so long to finish your work
This pullrequest introduces the ability to pick another Golang library for the yaml plugin.
The reasoning is the library "https://github.com/vmware-labs/yaml-jsonpath/" allows more advance yamlpath key but it is based on the go-yaml/v3 library which has many limitation.
On the other side, the Updatecli project moved to "goccy/go-yaml" which has limited yamlpath support...
So I propose an key yaml setting named
engine
which accept one of the following valuesyamlpath
: the plugin uses "https://github.com/vmware-labs/yaml-jsonpath/"default
,go-yaml
,"": the plugin uses the goccy libraryThis pullrequest shouldn't introduce changes for current pipeline as we keep the current default behavior
Here is an example to retrieve a value from a specific array item in a Github Action
Test
To test this pull request, you can run the following commands:
Additional Information
Tradeoff
Potential improvement