Skip to content

fix(release): wait for npm to serve platform packages before publishing t3 - #19732

Open
only21mil wants to merge 3 commits into
pingdotgg:mainfrom
only21mil:fix/14409-npm-publish-readiness
Open

only21mil wants to merge 3 commits into
pingdotgg:mainfrom
only21mil:fix/14409-npm-publish-readiness

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Problem

npx t3@nightly can install before npm serves its platform package and exit with "no T3 Code CLI build is available for this platform". npm accepted linux-x64 at 09:44:43Z in the triaged nightly but did not serve it until 09:54:07Z. The launcher was already live at 09:47:30Z.

Change

After all platform uploads succeed, wait until npm serves every exact version in the launcher's optionalDependencies, then publish t3. A version is ready only when its registry metadata GET and tarball HEAD both return 2xx. Errors count as not ready.

Poll pending versions every 15 seconds and fail after 20 minutes without publishing the launcher. Dry runs decode the launcher manifest but skip the wait. Raise publish_cli's job timeout from 15 to 35 minutes to leave room for the wait and the existing job budget.

Scope and approval

Fixes #14409. juliusmarminge's triage confirms waiting for fetchable platform tarballs before publishing t3 and moving nightly. This supports the direction, not acceptance of this implementation. No maintainer has commented on this smaller version yet.

Verification

Linux x64, Node v24.18.1. Focused test command:

cd apps/server && vp test run --reporter=verbose scripts/publishOrder.test.ts

With the new tests over main ec1313c8f8: 4 failed, 2 passed, exit 1. The ordering assertion shows the launcher starts without waiting; the other three failures exercise helpers absent on main. Branch d9e96e17e0: 6 passed, exit 0.

The tests were checked against two mutants, one that publishes t3 after a failed wait and one that counts registry or network errors as served; each fails a test.

New tests over main, excerpt from the saved run.

New tests over main: four failures and two passes

The same tests on the branch, excerpt from the saved run.

Branch tests: all six pass

Virtual-clock replay, using a temporary script not in the PR:

cd apps/server && vp test run scripts/zz-proof-14409.test.ts --silent=false --reporter=verbose

All uploads are accepted at t=0. linux-x64 becomes served at 564 seconds, using the triage delay; other platforms' delays are assumed. Main publishes t3 at 0 seconds and the replay counts it live at once, leaving a simulated 564-second broken window. The branch publishes at the next poll, 570 seconds, with no broken window. If linux-x64 never becomes served, the branch times out without publishing t3. This is a replay, not a real release.

Saved replay output, including the never-served case.

Virtual-clock replay: main has a 564-second gap; branch waits or times out

Read-only live probe, also a temporary script:

cd apps/server && vp test run scripts/zz-proof-live.test.ts --silent=false --reporter=verbose

All five platform versions in published t3@0.0.45 report served; an unpublished linux-x64 version reports not served. Waiting for those five returns in 1,803 ms. No package was published.

Other recorded checks:

  • vp lint apps/server/scripts/publishOrder.ts apps/server/scripts/cli.ts apps/server/scripts/publishOrder.test.ts: exit 0, no findings.
  • vp fmt --check on changed files: exit 0.
  • vp run typecheck in apps/server: exit 0 at d9e96e17e0, no diagnostics in publishOrder*. vp run knip:check: exit 0 on an earlier commit with the same exports and imports; later commits change only the workflow timeout and test assertions.

Not checked:

  • A real npm publish.
  • The real release workflow end to end, including job duration under the 35-minute limit.
  • Whether npm's scan hold blocks metadata, tarballs or both. The probe requires both.
  • Registries other than registry.npmjs.org, which the probe uses directly.

Redo of closed #18251 after maria-rcks requested a substantially smaller readiness fix. Kept the wait, manifest-derived versions, GET/HEAD probe, timeout withholding t3 and 35-minute job limit. Dropped registry selection, URL/auth handling, per-request timeouts, backoff, concurrency, custom errors, stalled-body handling, manifest/tarball cross-checks, recovery docs and most tests. 51 non-test effective changed lines, 130 total, versus 1,007 in #18251.

Credits

BOTKooper reported #14409 and proposed holding the launcher. juliusmarminge triaged it, measured the gap and confirmed the direction. No code from other contributors.

Production fix and tests written with Claude Opus 5.5 via claude_auto using the Claude Code harness; PR description and images by GPT-6.1 Sol using the Codex harness, both in T3 Code.

🤖 Generated with Claude Code

only21mil and others added 3 commits October 14, 2026 21:09
…atform packages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng t3

npm scans each new version for minutes before it serves it, so the t3
launcher could go live while its platform package still returned 404 and
npx t3 then failed with no build for the platform (pingdotgg#14409). After the
platform uploads, poll npm until every version the launcher lists serves
its tarball, and time out without publishing t3 after 20 minutes. The
publish job timeout goes from 15 to 35 minutes so the wait fits on top
of the job's existing budget.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…are not served

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Oct 15, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The release path now performs external npm readiness checks and may defer or withhold publishing the t3 launcher for up to 20 minutes, with a corresponding production workflow timeout increase. This materially changes release sequencing and failure behavior beyond a purely mechanical or development-only change.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f850f997-e3a0-4a42-878f-6d34387b81f1
📥 Commits

Reviewing files that changed from the base of the PR and between 755accf and d9e96e1.

📒 Files selected for processing: 4
  • .github/workflows/release.yml
  • apps/server/scripts/cli.ts
  • apps/server/scripts/publishOrder.test.ts
  • apps/server/scripts/publishOrder.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

The CLI publish flow now checks that platform package tarballs are served by npm before it publishes the launcher. The release workflow’s publish_cli timeout increases from 15 to 35 minutes.

Changes: CLI package publishing

Layer / File(s) Summary
Check npm platform tarball availability
apps/server/scripts/publishOrder.ts, apps/server/scripts/publishOrder.test.ts
npmServesTarball checks version metadata and the tarball response. waitUntilServed polls pending package versions and times out after 20 minutes. Tests cover available, missing, and failed tarball checks, plus polling behavior.
Wait between platform and launcher publishes
apps/server/scripts/publishOrder.ts, apps/server/scripts/publishOrder.test.ts
publishPlatformsThenLauncher runs an optional wait after platform publishes succeed and before the launcher publish. Tests cover the order and verify that a wait failure prevents the launcher publish.
Wire availability checks into the CLI publish
apps/server/scripts/cli.ts, .github/workflows/release.yml
The CLI decodes optionalDependencies from t3/package.json and passes them to the availability wait. Dry runs pass an empty dependency map. The publish_cli timeout increases to 35 minutes.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant publishPlatformsThenLauncher
  participant npm
  CLI->>publishPlatformsThenLauncher: Publish platform tarballs
  publishPlatformsThenLauncher->>npm: Check platform package versions and tarballs
  npm-->>publishPlatformsThenLauncher: Return availability results
  publishPlatformsThenLauncher->>CLI: Start launcher publish after checks pass
Loading

Suggested reviewers: t3dotgg

Merge Risk: ⚪ Minimal · up to d9e96

Releases now hold the t3 launcher until npm serves every platform package. If a package is never served within 20 minutes, the release fails instead of publishing a broken launcher. No outstanding risk blocks merging.

Pre-merge checks: Passed 4
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the main change: the release now waits for npm to serve platform packages before publishing the t3 launcher. It uses a conventional commit prefix and is specific. The changeset matches…
Description check Passed The description covers the template's required areas. Problem: it explains that npx t3@nightly can install before npm serves the linux-x64 platform package, with timestamps. Change: it describes the r…
Linked Issues check Passed Directly linked open issue #14409 asks that npx t3@nightly runs when the launcher is live before npm serves its platform package. The change in apps/server/scripts/publishOrder.ts adds `waitUntilS…
Out of Scope Changes check Passed All changed areas support the wait-before-launcher objective: the workflow job timeout (needed for the wait budget), the publishOrder.ts helpers and the optional waitForPlatforms parameter, the `c…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: delayed npm tarball availability (their slow postpublish review) can break cli builds

1 participant