-
Notifications
You must be signed in to change notification settings - Fork 29
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
enhance(yaml)!: allow for users to parse pipelines using old library #1220
Open
ecrupper
wants to merge
5
commits into
main
Choose a base branch
from
enhance/yaml-parser-flag
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
plyr4
force-pushed
the
enhance/yaml-parser-flag
branch
from
November 8, 2024 20:57
3fe3d3b
to
23205cd
Compare
ecrupper
changed the title
enhance(yaml): allow for users to parse pipelines using old library
enhance(yaml)!: allow for users to parse pipelines using old library
Dec 3, 2024
This was referenced Dec 23, 2024
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.
Background
It is imperative that the platform moves away from the buildkite YAML library, as it is archived.
This has been attempted and reverted a couple times:
(2024, go-yaml v3) go-vela/types#386 —> go-vela/types#392
(2020, goccy) go-vela/types#118 —> go-vela/types#144
This PR ensures that we will not have to revert this important change, as it will allow for users to immediately set
At the top level of their pipeline file (or template file) if they are encountering unexpected YAML issues.
This will also allow for troubleshooting / triaging for the Vela admins to cover all of our bases when shifting to this new library while having low impact.
The goal is to revert this change in a later release so that the entire platform uses only one YAML parser throughout the code base.
However, one of the most common patterns that will now produce errors is the use of multiple
<<:
in a single YAML map. This pattern will compile correctly with this change but produce warnings. These warnings will be attached to the pipeline object and will be rendered in the UI.What's in the PR
compiler/types/yaml/yaml
andcompiler/types/yaml/buildkite
in place of the singlecompiler/types/yaml
ToYAML()
method that will convert to the go-yaml version. Once the pipelines have been unmarshaled, these two objects should be identical sans their type.internal/yaml.go
file that grabs theversion
from the pipeline file and verifies the library we should use.warnings
field in the pipelines table to track warnings.