| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
This PR introduces support for partial manifests in Updatecli by allowing manifest files starting with an underscore (e.g. _source.yaml) to be merged into the main manifest from the same directory.
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file| File | Description |
|---|---|
| pkg/core/engine/utils.go | Refactored file path sanitization to separate regular and partial manifests. |
| pkg/core/engine/testdata/partialOneManifest/updatecli.yaml | Added manifest test file for partial manifest integration. |
| pkg/core/engine/testdata/partialOneManifest/_source.yaml | Added a partial manifest test file. |
| pkg/core/engine/registry.go | Updated registry push to include partial file paths. |
| pkg/core/engine/configuration_test.go | Extended tests to cover partial manifest scenarios and error formatting. |
| pkg/core/engine/configuration.go | Adjusted configuration loading to process partial files and update error messages. |
| pkg/core/config/main.go | Modified manifest loading to combine partial file content with the main manifest. |
| e2e/updatecli.d/success.d/partial/stable/_source.yaml | Added partial file for e2e testing of stable sources. |
| e2e/updatecli.d/success.d/partial/jenkins.yaml | Added jenkins pipeline manifest using partial manifests. |
| e2e/updatecli.d/success.d/partial/_source.yaml | Added supplemental partial file for e2e testing. |
Sorry, something went wrong.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
In case of a mistake, Updatecli returns an error similar to ERROR: the specified sourceid "getLatestJenkinsWeekly" for condition[id] does not exist ERROR: failed loading pipeline(s) * e2e/updatecli.d/success.d/partial/jenkins.yaml: * Partial files: * e2e/updatecli.d/success.d/partial/_source.yaml * Error: conditions validation error: wrong updatecli configuration It's not easy to provide better error message since the manifest need to be rendered as a whole before validiting it |
Sorry, something went wrong.
|
I like the idea of automatically loading any _*.yaml file in the current directory. However, a use case that just came to mind is maintaining a collection of partial configs that can be reused when creating new Updatecli pipelines. I can still make this work with the proposed implementation by using symlinks. For example, I might have a partials/ directory containing shared scm.yaml files, and a separate manifests/ directory with pipeline definitions like pipeline1.yaml. Inside manifests/, I could symlink one of the scm.yaml files from partials/ to include it in a specific pipeline. That said, I think it would offer even greater composability to support a dedicated keyword in the manifest to explicitly declare which files to load. For instance, an imports keyword could accept a list of optional files to include, defaulting to the _*.yaml pattern. This would allow each pipeline to declare exactly which partial configs it depends on, resulting in a more DRY and modular setup. I realize this overlaps somewhat with the Updatecli policy feature, which supports storing versioned config fragments in an OCI repository. Still, I believe this approach would be more straightforward for users, as it avoids external dependencies and works with just a Git repository. Of course, what I'm proposing here could be moved into a separate task. The current PR could be merged as-is since it's a solid first step toward more composable updatecli pipeline definitions. |
Sorry, something went wrong.
In theory, I agree with you, in practice, I have a chicken-and-egg problem. Because of the golang templating we would first need to render the manifest in order to be sure that the "imports" settings is correct and then we could re-render the manifest a second time with the partial files listed in the import section. I fear that it could lead to confusion |
Sorry, something went wrong.
I just can't see a way to avoid this technical limitation as it's a chicken and egg problem |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fix #430
As discussed in #5461 (comment)
I propose to introduce partial manifest, similar to how the Helm project is doing.
A partial manifest is a specific type of Updatecli manifest starting with _ such as _scm.yaml that is available to
all the Updatecli manifest within the same directory.
Test
To test this pull request, you can run the following commands:
go build -o bin/updatecli . ./bin/updatecli manifest show --config e2e/updatecli.d/success.d/partialYou will notice that it only generate one Updatecli manifest by combining the files _source.yaml and jenkins.yaml
The file stable/_source.yaml is correctly ignore as being a partial file
Additional Information
Checklist
Tradeoff
In the current implementation all the files are concatenated together so any YAML file starting with --- will be considered as a different YAML document which may lead to some confusion on a large project.
By design, partial manifest are only available within the same directory
Potential improvement
/