Skip to content

ci: fix binary drift — releases now build + commit binaries atomically - #10

Merged
jverre merged 1 commit into
mainfrom
fix/release-workflow-binary-drift
Jun 2, 2026
Merged

ci: fix binary drift — releases now build + commit binaries atomically#10
jverre merged 1 commit into
mainfrom
fix/release-workflow-binary-drift

Conversation

@jverre

@jverre jverre commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

What this PR does

Changes how the plugin's Go binaries get built and released, so a release can never again ship a binary that's out of date with the source.

Why

The 0.3.0 release shipped binaries that were built back in March — before the cc_workspace feature (and other June changes) existed. That's why Claude Code traces were going to the wrong Opik workspace even though the config and source code were both correct.

The reason the binaries were stale: CI used to rebuild them on every push to main and commit them straight back to main. But main is now a protected branch that requires pull requests, so CI's direct push got rejected every time:

remote: error: GH006: Protected branch update failed for refs/heads/main.
remote: - Changes must be made through a pull request.

CI didn't fail loudly — the binaries just silently never updated, and the next release picked up the old ones.

This matters because installing the plugin pulls the binaries committed in the repo (main), so if those are stale, every user gets stale binaries.

The fix

  • release.yml — now a single button you trigger manually (Actions → Release, or gh workflow run release.yml -f version=0.3.1). It bumps the version, rebuilds the binaries, and commits both together, then tags and publishes the release. Version and binaries always move as one, so they can't drift apart. It pushes to main using a PAT that's allowed past branch protection (same approach the main opik repo uses).
  • build.yml — simplified to a PR check that just confirms the code still compiles (go vet + make build). It no longer tries to push to main.
  • Makefile — added -trimpath so builds are reproducible regardless of which machine runs them.

How to cut a release after this merges

Actions tab → Release → Run workflow → enter the version (e.g. 0.3.1), or:

gh workflow run release.yml -f version=0.3.1

One-time setup needed from an org admin

The release workflow can only push to main if:

  1. The GH_PAT_TO_ACCESS_GITHUB_API org secret is shared with this repo.
  2. The PAT's owner is on the bypass list for the main branch rule.

(The same PAT already pushes to main in the opik repo, so this likely already works org-wide.)

Good to know

Binaries are now rebuilt only at release time. So after merging meaningful source changes, cut a release — otherwise main will temporarily serve binaries that lag the source to anyone installing in between.

🤖 Generated with Claude Code

…cally

The 0.3.0 release shipped binaries from March that predated the cc_workspace
override (and other June features), so plugin traces went to the SDK workspace
instead of cc_workspace. Root cause: build.yml auto-committed rebuilt binaries
directly to main, but a main-branch ruleset now requires PRs, so the bot's push
was rejected (GH006). The build silently failed and a stale binary was released.

Marketplace installs clone main HEAD from the git tree (not release assets), so
bin/ on main must always match src/. Fix:

- release.yml: convert to a manually-triggered workflow_dispatch that bumps the
  version in plugin.json, rebuilds binaries, and commits both in one commit, then
  tags and publishes. Pushes via GH_PAT_TO_ACCESS_GITHUB_API so it can write to
  the protected main branch. Version and binaries can no longer drift.
- build.yml: reduce to a PR-only compile check (go vet + make build); no longer
  pushes to main.
- Makefile: add -trimpath so cross-platform builds are reproducible across hosts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jverre
jverre merged commit 7bd0717 into main Jun 2, 2026
1 check 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.

2 participants