Repository navigation
ci: derive latest-<major> dist-tag from the version in the Tag workflow - #12911
Conversation
The Tag workflow hardcoded the latest-11 dist-tag (each release branch carried its own hardcoded major), so dispatching it from the wrong branch applied the wrong line's tag: tagging 10.34.5 from main pointed latest-11 at a v10 release (#12906). Derive latest-<major> from the version input instead, and fail fast when the requested tag names a different major than the version, or when a plain 'latest' tag would move backwards to an older major. Co-Authored-By: Claude Fable 5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe release workflow updates tag guidance, validates semver and major-version tag consistency, prevents backward movement of ChangesRegistry tag safety
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant NpmRegistry
participant PnpmPackages
GitHubActions->>GitHubActions: Validate version and requested tag
GitHubActions->>NpmRegistry: Read current latest major with npm view
NpmRegistry-->>GitHubActions: Return current latest dist-tag
GitHubActions->>PnpmPackages: Add derived latest-major dist-tags
GitHubActions->>PnpmPackages: Add requested non-latest-major tag when needed
Assessment against linked issues
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Tools execution failed with the following error: Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error) Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by Qodoci: derive latest- dist-tag from version in Tag workflow
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
18 rules 1. Historical workflow comment added
|
PR Code Suggestions ✨Warning
Explore these optional code suggestions:
|
||||||||||||||
Summary
Fixes #12906.
The Tag workflow (
update-latest.yml) hardcoded thelatest-11dist-tag and applied it unconditionally to whatever version was passed in. Each release branch carries its own copy with its own hardcoded major (release/10hardcodeslatest-10), so dispatching the workflow from the wrong branch applied the wrong line's tag — tagging10.34.5frommainpointedlatest-11at a v10 release. (The registry tags themselves have already been repaired; this PR prevents a recurrence.)This PR makes the workflow branch-agnostic and adds guardrails:
latest-<major>is now derived from the version input instead of being hardcoded, so it always lands on the correct release line no matter which branch the workflow is dispatched from.latest-Nwith an N that doesn't match the version's major (the exact pnpm 10.34.5 is incorrectly tagged as @latest-11 #12906 scenario),latest(the default input) but the version's major is older than the major currently taggedlatest— catching the "forgot to change the default tag when tagging a backport" case.The validation logic was exercised locally against the incident scenario (
10.34.5+latest-11→ fails), correct backport tagging (10.34.5+latest-10→ passes), a normal release (11.2.0+latest→ passes), a backport with the forgotten default tag (10.34.5+latest→ fails), a prerelease (11.0.0-beta.1+latest-11→ passes), and a malformed version (v11.2.0→ fails).The same change should be applied to the workflow copy on
release/10(and future release branches), though with the derivation in place, dispatching frommainnow works correctly for any release line.Squash Commit Body
Checklist
pacquet/port, or the description notes what still needs porting.(CI-workflow-only change — nothing to port.)
Written by an agent (Claude Code, claude-fable-5).
Summary by CodeRabbit
Bug Fixes
latesttag from being moved to an older major release.Documentation
latest-<major>format.