Skip to content

chore: prepare todoist react-compiler-tracker publishing - #238

Merged
henningmu merged 4 commits into
mainfrom
chore/github-org-rename-001
Nov 11, 2026
Merged

henningmu merged 4 commits into
mainfrom
chore/github-org-rename-001

Conversation

@henningmu

@henningmu henningmu commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

[Posted by Jarvis]

Migrate the GitHub owner and package scope to todoist, preserving the react-compiler-tracker executable and Release Please tag lineage. The first new-scope release is 3.0.5, through existing release PR #234; source and manifest remain 3.0.4 here.

The dependency gate is resolved: @todoist/tsconfig@2.0.2 is published on npm and its private GitHub mirror with matching integrity. This PR now includes the real registry lockfile and main's minimatch 11.0.5 patch. Node is pinned to 22.23.4 to satisfy the installed development dependency engine floor.

Release Please creates the normal release record and dispatches pack-only at its exact tag. Publication reuses the retained artifact, validates the original successful run attempt, artifact ID/API digest and reviewed source ancestry, and checks both registries before any write. Missing mirrors preserve original bytes and cannot downgrade latest. Cross-run npm provenance is disabled.

The npm package is public; the GitHub mirror remains private. Missing GitHub versions require readable package metadata; first-mirror absence requires active organization-owner evidence with the same credential. First publication uses the documented local owner path. Future workflow publication requires the protected package-release environment and npm trusted-publisher setup.

Validation on Node 22.23.4 / npm 11.21.2:

  • Real registry lock generation and clean install, without lifecycle scripts.
  • TypeScript/Biome checks, all 78 product tests, and build passed.
  • All 18 release safety tests passed, including original-attempt recovery and hidden-package 404 guards.
  • Actionlint and whitespace checks passed; only the existing Biome schema informational notice remains.
  • Fresh read-only review found no unresolved code blockers; its first-mirror runbook correction is included.

Push/PR effects were rechecked: source/title checks and doistbot only; no branch publication. Merging this PR updates the normal release PR. Merging #234 creates its standard tag/release and pack artifact; registry publication is a separate authorized step. See the release runbook.

@henningmu
henningmu requested a review from doistbot November 10, 2026 19:50

@doistbot doistbot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This PR prepares the migration of react-compiler-tracker to the todoist GitHub owner and npm scope, adding pack/publish release workflows with source-run validation, artifact verification, and registry collision guards, plus a release runbook and test coverage — with npm publication intentionally gated until @todoist/tsconfig@2.0.2 lands and the lockfile is regenerated.

Few things worth tightening:

  • The recovery-publication test asserts on the wrong mocked npm call (recoveryCalls[1], the dist-tags view lookup instead of the publish call at index 2), so the --tag=recovery and --provenance=false checks pass trivially — retarget the assertions to the publish call or filter by args[0] === 'publish' like the bootstrap test.

I also included a few optional follow-up notes in the details below.

Optional follow-up notes (7)
  • P3 .github/scripts/release.mjs:49: The react-compiler-tracker-v<version> tag convention and the main-or-matching-tag ref check are duplicated here and again in release.mjs line 90, while release-source.mjs defines the same rule in tagName and validateSourceRun. Extract the tag name and source-ref validation into one shared helper (or export them from one of these scripts) so the Release Please lineage stays defined in a single place.
  • P3 .github/scripts/release.mjs:231: The stable-version regexes and this numeric split/compare block reimplement semver parsing. semver is already installed as a transitive dev dependency (via @babel/* in package-lock.json); declaring it and using semver.valid/semver.gt removes the hand-rolled checks and rejects malformed versions like 3.0.05 that the current regex accepts.
  • P3 .github/scripts/release.mjs:278: destination means three different things depending on the command: sourceRef for verify, the dist-tag (latest/recovery) for bootstrap, and the registry for publish. In the bootstrap branch this positional is forwarded as tag, which works but is misleading and easy to break during future edits. Parse arguments per command or use distinct names for each positional.
  • P3 .github/scripts/release-source.mjs:69: The ['ahead', 'identical'].includes(...) main-ancestry assertion is duplicated here and in validateSourceRun (line 24). Extract a small helper for the comparison-status check so the two source-validation paths cannot drift.
  • P3 .github/scripts/release.test.mjs:121: The synthetic pack fixture only exercises valid package metadata, so validatePackage's rejection branches are never tested: an unmigrated @doist/ dependency, a file:/link:/workspace:/npm: spec, "private": true, and a packed publishConfig. A regression in any of these would let an internal, private, or locally-routed package ship without a failing test. Extend the fixture to assert pack throws for each invalid case (or unit-test validatePackage directly).
  • P3 .github/scripts/release.test.mjs:104: withRegistry is only exercised for the npm destination. The github path — required NODE_AUTH_TOKEN, the GitHub registry URL, and the ${NODE_AUTH_TOKEN} auth line npm expands at runtime — has no coverage, and the missing-token guard isn't asserted anywhere. Add a github case with NODE_AUTH_TOKEN set to verify scope/default registry routing, plus a test that withRegistry('github') throws when the token is absent.
  • P3 .github/scripts/release.mjs:1: The new .mjs release/test scripts are not matched by the lint-staged pattern in package.json (*.{js,ts,json,md}), so the husky pre-commit hook does not run Biome on them even though npm run check does in CI. The backend repository standard requires pre-commit hooks to enforce the same formatting/linting checks that run in CI (https://handbook.doist.com/doc/standard-backend-repositories-). Add mjs to the lint-staged glob (e.g., *.{js,mjs,ts,json,md}) so these files are checked locally.

Share Feedback • Review Logs

registry,
'recovery',
)
assert.ok(recoveryCalls[1].includes('--tag=recovery'))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

P2 These assertions inspect the wrong call: recoveryCalls[1] is the dist-tags view lookup (call 0 is the spec view, call 2 is publish), so all three checks pass trivially regardless of the publish arguments. The test never verifies that the recovery publication actually uses --tag=recovery and --provenance=false. Assert against recoveryCalls[2] (or filter for the call where args[0] === 'publish', as the bootstrap test at line 252 does).

@henningmu
henningmu requested a review from doistbot November 10, 2026 21:03

@doistbot doistbot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This PR prepares the migration of react-compiler-tracker to the todoist GitHub owner and npm scope, adding guarded release/publication workflows and scripts while keeping the executable, package visibility, and Release Please lineage intact.

Few things worth tightening:

  • The main-ancestry gate is inverted: compare(run.head_sha, 'main') accepting only ahead/identical means a normal release tag that main has moved past will be rejected as behind, while a commit not on reviewed main history can pass. Swap the operands (compare('main', run.head_sha)) in both the workflow and the pack CLI (line 215), and update the ['behind', 'diverged'] expectation in release-source.test.mjs (line 57) to match. This single check gates both retry packing and retained-artifact publication, so it's worth fixing before the release run.

I also included a few optional follow-up notes in the details below.

Optional follow-up notes (8)
  • P3 .github/scripts/release.mjs:1: The new .mjs release/test scripts aren't matched by the lint-staged glob in package.json (*.{js,ts,json,md}), so the husky pre-commit hook skips Biome on them even though npm run check lints them in CI. Add mjs to the glob (e.g. *.{js,mjs,ts,json,md}) so pre-commit enforces the same checks as CI.
  • P3 .github/scripts/release.test.mjs:121: The pack fixture only exercises valid metadata, so validatePackage's rejection branches are untested: an unmigrated @doist/ dependency, a file:/link:/workspace:/npm: spec, "private": true, and a packed publishConfig. A regression in any of these would let an internal, private, or misrouted package ship without a failing test. Extend the fixture (or unit-test validatePackage) to assert pack throws for each invalid case.
  • P3 .github/scripts/release.test.mjs:104: withRegistry is only exercised for the npm destination. The github path — required NODE_AUTH_TOKEN, the GitHub registry URL, and the ${NODE_AUTH_TOKEN} auth line npm expands at runtime — has no coverage, and the missing-token guard at release.mjs line 142 is never asserted. Add a github case with NODE_AUTH_TOKEN set, plus a test that withRegistry('github') throws when the token is absent.
  • P3 .github/scripts/release.mjs:235: The split/compare block reimplements semver comparison. semver is already present in node_modules as a transitive dependency (package-lock.json pins semver@6.3.2), so declare it directly and use semver.valid/semver.gt here instead. That also rejects non-normal versions such as 3.0.05, which the current ^\d+\.\d+\.\d+$ regex accepts.
  • P3 .github/scripts/release.mjs:50: The release tag convention and main-or-matching-tag ref check are re-declared here and again in pack (lines 90-91), duplicating tagName/validateSourceRun from release-source.mjs (which this file already imports). The ['ahead', 'identical'] ancestry status is likewise duplicated between validateSourceRun and the pack CLI block in release-source.mjs. Export shared helpers (e.g., tagName, isTrustedSourceRef, isOnReviewedMain) from release-source.mjs and import them here so the release lineage rule has a single definition.
  • P3 .github/scripts/release.mjs:272: The destination positional is command-dependent: it is sourceRef for verify (line 279), the dist-tag for bootstrap (forwarded as tag at line 286), and the registry name for publish (line 291). The shared name makes operator misuse easy to misread. Parse arguments per command or use distinct variable names (e.g. sourceRef, distTag, registry) so each branch is unambiguous.
  • P3 .github/scripts/release.mjs:218: Derive the registry URL from destination instead of accepting both independently. destination controls publication flags while registry controls the endpoint, so contradictory combinations are possible—the GitHub test case already passes the npm registry URL. Removing the separate registry parameter would reduce parameter sprawl and keep endpoint selection and publication flags tied to one routing decision.
  • P3 .github/scripts/release-source.test.mjs:92: releaseCommit rejects draft and prerelease GitHub releases, but the mock release fixture is always finalized (draft: false, prerelease: false), so retainedSource never exercises those guards. Add fixture patches with draft: true and prerelease: true and assert retainedSource throws; otherwise a regression could use a draft/prerelease release as the publish source.

Share Feedback • Review Logs

assert.ok(['main', tagName(version)].includes(run.head_branch), 'Untrusted source ref')
assert.equal(run.head_sha, tagSha, 'Run must build the exact release tag commit')
assert.ok(
['ahead', 'identical'].includes(compare(run.head_sha, 'main').status),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

P2 The main-ancestry comparison is inverted. compare(base, head) reports ahead when base has commits that head does not, so compare(run.head_sha, 'main') accepting only ahead/identical means the release commit must be ahead of (or equal to) the main tip. A normal release tag is an ancestor of main, so once any commit lands after the tag the result is behind and the documented pack.yml retry fails with "Source must be on reviewed main history". Worse, a tag/commit that is ahead of main (not in reviewed main history) would pass. Swap the operands and keep the accepted statuses: compare('main', run.head_sha) accepting ahead/identical (or accept behind/identical with the current order). The same inverted check exists in the pack CLI at line 215 and the ['behind', 'diverged'] rejection expectation in release-source.test.mjs line 57 needs updating accordingly.

@henningmu
henningmu requested a review from doistbot November 11, 2026 11:13
@henningmu

Copy link
Copy Markdown
Contributor Author

[Posted by Jarvis]

The tsconfig publication gate is resolved and the real lock/install/check/test/build all pass (78 product tests, 18 release safety tests). The C08 guard now requires readable GitHub package metadata or same-token active owner evidence for a missing first mirror.

I checked the ancestry concern against the actual GitHub API: compare/react-compiler-tracker-v3.0.4...main returns status: ahead, ahead_by: 5, behind_by: 0. GitHub reports HEAD relative to BASE, so accepting ahead/identical for source...main is correct and remains unchanged. Swapping these operands while keeping those statuses would reverse the gate.

@henningmu
henningmu marked this pull request as ready for review November 11, 2026 11:13
@henningmu
henningmu merged commit 7cdb53c into main Nov 11, 2026
3 checks passed
@henningmu
henningmu deleted the chore/github-org-rename-001 branch November 11, 2026 11:14
@henningmu

Copy link
Copy Markdown
Contributor Author

[Posted by Jarvis]

Released @todoist/react-compiler-tracker@3.0.5 after merging this PR and normal release PR #234. Both required checks passed before each merge.

  • Public npm package and private GitHub mirror both use latest3.0.5. Downloaded tarballs are byte-identical to the retained source artifact. GitHub's initial internal default was corrected to private and verified.
  • Pack run43010725925, original attempt1, artifact13849858446, source/tag commit 67f85980c9cafc5011e97baac0a317c3e90fdf8d. Tarball SHA256: ffe8246dcd973667def27b38bf571d84410678b7be196335ea9d722d24a8c835.
  • Real registry installs,78 product tests,18 release safety tests and build passed. Fresh consumers from each live registry installed successfully and the published CLI passed the existing five-file fixture with the expected diagnostics.

npm accepted the original direct publication before metadata became visible; read-only verification waited for propagation. No second publication or repack was performed. Cross-run provenance remains disabled.

The manual release is complete. Future automated releases still need the protected package-release environment and npm trusted-publisher configuration; neither was configured or exercised by this release. Private-mirror consumer workflow read grants remain separate from the owner-based verification.

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.

2 participants