ci: Ensure stable npm packages are tagged as latest after release#28755
Merged
ci: Ensure stable npm packages are tagged as latest after release#28755
Conversation
Contributor
Performance ComparisonComparing current → latest master → 14-day baseline
docker-stats
Memory consumption baseline with starter plan resources
Idle baseline with Instance AI module loaded
How to read this table
|
Contributor
There was a problem hiding this comment.
1 issue found across 5 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/scripts/set-latest-for-monorepo-packages.mjs">
<violation number="1" location=".github/scripts/set-latest-for-monorepo-packages.mjs:17">
P1: Do not swallow `npm dist-tag` failures; this should fail the job when a package cannot be retagged to `latest`. According to linked Linear issue CAT-2847, the workflow must reliably keep `latest` aligned with stable releases.</violation>
</file>
Architecture diagram
sequenceDiagram
participant GHA as GitHub Actions
participant Publish as release-publish.yml
participant PostRelease as release-publish-post-release.yml
participant Promote as release-set-stable-npm-packages-to-latest.yml
participant Script as set-latest-for-monorepo-packages.mjs
participant PNPM as pnpm CLI
participant NPM as npm Registry
Note over GHA, NPM: Initial Publication Phase
GHA->>Publish: Trigger workflow
Publish->>NPM: CHANGED: npm publish --tag [track]
Note right of Publish: No longer defaults to 'latest' for stable track
Note over GHA, NPM: Post-Release Promotion Phase
GHA->>PostRelease: Trigger post-release tasks
alt NEW: if bump == 'minor' OR track == 'stable'
PostRelease->>Promote: Call reusable workflow
Promote->>GHA: Checkout refs/tags/stable
Promote->>GHA: Inject NPM_TOKEN into ~/.npmrc
Promote->>Script: Run script
Script->>PNPM: NEW: pnpm ls --json (via pnpm-utils.mjs)
PNPM-->>Script: List of monorepo packages
loop For each non-private package
Script->>NPM: NEW: npm dist-tag add pkg@version latest
alt Success
NPM-->>Script: 200 OK
Script->>GHA: Log success
else Failure
NPM-->>Script: Error
Script->>GHA: Log warning (continue loop)
end
end
end
PostRelease-->>GHA: Complete
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
shortstacked
approved these changes
Apr 21, 2026
Contributor
|
Successfully created backport PR for |
Contributor
|
Got released with |
Contributor
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin release-candidate/2.17.x
git worktree add -d .worktree/backport-28755-to-release-candidate/2.17.x origin/release-candidate/2.17.x
cd .worktree/backport-28755-to-release-candidate/2.17.x
git switch --create backport-28755-to-release-candidate/2.17.x
git cherry-pick -x 95c155859e97256a0df548e7b93027cb7b0b7057 |
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
Adds a workflow and supporting scripts to ensure that stable npm packages in the monorepo are correctly tagged as
lateston npm after a release.What this does:
release-set-stable-npm-packages-to-latest.ymlthat checks out thestabletag, lists all public monorepo packages, and runsnpm dist-tag add <pkg>@<version> latestfor each.pnpm-utils.mjshelper to list monorepo packages viapnpm ls.set-latest-for-monorepo-packages.mjsscript that performs the actual dist-tag updates.release-publish-post-release.ymlonminorbumps orstabletrack releases.Changes to existing release code:
How to test:
Run the
release-set-stable-npm-packages-to-latestworkflow manually viaworkflow_dispatchafter a stable release, and verify npm packages have thelatestdist-tag pointing to the stable version.Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/CAT-2847
Review / Merge checklist
Backport to Beta,Backport to Stable, orBackport to v1(if the PR is an urgent fix that needs to be backported)🤖 PR Summary generated by AI