feat: improve stable action resolution#4
Merged
Conversation
4f9cb8b to
b958ea5
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors GitHub Action version resolution into explicit policy types and updates CLI/help behavior and documentation to match the broader “latest eligible stable version” model.
Changes:
- Reworked resolver policy around
Version,Precision,Candidate,Eligibility, andDecision. - Updated workflow planning to resolve each action reference independently.
- Added generated flag help output and expanded resolver documentation/tests.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents eligible stable versions, moving tag precedence, cooldowns, and no-op representation changes. |
| internal/github/client.go | Implements the new resolver policy and eligibility handling. |
| internal/github/client_test.go | Adds resolver regression, model, and property-style tests. |
| cmd/actupdate/main.go | Adds flag-generated help and switches planning to per-reference stable resolution. |
| cmd/actupdate/main_test.go | Adds CLI regression coverage for mixed refs in the same repository. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Version,Precision,Candidate,Eligibility, andDecisiontypesflaghelp output for-h/--helpand keep invalid flag diagnostics on stderrBehavior
This replaces the edge-case patch stack from #3 with a fresh branch from
main. The resolver now treats stable refs as moving major (v6), moving minor (v6.2), or exact (v6.2.1) candidates and applies one ordered policy: prefer moving major, then moving minor, then exact fallback.Moving refs keep their precision within the same major, so
v3is not rewritten tov3.4andv3.4is not rewritten tov3.4.1. Exact refs can upgrade to the latest eligible stable version, including same-major updates such asv3.0tov3.3, while representation-only changes such asv3.0tov3.0.0remain no-ops.Cooldown verification still uses annotated tag timestamps or lightweight tag commit timestamps. Candidate eligibility is checked lazily in policy order so eligible moving tags avoid unnecessary fallback timestamp lookups.
CLI
Help now uses Go standard
flagusage generation for the flag list while preserving the project summary and command synopsis. Help output goes to stdout, and invalid flag errors stay on stderr.Validation
go test ./...git diff --check main...HEADGOCACHE=/private/tmp/go-cache-actupdate go run ./cmd/actupdate --help --repo .