Skip to content

fix: bump canary base to next minor so canaries sort above latest stable - #12325

Open
deep200315 wants to merge 1 commit into
facebook:mainfrom
deep200315:fix/11013-canary-version
Open

fix: bump canary base to next minor so canaries sort above latest stable#12325
deep200315 wants to merge 1 commit into
facebook:mainfrom
deep200315:fix/11013-canary-version

Conversation

@deep200315

Copy link
Copy Markdown

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Fixes #11013.

Canary releases are flagged as older than the latest stable, producing a bogus CLI banner
like Update available 3.7.0-canary-6264 → 3.7.0 on every run.

The root cause is in the canary version script, not the CLI comparison. canary:getCoreVersion
reads the current core version and strips the prerelease suffix without bumping it, so a
canary built from commits after 3.7.0 shipped is still labeled 3.7.0-canary-N. Per semver a
prerelease ranks below its stable base (semver.lt('3.7.0-canary-6264', '3.7.0') is true), so
beforeCli.mjs shows the update banner.

This bumps the minor version (patch reset to 0) before appending the -canary- suffix, as
discussed in #11013. Canaries now publish as e.g. 3.11.0-canary-N and sort above the last
stable, so the banner no longer fires. Bumping minor (rather than patch) also signals that a
canary may contain new features and eventually breaking changes.

The version comparison in beforeCli.mjs is intentionally left untouched, so genuine rc/beta
→ stable upgrades still notify as before (semver.lt('3.10.0-rc.1', '3.10.1') stays true).

Note (possible follow-up, out of scope): beforeCli.mjs still detects canaries via
update.current.startsWith('0.0.0') (from #5378). That predates the current X.Y.Z-canary-N
scheme and no longer matches any published version, so it's now effectively dead. I left it
untouched to keep this PR scoped. Happy to remove it — or re-point it at the real -canary-
format as defense-in-depth — in a separate PR if preferred.

Test Plan

The change is confined to a build script (no canary publish required). The canary pnpm scripts
have no existing unit-test harness, so the second pre-flight box is left unchecked; verified
manually instead:

  • pnpm --silent canary:getCoreVersion3.11.0 (next minor of the current 3.10.1)
  • pnpm --silent canary:version3.11.0-canary-<N>+<sha>
  • semver.lt('3.11.0-canary-1', '3.10.1')false — the exact gate in beforeCli.mjs, so no banner
  • Regression sanity: semver.lt('3.9.0', '3.10.1')true (stale stable installs still warn)
  • rc unaffected: semver.lt('3.10.0-rc.1', '3.10.1')true (rc users still nudged to stable)

Test links

N/A — build-script change only; nothing rendered on the site UI and no documentation changes.

Deploy preview: N/A — no UI or documentation changes.

Related issues/PRs

Canary versions were built by stripping the prerelease suffix from the
current core version without bumping it, producing e.g. `3.7.0-canary-N`.
Per semver, a prerelease ranks below its stable base, so a canary built
from commits after 3.7.0 shipped was treated as older than stable 3.7.0,
triggering a bogus "Update available" CLI banner.

Bump the minor version (patch reset to 0) before appending the canary
suffix, so canaries sort above the latest stable release and the banner
no longer fires. The version comparison in beforeCli.mjs is untouched, so
genuine rc/beta -> stable upgrades still notify as before.

Fixes facebook#11013
@meta-cla

meta-cla Bot commented Jul 29, 2026

Copy link
Copy Markdown

Hi @deep200315!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@netlify

netlify Bot commented Jul 29, 2026

Copy link
Copy Markdown

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit fffac7c
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/6a6a046667e7fd0008cece91
😎 Deploy Preview https://deploy-preview-12325--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@meta-cla

meta-cla Bot commented Jul 29, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla Bot added the CLA Signed Signed Facebook CLA label Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Canary versions are treated as older than the latest stable version

1 participant