Skip to content

Conversation

@olblak
Copy link
Member

@olblak olblak commented Dec 25, 2025

Improve generic Updatecli policy

Test

To test this pull request, you can run the following commands:

cd pkg/core/scaffold/
go test

Additional Information

Checklist

  • I have updated the documentation via pull request in website repository.

Tradeoff

Potential improvement

Signed-off-by: Olblak <me@olblak.com>
@olblak olblak added documentation Improvements or additions to documentation enhancement New feature or request labels Dec 25, 2025
@olblak olblak requested a review from Copilot December 25, 2025 18:47
@olblak olblak changed the title feat: revamp generic policy feat: revamp scaffolded policy Dec 25, 2025
Copy link
Contributor

Copilot AI left a 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:embed directive
  • 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.

olblak and others added 4 commits December 25, 2025 19:55
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
@olblak olblak requested a review from Copilot December 25, 2025 19:00
@olblak olblak changed the title feat: revamp scaffolded policy chore: revamp scaffolded policy Dec 25, 2025
Copy link
Contributor

Copilot AI left a 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>
@olblak olblak enabled auto-merge (squash) December 26, 2025 07:03
@olblak olblak disabled auto-merge December 26, 2025 07:06
@olblak olblak merged commit 9af5688 into updatecli:main Dec 26, 2025
5 checks passed
@olblak olblak deleted the revamp/scaffolding branch December 26, 2025 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant