Add multi-repo upgrade and dependency maintenance utility#4651
Conversation
✅ Deploy Preview for kptdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Adds a new scripts/go-upgrade/ bash utility intended to coordinate Go/linter/cross-repo dependency upgrades across the kptdev ecosystem repositories, including optional branch pushing and draft PR creation via GitHub GraphQL.
Changes:
- Introduces
upgrade.shentrypoint with subcommands for Go version bumps, lint version bumps, cross-repo dep updates, doc generation, and pushing PRs. - Adds modular library scripts (
lib/*.sh) for workspace management, verification, version updates, dependency resolution, and PR creation. - Documents usage and configuration in
scripts/go-upgrade/README.md, plus addsconfig.envdefaults.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/go-upgrade/upgrade.sh | Adds main CLI entrypoint, arg parsing, orchestration, and push flow wiring. |
| scripts/go-upgrade/README.md | Documents intended usage, options, and workflow for the utility. |
| scripts/go-upgrade/config.env | Provides default configuration for repos, versions, workspace, and exclusions. |
| scripts/go-upgrade/lib/common.sh | Adds shared helpers (logging, failure tracking, repo parsing, dependency checks). |
| scripts/go-upgrade/lib/workspace.sh | Implements clone/reuse workspace behavior, clean-state enforcement, module discovery. |
| scripts/go-upgrade/lib/verify.sh | Implements per-module verification pipeline (tidy/fmt/vet/build + Hugo handling). |
| scripts/go-upgrade/lib/versions.sh | Implements go-version, lint-version, and generate-docs subcommands. |
| scripts/go-upgrade/lib/deps.sh | Implements cross-repo dependency detection and upgrade logic. |
| scripts/go-upgrade/lib/push.sh | Implements branch/commit/push and GraphQL draft PR creation via gh. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1f034e5 to
f9dc8c7
Compare
Signed-off-by: Aravindhan Ayyanathan <aravindhan.a@est.tech>
Signed-off-by: Aravindhan Ayyanathan <aravindhan.a@est.tech>
Signed-off-by: Aravindhan Ayyanathan <aravindhan.a@est.tech>
60e065d to
4ee92e6
Compare
mozesl-nokia
left a comment
There was a problem hiding this comment.
I can think of one small addition that would be nice: If FORK_OWNER is "kptdev" the script should prevent any upstream modifications (so pushing a branch). On top of that would be adding a -f to override that.
Good suggestion. I'll address that in a separate PR. |
Description
scripts/go-upgrade/- a modular bash utility for coordinating upgrades across 4 interdependent repositories (krm-functions-sdk,kpt,krm-functions-catalog,porch)go mod tidy/go fmt/go vet/go build(all withGOWORK=off), and optionally creates draft PRs via GitHub GraphQL APISupported operations:
go-version- bump Go directive in allgo.modfileslint-version- bumpGOLANGCI_LINT_VERSIONin Makefilescross-deps- upgrade cross-repository dependencies to latest published versionsall- run all of the above in sequencepush- create branches, commit, push, and raise draft PRsType of Change
Checklist
AI Disclosure
Kiro CLI used to design, implement, and validate the utility including library structure, safety fixes, and GraphQL API integration.