-
-
Notifications
You must be signed in to change notification settings - Fork 113
chore: revamp scaffolded policy #7308
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
Conversation
Signed-off-by: Olblak <me@olblak.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
Improve generic Updatecli policy
Test
To test this pull request, you can run the following commands:
Additional Information
Checklist
Tradeoff
Potential improvement