Skip to content

ci: publish threadplane-middleware with uv, ending the twine metadata skew - #873

Merged
blove merged 1 commit into
mainfrom
blove/fix-middleware-publish-metadata
Aug 30, 2026
Merged

ci: publish threadplane-middleware with uv, ending the twine metadata skew#873
blove merged 1 commit into
mainfrom
blove/fix-middleware-publish-metadata

Conversation

@blove

@blove blove commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

The first real publish attempt for middleware 0.0.2 failed after a green dry-run, uploading nothing:

InvalidDistribution: Invalid distribution metadata: '2.5' is not a valid metadata version

Root cause is toolchain skew inside our own workflow: uv build (latest) emits Metadata-Version 2.5; the dry-run step validates with uv publish --dry-run (accepts it); the real step used the pinned pypa/gh-action-pypi-publish image whose bundled twine predates 2.5 (rejects it). The two paths disagreed about the same artifact, so the dry-run could not have caught this — by construction.

Fix

Real release now uses uv publish --trusted-publishing always — the same toolchain as build and dry-run, so this class of skew is gone rather than patched. PyPI trusted publishing binds to repo + workflow filename, not to the publishing action, so the existing OIDC grant works unchanged (id-token: write already present).

Trade-offs stated plainly

  • PEP 740 attestations are lost — the pypa action uploaded them (attestations: true); uv publish doesn't support them yet. Acceptable against a publish path that cannot ship at all; worth revisiting when uv grows support.
  • Alternative considered: bumping the action pin to v1.14.2 (tag dereferenced to dc37677b). Rejected because it re-introduces the same skew the next time uv's metadata gets ahead of the action's twine — this failure mode recurs by design with two toolchains.

Verification note

This can only be truly verified by the next real publish (workflow_dispatch is manual). YAML validated; the dry-run path is untouched and stays green. I'll run the 0.0.2 publish immediately after this merges.

🤖 Generated with Claude Code

… skew

The real-release path used the pinned pypa/gh-action-pypi-publish image,
whose bundled twine rejects the Metadata-Version 2.5 that current uv build
emits: 'InvalidDistribution: 2.5 is not a valid metadata version'. The
dry-run path already used uv publish and passed — the two paths disagreed
about the artifact between them. Observed on the first real 0.0.2 publish
attempt (dry-run green, real release red, nothing uploaded).

Build, dry-run, and publish now share one toolchain. PyPI trusted
publishing binds to repo + workflow filename, not the action, so the same
OIDC grant works; uv consumes it via --trusted-publishing always.

Trade-off, stated: the pypa action also uploaded PEP 740 attestations.
uv publish does not yet; losing them is acceptable against a publish path
that cannot ship at all.

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

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview Aug 30, 2026 4:44pm

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@blove
blove enabled auto-merge (squash) August 30, 2026 16:42
@blove
blove merged commit 8b53f1f into main Aug 30, 2026
27 checks passed
blove added a commit that referenced this pull request Aug 30, 2026
…e 0.0.3 (#878)

Restores what #873 traded away, without reintroducing the toolchain skew.
uv publish UPLOADS attestation files found beside the dists by default
(--no-attestations is the opt-out) — it just doesn't MINT them. Astral's
own publishing example pairs it with astral-sh/attest-action for exactly
that. One toolchain end to end, attestations back.

- attest step gated to the real release (a dry run uploads nothing for
  attestations to accompany); SHA pin f589a42a verified against tag v0.0.6
  (lightweight tag, commit direct); the action's input is  (glob) —
  caught by reading action.yml at the pinned SHA, not the README
- middleware bumped to 0.0.3: attestations are only provable on a fresh
  upload, and PyPI versions are immutable. No code change; consumers pin
  >=0.0.2 and are unaffected. The 0.0.3 upload doubles as the verification
  (simple-API provenance must flip from 'none')

Verified locally: 0.0.2 artifacts pass current twine check (Metadata 2.5),
YAML parses.

Co-authored-by: Claude Opus 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