chore: revamp scaffolded policy#7308
Merged
olblak merged 7 commits intoupdatecli:mainfrom Dec 26, 2025
Merged
Conversation
Signed-off-by: Olblak <me@olblak.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the Updatecli policy scaffolding system to use embedded asset files instead of inline template strings. The changes improve maintainability by separating template content from code logic and add support for multiple SCM providers through partial configuration files.
Key Changes
- Replaced inline template strings with embedded asset files using Go's
//go:embeddirective - Consolidated scaffolding logic into a single unified function that processes multiple file types
- Added partial SCM configuration templates for GitHub, GitLab, Gitea, Bitbucket, and Stash
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/core/scaffold/policy.go | Added embed directive to load Policy.yaml template from external file |
| pkg/core/scaffold/main.go | Simplified Run() by removing separate scaffold calls for values, readme, and changelog |
| pkg/core/scaffold/config.go | Refactored to process multiple config files in a loop; now handles all scaffold file generation |
| pkg/core/scaffold/values.go | Removed - inline template moved to assets/values.yaml |
| pkg/core/scaffold/readme.go | Removed - inline template moved to assets/README.md |
| pkg/core/scaffold/changelog.go | Removed - inline template moved to assets/CHANGELOG.md |
| pkg/core/scaffold/main_test.go | Updated test assertions to check for new SCM partial files and renamed default config |
| pkg/core/scaffold/assets/Policy.yaml.tmpl | New template file with improved documentation for policy metadata fields |
| pkg/core/scaffold/assets/values.yaml | New values template with structured SCM configuration and helpful comments |
| pkg/core/scaffold/assets/README.md | New README with updated usage instructions and authentication guidance |
| pkg/core/scaffold/assets/CHANGELOG.md | New changelog template for initial release |
| pkg/core/scaffold/assets/updatecli.d/default.yaml | Example pipeline configuration for updating Docker images |
| pkg/core/scaffold/assets/updatecli.d/_scm.github.yaml | Partial template for GitHub SCM configuration |
| pkg/core/scaffold/assets/updatecli.d/_scm.gitlab.yaml | Partial template for GitLab SCM configuration |
| pkg/core/scaffold/assets/updatecli.d/_scm.gitea.yaml | Partial template for Gitea SCM configuration |
| pkg/core/scaffold/assets/updatecli.d/_scm.bitbucket.yaml | Partial template for Bitbucket SCM configuration |
| pkg/core/scaffold/assets/updatecli.d/_scm.stash.yaml | Partial template for Stash SCM configuration |
| pkg/core/scaffold/assets/updatecli.d/_scm.githubsearch.yaml | Partial template for GitHub search SCM configuration (not yet wired into scaffold) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Olblak <me@olblak.com>
… revamp/scaffolding
Signed-off-by: Olblak <me@olblak.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or 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
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.
Improve generic Updatecli policy
Test
To test this pull request, you can run the following commands:
Additional Information
Checklist
Tradeoff
Potential improvement