Repository navigation
Unblock nightly publishes that fail on the community QR template - #8006
Conversation
Snapshot versioning rewrites the community QR template's plain @agent-native/core range to the new, unpublished snapshot. The lockfile refresh that follows then looks that version up on npm and fails with ERR_PNPM_NO_MATCHING_VERSION, so every nightly since the QR template was added has failed before publishing. Refresh the snapshot lockfile with --link-workspace-packages in the nightly and dev jobs. The new test builds a small workspace from the real ranges and Changesets config, runs snapshot versioning, and runs each job's install command offline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Medium impact] The PR appears safe to merge; workspace linking stays limited to the snapshot lockfile refreshes. SummaryFixes nightly and dev snapshot lockfile refreshes by resolving unpublished internal versions from the workspace instead of npm.
Reviews (1) · Last reviewed commit: "Link snapshot-rewritten ranges to the wo..." · Reviewed by Greptile |
|
Here's a visual recap of what changed: Open the full interactive recap |
The snapshot-linking test only ran when its own file changed, so a PR that dropped the flag from auto-publish.yml would pass CI and fail the next nightly. Map the workflow to its test, as deploy-canary.yml already is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve the test file's imports against #8066, which added execFileSync and chmodSync next to this branch's spawnSync and mkdirSync. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Builder reviewed your changes — looks good ✅
Review Details
Incremental Code Review Summary
I reviewed the latest PR #8006 diff. The snapshot jobs still add --link-workspace-packages only to their lockfile refreshes, and the CI change-scope routing selects the package-release regression test when auto-publish.yml changes. The test continues to model the snapshot rewrite and checks that QR resolves to the local Core workspace package. I found no new actionable issues; the previously reported CI coverage issue remains fixed and its thread is already resolved.
Risk assessment: Standard (release workflow and CI behavior). The approach remains appropriately scoped: no stable publish path changes, and the snapshot-only lockfile refresh does not become a published artifact. No additional review comments are needed for this update.
🧪 Browser testing: Skipped — PR only modifies backend/config/docs, no UI impact.

Problem
Nightly npm publishes are failing. The last one that published ran at 12:39 UTC on Oct 21. The 15:29 run failed on the stale lockfile that #7967 fixed, and all eight scheduled runs since, through 15:30 UTC on Oct 22, have failed in "Create nightly snapshot versions":
Snapshot versioning moves internal ranges to the new snapshot version. That rewrite is what keeps Dispatch's open peer range on Core (
>=0.209.1) pointing at the matching snapshot, because a prerelease falls outside an open range. The community QR template (#7924) declares Core through a plain npm range instead ofworkspace:*, because its files get copied into other people's workspaces, so it gets the same rewrite. The lockfile refresh after versioning then looks up QR's new@agent-native/core@<snapshot>on npm, where that version doesn't exist yet. pnpm only resolves a plain range to a workspace package whenlink-workspace-packagesis on, and it's off by default here. Dev snapshots run the same two commands and fail the same way.Approach
Snapshot jobs refresh the lockfile with
--link-workspace-packages, so an internal range that names the unpublished snapshot resolves to the workspace package. The flag is limited to the two snapshot jobs. Their refreshed lockfile is never committed, and stable releases and every other install keep pnpm's default.What changed
.github/workflows/auto-publish.yml: the nightly and dev snapshot steps add--link-workspace-packagestopnpm install --lockfile-only.scripts/ci-change-scope.ts: a change toauto-publish.ymlnow runsscripts/package-release-workflow.test.tsin CI, the same way adeploy-canary.ymlchange runs its test, so a later PR that drops the flag fails its own checks instead of the next nightly.scripts/package-release-workflow.test.ts: a new test builds a small workspace from the repo's real Core version, Dispatch peer range, QR range, and Changesets config, then runschangeset version --snapshot nightly. It checks that Dispatch's peer and QR's dependency both move to the snapshot, then runs each job's own install command offline and checks that QR links to the workspace Core.Safety and operations
node_modulesfrom the earlier frozen install, and QR is private, so its link never reaches npm.Verification
main(11a11d9) in a scratch checkout:pnpm changeset version --snapshot nightlyfollowed bypnpm install --lockfile-onlyfails with the sameERR_PNPM_NO_MATCHING_VERSIONas CI. With--link-workspace-packages, the install exits 0, Dispatch's peer and QR's dependency both name the snapshot, and QR resolves tolink:../../../packages/core. The same holds on Stop stable releases from rewriting the community QR template #8002's branch.CI=true. With the flag removed from the dev step, it fails withERR_PNPM_NO_MATCHING_VERSION.pnpm test:package-release-workflow: 66 passed. Merged withmainat 81d6f0f, after two stable releases and ci: verify generated QR pin for release merges #8046,scripts/package-release-workflow.test.tspasses 38 of 38.scripts/ci-change-scope.test.tsandscripts/ci-change-scope-renames.test.ts: 89 passed, including a new case forauto-publish.yml.node scripts/check-changeset.mjs: no changeset needed.Review focus
🤖 Generated with Claude Code