Skip to content

ci: keep npm's latest on the newest release when publishing from a release branch - #3479

Merged
ben-reitz merged 2 commits into
mainfrom
ci/maintenance-release-tag
Nov 30, 2026
Merged

ben-reitz merged 2 commits into
mainfrom
ci/maintenance-release-tag

Conversation

@ben-reitz

@ben-reitz ben-reitz commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

A maintenance release from a release/** branch publishes under npm's latest tag, just like a release from main. So once 0.35.0 ships, a 0.34.2 from release/0.34 would take latest back, and npm install agents would install the older line. Now a release branch keeps latest only when everything it publishes is newer than the current latest. Otherwise it publishes under release-<line>.

The Release workflow also had one concurrency group that kept only one pending run, so a push to main could replace a maintenance release still waiting to run. That release would never publish. The group now queues (queue: max), so each run waits its turn. It stays one group for main and release/**, so a main release can't publish between a maintenance run's check of latest and its own publish.

Both came up in the Devin review of #3223.

Summary

 changeset-publish.ts
   resolve workspace versions
+  if GITHUB_REF_NAME is release/<line>
+    for each public workspace package not yet on npm
+      if its version is not newer than its latest
+        tag = release-<line>
-  changeset publish
+  changeset publish [--tag release-<line>]
 concurrency:
   group: ${{ github.workflow }}
   cancel-in-progress: false
+  queue: max

If npm fails with anything other than "not found", the publish stops rather than guessing a tag. Changesets applies one tag to the whole run, so if any package in it is older than its latest, the whole run gets the maintenance tag.

Evidence

A dry run of the script, with publishing stubbed out and a package's version changed:

Branch agents Result
main 0.33.9 changeset publish (latest)
release/0.34 0.34.1 (already on npm) changeset publish (latest, nothing to publish)
release/0.34 0.34.2 (newer than latest 0.34.1) changeset publish (latest)
release/0.34 0.33.9 (older than latest) changeset publish --tag release-0.34
release/0.34 voice-twilio 0.0.99 (older than latest 0.1.1) changeset publish --tag release-0.34
release/0.34 voice-twilio 0.1.2 (newer) changeset publish (latest)

It hasn't run in Actions yet. The first real proof will be the next maintenance release.

Merge Danger

Door: two-way

Blast Radius: releases

Releases from main are unchanged. A release from a release/** branch now runs npm view for each package first. Releases from main and release/** still run one at a time; a run now waits behind a running one instead of replacing a pending one.

The workflow runs from the pushed branch, so release/0.34 keeps the old behaviour until this is cherry-picked there.

…lease branch

From the #3223 review. Changesets tags every publish latest, so a maintenance release from release/<line> after a newer release would move latest back to the older line. It now keeps latest only when every package it publishes is newer than that package's latest, and otherwise publishes under release-<line>. The Release workflow's concurrency group is also per branch now: a single group let a push to main replace a maintenance release still waiting to run.
@changeset-bot

changeset-bot Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4a0bac7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@3479

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@3479

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@3479

hono-agents

npm i https://pkg.pr.new/hono-agents@3479

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@3479

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@3479

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@3479

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@3479

commit: 4a0bac7

@agent-think

agent-think Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ agents import sizes: no significant changes (62423fad → 4a0bac74, workflow run)

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 4 potential issues.

Devin Review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Maintenance branch needs a backport

release/0.34 still uses the old workflow and publish script. Merging into main leaves both unchanged for pushes to that branch.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread .github/workflows/release.yml Resolved
Comment thread .github/changeset-publish.ts Resolved
Comment thread .github/workflows/release.yml Outdated
# One group per branch: a pending run is replaced by the next push to the
# same branch, so a push to main must not replace a pending maintenance
# release.
group: ${{ github.workflow }}-${{ github.ref }}

@devin-ai-integration devin-ai-integration Bot Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Prior approval for CI changes

The CI change policy requires prior approval for changes to Release workflow scheduling.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

From the Devin review of #3479. The tag check read only packages/*, but Changesets also publishes voice-providers/*; it now lists the pnpm workspace. And per-branch groups let main publish between a maintenance run's latest check and its publish, so the Release workflow is back to one group, with queue: max so a push to main waits instead of replacing a pending maintenance run.
@ben-reitz
ben-reitz merged commit 5876f38 into main Nov 30, 2026
20 checks passed
@ben-reitz
ben-reitz deleted the ci/maintenance-release-tag branch November 30, 2026 10:24
ben-reitz added a commit that referenced this pull request Nov 30, 2026
…lease branch (#3479) (#3510)

* ci: keep npm's latest on the newest release when publishing from a release branch

From the #3223 review. Changesets tags every publish latest, so a maintenance release from release/<line> after a newer release would move latest back to the older line. It now keeps latest only when every package it publishes is newer than that package's latest, and otherwise publishes under release-<line>. The Release workflow's concurrency group is also per branch now: a single group let a push to main replace a maintenance release still waiting to run.

* ci: check every workspace package and queue release runs in one group

From the Devin review of #3479. The tag check read only packages/*, but Changesets also publishes voice-providers/*; it now lists the pnpm workspace. And per-branch groups let main publish between a maintenance run's latest check and its publish, so the Release workflow is back to one group, with queue: max so a push to main waits instead of replacing a pending maintenance run.

(cherry picked from commit 5876f38)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant