Skip to content

chore: initialize v1 version - #209

Draft
scarmuega wants to merge 2 commits into
mainfrom
feat/initialize-v1-version
Draft

chore: initialize v1 version#209
scarmuega wants to merge 2 commits into
mainfrom
feat/initialize-v1-version

Conversation

@scarmuega

Copy link
Copy Markdown
Member

Branches the interface into a stable v1 package, copied verbatim from v1beta — all seven modules, handshake included. Per the side-by-side policy in README.md, v1alpha and v1beta stay live and untouched.

Opened as a draft: no CI run has exercised this yet, and the stability posture of a v1 package is a committee call, not a maintainer one. Not for self-merge.

The v1 copy

proto/utxorpc/v1/ is proto/utxorpc/v1beta/ with v1betav1 (28 occurrences: 7 package lines, 4 imports, 17 fully-qualified type refs). The protos carry no option statements, so every language namespace derives from the proto package and nothing else needed rewriting. Each file is byte-identical to sed 's/v1beta/v1/g' of its source.

Accommodations, mirroring #183 and #186

  • buf.gen.dotnet.v1.yaml plus a Generate dotnet v1 step in generate.yml. The C# generators emit flat files named after the proto basename, so every version must get its own buf invocation and output dir or they collide on Query.cs, Sync.cs, etc. — the problem fix(dotnet): separate codegen for v1alpha and v1beta #186 fixed for v1beta.
  • Rust: utxorpc-v1-* features and a pub mod v1 block. Written by hand in prost-crate's exact output shape; CI's regeneration should be a no-op diff.
  • Python: utxorpc.v1.sync.sync_pb2 added to the import smoke test.
  • buf.gen.yaml's dotnet NOTE was stale — it said --path (the workflow uses --template) and named v1alpha/v1beta specifically. Rewritten to state the actual cause in version-agnostic terms.

Backfilling v1beta

Three hand-maintained scaffolds were never updated when v1beta landed, so v1beta is not reachable from the published Node and Haskell packages today. Adding a third version without fixing these would have compounded the drift.

  • gen/node/src/index.ts exported v1alpha only, using flat unversioned names (export * as sync from ".../v1alpha/sync/sync_pb.js") that a second version collides on — which is likely why v1beta was never added. Split into per-version barrels with the root exporting v1/v1alpha/v1beta namespaces. The root still re-exports v1alpha, so existing spec.sync / spec.cardano callers are unaffected.
  • gen/haskell/utxorpc.cabal listed only V1alpha modules (and omitted Bitcoin). Anything absent from exposed-modules is silently dropped by stack sdist. Now covers all three versions — 40 entries, 14/12/14.
  • utxorpc-v1beta-handshake has been missing from the Rust crate since feat: handshake support #190 added handshake.proto without regenerating the crate scaffold.

The .gitignore rule for gen/node/src/ had to become gen/node/src/* for the new barrels to be re-includable — git cannot re-include a file whose parent directory is excluded. Same shape as the existing gen/dotnet/* rule. Verified the generated utxorpc/ tree is still ignored.

Verification

buf was not run locally (the plugin chain needs protoc, four prost/tonic plugins, proto-lens-protoc, the node plugins and a .NET SDK). Static checks that passed: verbatim proto copy per module, no v1beta stragglers under v1/, every cabal entry maps to a real .proto, _connect barrels exactly match the four protos declaring a service, and proto/feature/module counts agree per version (7/6/7).

CI is the gate. Worth watching in the dry-run:

  • Generate dotnet v1 — this is where a paths filter that over-matches v1alpha/v1beta would fail on duplicate output paths. If buf disagrees with component-wise matching, the fallback is enumerating the seven module dirs.
  • publish-node runs tsup, which fails if a barrel names a file connect-es didn't emit.
  • publish-haskell runs stack build, which fails on any exposed-modules entry with no generated .hs.
  • publish-dotnet runs dotnet build — the real test that three flat C# trees coexist.

Out of scope

  • Deprecating or freezing v1beta.
  • Adding buf breaking CI. There is no buf.yaml in the repo at all, so nothing mechanically enforces the no-breaking-changes guarantee README.md promises for an unflagged version. Worth a separate issue now that v1 exists.
  • The spec-wide version bump, which is the releasing maintainer's step.

🤖 Generated with Claude Code

scarmuega and others added 2 commits August 17, 2026 11:54
Branches the interface into a stable `v1` package, copied verbatim from
`v1beta` (all seven modules, `handshake` included). Per the side-by-side
policy in README.md, `v1alpha` and `v1beta` stay live and untouched.

The accommodations mirror those added for `v1beta` in #183 and #186:

- `buf.gen.dotnet.v1.yaml` plus a `Generate dotnet v1` step. The C# generators
  emit flat files named after the proto basename, so each version needs its own
  buf invocation and output dir or they collide on Query.cs, Sync.cs, etc.
- `utxorpc-v1-*` features and a `pub mod v1` block in the Rust scaffold.
- `utxorpc.v1.sync.sync_pb2` added to the python import smoke test.

Also backfills `v1beta`, which was never wired into three hand-maintained
scaffolds and so is not reachable from the published packages today:

- `gen/node/src/index.ts` exported v1alpha only, using flat unversioned names
  that a second version would collide on. Split into per-version barrels; the
  root still re-exports v1alpha, so existing callers are unaffected.
- `gen/haskell/utxorpc.cabal` listed only V1alpha modules, so `stack sdist`
  silently dropped the rest. It now covers all three versions.
- `utxorpc-v1beta-handshake` has been absent from the Rust crate since #190.

The `.gitignore` rule for `gen/node/src/` became `gen/node/src/*` so the new
barrels can be re-included; git cannot re-include a file whose parent
directory is excluded.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`pr-check.yml` has failed at startup on every pull request since #204 merged
on 2026-05-19. The last run that actually executed was 2026-05-13.

#204 added `permissions: id-token: write` to publish-all's `publish-node` job
for npm trusted publishing. A reusable workflow cannot request more permission
than its caller grants, and `pr-check.yml` caps the whole workflow at
`contents: read`, so the call is rejected before any job starts.

`release.yml` and `dry-run.yml` declare no top-level `permissions` block, so
they inherit the repository default and were unaffected — which is why releases
kept publishing while PR validation was silently dead.

Granted on the calling job rather than workflow-wide, so the `codegen` job
keeps the narrower `contents: read`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 8fbbfa5)
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