Skip to content

ci: sdk-tag never replaces a released SDK tarball - #229

Merged
foxnne merged 1 commit into
mainfrom
ci/sdk-tag-no-replace
Oct 8, 2026
Merged

foxnne merged 1 commit into
mainfrom
ci/sdk-tag-no-replace

Conversation

@foxnne

@foxnne foxnne commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

A merge to main that touches sdk/** without bumping sdk_version no longer repacks and replaces the latest SDK release's tarball.

Until now, every push touching sdk/** ran the pack and publish steps even when the version's tag already existed, and the publish step uploaded with --clobber. The released fizzy-sdk-v<version>.tar.gz was replaced by main's later sdk/. Plugins pin that asset by hash, so a replaced one fails every clean fetch.

It has already happened: sdk-v0.2.15 shipped on 10-02 (edb77afd). Its tarball was then repacked from #207's merge on 10-04 (run 37163565097 logs Release sdk-v0.2.15 exists — uploading/replacing asset, and the asset's createdAt is that run's). The store plugins have since moved to 0.2.16/0.2.17, so nothing should be fetching it now. sdk-v0.2.16 and sdk-v0.2.17 are intact: nothing has touched sdk/ since either shipped.

Now:

  • The tag step reports whether to publish. It publishes for a tag it just created. It also publishes for an existing tag whose release has no tarball (a run that failed after pushing the tag), and packs that one from the tag's own commit, not from main.
  • An existing tag that already has its tarball publishes nothing.
  • The upload no longer clobbers. If gh ever misreports a tarball as missing, the run fails instead of replacing it.

This needs to land before #230's release train. Under the train every SDK feature PR touches sdk/** without a version bump, so each one would have repacked the latest release.

SDK impact

  • None. Workflow only; no sdk/ file changes.

Verified

  • The tag step's script, run locally against a repo with an existing tag and a stubbed gh, behaves as intended in three cases:
    • asset present: publish=false, HEAD unchanged
    • asset missing: publish=true, tag checked out
    • gh erroring: publish=true from the tag, and the non-clobbering upload would then fail if the asset exists
  • The workflow parses; the three publish steps are gated on steps.tag.outputs.publish.
  • Not exercised on GitHub. It runs only on push to main; the first sdk/** merge after this one is the live test (expect "nothing to publish").

Follow-ups

  • Whether to restore sdk-v0.2.15's original tarball is your call. Its original hash is fizzy-0.2.15-SGBwY-gGGwAbpDp0riHXnY2CnhgJGPS51MxM5vLoVhiw, and it can probably be rebuilt by packing edb77afd's tree with that commit's own scripts/pack-sdk.sh on Linux, as CI did. Today's script writes .paths differently, so it may not match. zig fetch the result to check the hash before uploading.

🤖 Generated with Claude Code

Every push to main touching `sdk/**` ran the pack and publish steps even when the version's tag
already existed, and the publish step uploaded with `--clobber`: the released
`fizzy-sdk-v<version>.tar.gz` was replaced by main's later `sdk/`. Plugins pin that asset by hash,
so a replaced one fails every clean fetch. It has happened: `sdk-v0.2.15` was released on 10-02
and its tarball repacked from #207's merge on 10-04 (the asset's creation time is that run's).

Now a push that leaves `sdk_version` alone publishes nothing. The tag step reports whether to
publish: yes for a tag it just created, and for an existing tag whose release has no tarball (a run
that failed after pushing the tag), which is then packed from the tag's own commit, not from main.
The upload no longer clobbers, so if `gh` misreports a tarball as missing, the run fails rather
than replacing it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@foxnne
foxnne merged commit 9cbe523 into main Oct 8, 2026
4 checks passed
@foxnne
foxnne deleted the ci/sdk-tag-no-replace branch October 8, 2026 13:33
foxnne added a commit that referenced this pull request Oct 8, 2026
The step told agents to abandon `::<area>/<slug> ~ ::main@origin` after fetching, but by then the
bookmark is gone: GitHub deletes a merged branch, and `jj git fetch` abandons the changes only it
held (seen on #229's merge). What the step needs is the order: forget the PR's workspace first,
since a change still checked out somewhere is kept, then fetch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
foxnne added a commit that referenced this pull request Oct 8, 2026
* contributing: one step per PR, a required gate, SDK release train

How a change gets to main, written down where every session and contributor reads it. The rules
lived in one person's local agent memory, where a cloud session (or a second person) never saw
them, and CLAUDE.md had drifted (it still called the SDK "0.2.0, unreleased").

CONTRIBUTING.md, imported by CLAUDE.md: one plan step per PR (plans are issues, ~800 lines of
non-test diff, `<area>/<slug>` branches never reused, the PR title is the squash commit);
claiming work with a draft PR before building it; jj in a workspace of one's own; verifying and
saying how; and the SDK on a release train. A feature PR records `recorded_sdk_shape_fingerprint`
and leaves `sdk_version` alone; only an `sdk: release 0.2.N` PR bumps it. Two branches no longer
race for the same number, and a morning's SDK changes cost one repin round instead of several.
The doc comments in `sdk/src/version.zig`, `sdk/sdk_version.zig`, `sdk/src/dylib.zig` and
docs/PLUGINS.md that tied a bump to every fingerprint change now say the same.

CI: `ci-ok`, one job that passes when every other job passed or was skipped, is the check main's
ruleset requires (recorded in `.github/rulesets/main.json`). The workflow-level `paths-ignore`
goes, since it would leave a Markdown-only PR's required check waiting for good; a `changes` job
decides instead whether the builds run. CI also runs for `merge_group`, so a merge queue needs
no workflow change. RELEASING.md bumps VERSION through a PR, SDK release first if the
fingerprint moved. A PR template asks for the SDK impact and per-platform verification.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* contributing: after a merge, jj git fetch drops the merged stack

The step told agents to abandon `::<area>/<slug> ~ ::main@origin` after fetching, but by then the
bookmark is gone: GitHub deletes a merged branch, and `jj git fetch` abandons the changes only it
held (seen on #229's merge). What the step needs is the order: forget the PR's workspace first,
since a change still checked out somewhere is kept, then fetch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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