Skip to content

feat(init): source Nitro contracts from release or workspace - #38

Merged
douglance merged 2 commits into
mainfrom
feat/nitro-contracts-source-workspaces
Aug 21, 2026
Merged

feat(init): source Nitro contracts from release or workspace#38
douglance merged 2 commits into
mainfrom
feat/nitro-contracts-source-workspaces

Conversation

@douglance

Copy link
Copy Markdown
Collaborator

Summary

  • replace init/bake Nitro version and branch selectors with a resolved contracts source
  • prefer NITRO_CONTRACTS_LOCAL_DIR, then a prepared sibling checkout, then pinned Nitro Contracts v3.2.0
  • pass the selected checkout through a BuildKit named context and reject incomplete workspaces early
  • stop producing new v2.1 builds while retaining existing published-image resolution
  • replace the bake action's version/branch inputs with nitro-contracts-ref

Compatibility

  • start and the run action retain nitro-contracts-version for selecting existing published images
  • existing v2.1 images remain resolvable; new init/rebuild and release publishing use Nitro 3.x
  • the default release is v3.2.0 at 2695e7b3e3f460531e2b77fed48a60561c54d90e

Checks

  • pnpm lint
  • pnpm build
  • pnpm typecheck
  • full 222-test Vitest suite with external artifact paths redirected to temporary fixtures
  • deployer Docker build from the pinned Git context
  • deployer Docker build from a prepared local v3.2.0 checkout
  • git diff --check

Supersedes #37, which remained based on the already-merged #34 branch and cannot be safely rewritten without a force-push.

@douglance

Copy link
Copy Markdown
Collaborator Author

Rebased onto main (which now carries the Docker Hub registry work: #41, #42, #43, #45). Force-push to this branch is blocked for me, so the rebased result is on rebase/nitro-contracts-source — fast-forward this branch onto it, or repoint the PR.

Conflict resolved

One conflict, in .github/workflows/release-testnode-image.yml: this PR deletes the nitro-contracts-version dispatch input, while main added dockerhub-repository and overwrite next to it. Kept both new inputs and took this PR's deletion.

Validation after rebase

pnpm lint, pnpm typecheck clean. pnpm test:run 256/259 — the 3 failures are the pre-existing packages/core/test/token-bridge.test.ts env failures that also fail on main (they need yarn install in a sibling token-bridge-contracts checkout).

Compatibility note worth acting on

This PR makes publishRowsForVariant drop everything but DEFAULT_NITRO_CONTRACTS_VERSION, so:

resolvePublishMatrix('all', 'all')  -> 7 rows, v3.2 only   (was 11 across v2.1 + v3.2)
resolvePublishMatrix('all', 'v2.1') -> 0 rows

That is intended for publishing, but mirror-to-dockerhub.yml on main derives its tag list from the same function. After this merges, mirroring a pre-existing release would silently omit its 4 nc2.1 tags, and passing nitro-contracts-version: v2.1 would fail with empty mirror matrix. Fixing that belongs in the mirror workflow, not here — it should enumerate tags that exist at the source (crane ls) rather than re-deriving what a release would publish. I'll open that separately.

douglance added a commit that referenced this pull request Aug 21, 2026
The mirror derived its tags from resolvePublishMatrix, which describes what a
release publishes *now*. #38 narrows that function to the default contracts
version, so `resolvePublishMatrix('all', 'all')` drops from 11 rows to 7 and
`(…, 'v2.1')` returns none at all. Mirroring an older release would then copy 7
of its 11 tags and report success, and asking for v2.1 would fail as an empty
matrix.

`crane ls` on the source repository answers what actually exists, so the mirror
copies what a release really published rather than what current rules would
publish. Verified against the live package: v0.2.10 resolves all 11 tags
including the four nc2.1 ones, a single variant+contracts filter resolves exactly
one, and an unknown version fails.

Both steps move into scripts/ci, matching the other CI helpers, so the loop is
readable and testable outside a workflow run. Behavior otherwise unchanged:
skip-if-current, refuse-on-divergence unless overwrite, digest asserted after
every copy.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@douglance
douglance force-pushed the feat/nitro-contracts-source-workspaces branch from 7196c0b to 4d4511c Compare August 21, 2026 17:27
@douglance
douglance merged commit 4829e53 into main Aug 21, 2026
7 checks passed
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