enhance(yaml): allow for users to parse pipelines using old library #1220
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.
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.