Skip to content

ci(go): publish moq.dev/moq-ffi to go.moq.dev from release (backport #8743) - #9844

Open
kixelated wants to merge 4 commits into
releasefrom
backport/go-module-proxy
Open

kixelated wants to merge 4 commits into
releasefrom
backport/go-module-proxy

Conversation

@kixelated

@kixelated kixelated commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

moq.dev's go-import tag has sent moq.dev/moq-ffi to mod https://go.moq.dev since 2026-11-21, but releases ship from release, whose release-go-ffi.yml still pushes only to the moq-dev/moq-go-ffi git mirror. So moq-ffi-v0.4.28 (2026-11-23) reached the mirror and never go.moq.dev:

  • go get moq.dev/moq-ffi@v0.4.28 fails through proxy.golang.org and with GOPROXY=direct (reading https://go.moq.dev/moq.dev/moq-ffi/@v/v0.4.28.info: 404 Not Found).
  • Every Release Go wrapper run since has failed in package-wrapper downloading it: 45150250878, 45321435938, 45701155545, 46042922155. moq.dev/moq is stuck at v0.7.27.
  • The next moq-ffi patch from release would repeat it, and the mirror (862 MB) keeps growing toward GitHub's 1 GB guidance.

Approach

Port moq-dev/moq#8743's publisher from main, file for file where possible so the next cut merges cleanly:

  • release-go-ffi.yml: the publish job (now in the publish Environment, which already allows moq-ffi-v* tags and holds the R2 key) reads moq.dev's go-import tag with just go ffi-origin and runs just go publish-ffi (go.moq.dev) for mod, or just go publish-ffi-mirror for git. The dry-run job builds the GOPROXY files.

  • release-go.yml: the push gate asks the same origin whether the pinned ffi version is published, so a version missing from go.moq.dev defers to the FFI release chain instead of failing.

  • Copied from main: sh/go/publish-ffi.sh, publish-ffi-mirror.sh, ffi-origin.sh, sh/go/modzip/, infra/go/{r2,upload,verify}.sh (only what the publisher calls; the Worker and backfill deploy from main), and package-ffi.sh's README wording.

  • Hand-ported: the three go/justfile recipes, the go.moq.dev paragraphs of go/ffi/README.md, and the sh/go/modzip/** path in release-gate.yml's Go FFI filter.

  • Review fix, also on main in moq-dev/moq#9843: publish-ffi.sh counts a version as uploaded once its .zip is in the bucket, not its .info, and a rerun uploads only whichever of .mod and .info the bucket lacks (a backfilled version's .info carries the mirror commit's time). A rerun that rebuilds the native libs makes a byte-different zip, which the immutable upload would refuse forever.

  • doc/lib/go/index.md takes main's line on where moq.dev/moq-ffi comes from.

The copied workflows also take main's newer action pins (dependabot bumps of the same majors) and its cache: false on setup-go.

v0.4.28 itself still needs publishing to go.moq.dev once; that is a one-time step with an R2 key, tracked in moq-dev/moq#9843's quest.

Impact

None. Release CI only; no public API or wire change. The next moq-ffi release publishes to go.moq.dev instead of the git mirror.

Caused by

  • moq-dev/moq#8743 - gated the cutover on the release job reading moq.dev's go-import tag, but landed that job only on main, while releases run from release (found by person: the quest's start session; no incident id)

Decisions

  • Review: the wrapper push gate probes the ffi version's .info (uploaded last) rather than its .mod, changed on main too in moq-dev/moq#9843 so the two stay identical. Kept as before: the FFI completion run builds the tag's SHA, so a wrapper commit pushed during an upload waits for the next push, as it did before this PR. Refuted the publish Environment question: its policy lists moq-ffi-v* and it holds APP_CLIENT_ID, APP_PRIVATE_KEY, and the R2 key.

  • Port main's files verbatim, mirror path and ffi-origin included. Rejected: a go.moq.dev-only publisher on release (smaller, but drops the rollback path of pointing moq.dev back at the mirror, and conflicts with main at the next cut).

  • Backport now rather than wait for the 0.22.0 cut, which waits on m0 to m2 work; until then every moq-ffi patch would miss go.moq.dev.

  • Leave v0.4.28's one-time upload to the maintainer. Rejected: an agent minting an R2 token from the Cloudflare admin token in Bitwarden to write the production bucket unattended; the upload pins the version's hash in sum.golang.org for good.

Alternatives

  • Point moq.dev back at the mirror until the cut: restores v0.4.28 without an R2 key, but puts every patch until the cut back on the mirror, which passes 1 GB in about three releases.

Validation

  • The ported publish-ffi.sh --dry-run, fed a tarball of the mirror's v0.4.27 tree, prints h1:PCXoyW1QTUN2XnM4pkAIBGpOAFjhm1OmCyPfPHszKPc=, the hash sum.golang.org pinned for v0.4.27, and the same run on the mirror's v0.4.28 tree builds v0.4.28.{info,mod,zip} (h1:es2x8Bh+q8lcP7qr9C14xeO8DOFcfs9IxXql3fOQznA=).
  • sh/shell.sh check, just --fmt --check on both justfiles, just gh check (actionlint, alert coverage), and sh/markdown.sh check pass. zizmor on the two workflows: 2 high findings on release (cache-poisoning, dangerous-triggers) drop to 0; the 8 low self-repository notes are the same as main's.
  • Not run locally: just go check, which this nested worktree cannot build (its parent checkout's .cargo/config.toml fails to merge); this diff changes no Go source it builds. The Release gate's Go FFI dry-run runs on this PR.
  • The partial-upload path, against a local GO_BUCKET holding only a stand-in v0.4.28.zip: it keeps that zip, uploads this build's .mod and .info, and lists v0.4.28 (the closing verify --proxy direct then 404s, since the real go.moq.dev holds nothing).
  • The real check is the next moq-ffi-v* tag's Publish to go.moq.dev step.

Models

  • Size: S
  • Implementer: Claude Code, claude-opus-5-5, unknown (arm A)

(Written by Claude Opus 5.5)

Review

Rewritten by quest review after each round.

  • Head: 8967409

  • Base: origin/release at e3064ac

  • Risk: high, it changes .github/workflows/release-gate.yml, which is always high, as are 2 more of its paths: workflows run with the repository's secrets

  • Classified: high by the always-high paths

  • Risk file: none

  • Reviewer: Codex, gpt-6.2-sol, medium effort

  • Session: 01a2214d-3e58-77b1-b888-cd6b7582e91c, round 3

  • Score: 10/10, The proxy gate now waits for the completed FFI upload, and the remaining deferral behavior matches the merge base.

  • Rounds: 3; first round 2 (medium 2); findings 2 (medium 2): fixed 2, refuted 0, open 0

  • Findings: none

  • The last round's findings, at 57d6aa5:

    • Fixed: medium, .github/workflows/release-go.yml:180: Preserve wrapper pushes made during an FFI upload; `.github/workflows/release-go.yml:181` now probes `.info`, which `infra/go/upload.sh:36`–`37` uploads after `.mod` and `.zip`, and the completion run's tag-SHA checkout at `.github/workflows/release-go.yml:106` already existed at the merge base.
  • Reviewer: Claude Code, claude-opus-5-5, medium effort, second

  • Session: 62d36cea-8a1b-4340-a6fb-1e328668205d, round 3

  • Score: 9/10, The only change since the last round points the gate's go.moq.dev probe at the `.info` file, which upload.sh uploads last, so the gate now waits for a complete version and nothing holds the head.

  • Rounds: 3; first round 2 (medium 2); findings 2 (medium 2): fixed 1, refuted 1, open 0

  • Findings: none

…8743)

moq.dev's go-import tag has said `mod https://go.moq.dev` since 2026-11-21,
but `release` still pushed each moq-ffi release to the git mirror only, so
moq.dev/moq-ffi v0.4.28 never reached go.moq.dev and every Go wrapper release
since has failed to download it.

Port main's publisher: release-go-ffi.yml picks go.moq.dev or the mirror by
moq.dev's go-import tag, publish-ffi.sh builds the version with sh/go/modzip
and uploads it through infra/go's upload and verify scripts, and the wrapper's
push gate asks the same origin whether the ffi version is published.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated and others added 3 commits November 28, 2026 00:45
A rerun that rebuilds the native libs makes a byte-different zip, which the
immutable upload refuses, so a run that died after the zip went up left the
version unpublishable. Count the zip as published and upload only the .mod and
.info the earlier run missed. Also port main's Go guide line on the ffi module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 28, 2026 09:10

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant