Skip to content

AI-3561: release.yml publishes only a checked version - #2226

Merged
kanat merged 5 commits into
mainfrom
ci/ai-3561-release-publishes
Nov 23, 2026
Merged

kanat merged 5 commits into
mainfrom
ci/ai-3561-release-publishes

Conversation

@kanat

@kanat kanat commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Why

AI-3561: release.yml has never published. None of its runs succeeded (gh run list -R GetStream/Agents --workflow release.yml --limit 45); v0.6.7 to v0.6.9 ended startup_failure, 0.7.0 skipped. Each of 0.6.5 to 0.6.9 reached PyPI before its run started: 1 to 9 minutes before for 0.6.5, 0.6.6, 0.6.7 and 0.6.9, 2 hours for 0.6.8 (PyPI upload_time vs the run's created_at), so it was uploaded by hand.

How it works

release published, tag vX.Y.Z            Release check (PR, or by hand)
        |                                        |
  release.yml: build-core                 release-check.yml: build
  environment pypi, id-token              no environment, no id-token
        |                                        |
        +--- build-python-packages action -------+
             uv build --all  (41 packages)
             check-release-version.sh  <-- every wheel and sdist == X.Y.Z
        |                                        |
  uv publish --trusted-publishing always   twine check, PyPI project list

Why each run failed, and what changes:

Run(s) Cause Evidence Now
v0.6.7 to v0.6.9 startup_failure run_tests.yml's lint job asked for actions: write (#609, 2026-07-08); release.yml grants only contents: read and id-token: write, and a called workflow cannot take more than its caller grants git show 019edac77:.github/workflows/run_tests.yml line 33; v0.6.6 (2026-07-01) predates #609, v0.6.7 (2026-07-14) is the first startup_failure Gone: #1488 removed actions: write; no actions: is left in .github/workflows/
v0.6.5, v0.6.6 failure at Publish to PyPI Build and version steps passed, publish failed. The files were already on PyPI (0.6.6: uploaded 15:10, run at 15:11), uploaded by hand. uv's own help says PyPI takes a same-file re-upload; a rebuilt file differs, so it would be refused. The run logs have expired (HTTP 410), so this is inferred job steps of run 28527723222; PyPI upload_time Not a workflow fault; see Questions
0.7.0 skipped Tag has no v release.yml:14 The release skill already says to tag vX.Y.Z
any release Nothing checked the version before upload. A checkout that does not see the tag builds 0.0.1.dev1+g... (probe on a shallow checkout without the tag) or 0.0.0 (fallback_version), and PyPI never takes a version twice probe in the details file check-release-version.sh fails the job before uv publish
any release vision-agents-plugins-omni and -stream are not on PyPI (404): they date from after 0.6.9 curl https://pypi.org/pypi/<name>/json Listed by the Release check as a warning; needs a pending publisher on PyPI (UNVERIFIED, Kanat)

A shallow checkout of the tag does give X.Y.Z (probe: git fetch --no-tags --depth=1 origin +<sha>:refs/tags/v9.9.9, as actions/checkout does; the version came out 9.9.9 over 82 files), so the checkout depth is not a cause.

Changes

  • .github/scripts/check-release-version.sh: the tag must be vX.Y.Z, every wheel and sdist in dist/ must carry that version, and any other file there (but .gitignore) fails it, since uv publish uploads all of dist/.
  • .github/actions/build-python-packages: setup (without uv sync: uv build needs no dev environment), clean, uv build --all, the script. release.yml and the new check both use it. The old hatch version step is gone: the script reads the same data from every built file, and the OIDC job no longer runs hatch from PyPI.
  • .github/workflows/release-check.yml: on a PR that touches the release files, or by hand, builds all packages at a local tag v99.0.0, checks that wrong tags and wrong files fail, runs twine check, and lists projects missing on PyPI. It has no uv publish, no pypi environment and no id-token.
  • release.yml: uses the action; uv publish --trusted-publishing always, since the default automatic carries on without credentials when uv cannot get a token.
  • release skill, steps 4 and 6: the new check, and the PyPI settings that only a human can read. Step 6 reads the jobs Build & Test Core SDK and Verify PIP install works of the run, not its conclusion.
  • Decision: the publish is not gated on the integration job (no needs), so a provider outage does not hold back a release. A run can end failure after a good publish; release.yml says so at build-core.

Validation

  • actionlint passes on release.yml and release-check.yml.
  • Release check, workflow_dispatch on this branch at 4015c708a: https://github.com/GetStream/Agents/actions/runs/45208993646, success. It built 82 files (41 packages) at 99.0.0, Install the project dependencies skipped, the step The build reports the tag's version logged build output: '99.0.0', tag: 'v99.0.0', 9 wrong-input controls failed as expected (wrong tag, no v, -rc1, wrong wheel, wrong sdist, empty dir, 99.0.0.post1 files, tag v99.0.0.1 with 99.0.0.1 files, a stray .zip), twine check passed, and the PyPI list warned about omni and stream. No uv publish step exists in that run.
  • Mutation on GitHub: with the action's check step removed (throwaway branch, deleted), the same job went red at The build reports the tag's version with build output: '', tag: 'v99.0.0' (https://github.com/GetStream/Agents/actions/runs/45209042497).
  • Mutations of the script, run locally with the workflow's own controls on the 82-file dist: 14 of 14 killed (tag-format check, tag regex $, empty dist, wheel field, sdist parse, per-file compare, prefix compare, wheel glob, sdist glob, first file only, exit 0, stray files allowed, .gitignore rejected, want keeping v); 2 equivalent (the ^ of the tag regex, nullglob). Removing the GITHUB_OUTPUT write fails the output step, simulated locally.

UNVERIFIED (Kanat, on pypi.org)

  • Each of the 41 projects lists GetStream/Agents, release.yml, environment pypi as a trusted publisher. The repo was renamed from Vision-Agents (the v0.6.9 run references GetStream/Vision-Agents/...), and the packages' Source URL still says Vision-Agents.
  • vision-agents-plugins-omni and -stream have a pending publisher.
  • No release has run the new release.yml job, so uv publish --trusted-publishing always itself is unrun.

Questions

  • plugins/local has no README (twine check warns "long_description missing"); AGENTS.md wants one. Left alone.

🤖 Generated with Claude Code

kanat and others added 2 commits November 23, 2026 16:21
…ag's version

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kanat
kanat marked this pull request as ready for review November 23, 2026 15:25
@kanat
kanat force-pushed the ci/ai-3561-release-publishes branch from d90c407 to 1c7e63a Compare November 23, 2026 15:33
@kanat
kanat marked this pull request as draft November 23, 2026 15:33

@kanat kanat left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Round-1 review at 1c7e63a (head already contains current main 1c87c73). CI: CodeQL, GitGuardian and labeler pass. Release check run 45205005732 at this head succeeded (82 files at 99.0.0, no uv publish, no cache restore or save). A second run, 45206502254, was in progress.

[Question] R1.4 (repo setting, not in the diff) The pypi environment has no deployment policy (gh api repos/GetStream/Agents/environments: deployment_branch_policy: null). So any branch workflow that names environment: pypi with id-token: write gets a token PyPI's trusted publisher accepts, for example a branch that adds workflow_dispatch to release.yml. This was already the case before the PR, and nothing in the PR adds it. Settle it with Kanat: restrict pypi to tags v* (the release environment already uses a policy). Ticket.

[Nit] R1.6 (author's Question 2) plugins/local/README.md exists but is empty (0 bytes), so twine check passes with warnings. Out of scope here. Ticket.

Checked and sound:

  • release-check.yml has only contents: read, no environment, no secrets, no id-token and no pull_request_target, so it cannot reach PyPI.
  • The startup_failure cause holds. At v0.6.9 (3a8eec104), run_tests.yml lint asks for actions: write against the caller's contents: read + id-token: write. It was added by #609, which is not in v0.6.6, and removed by #1488. No actions: is left in .github/workflows/.
  • The script cases all behave as they should: right tag, wrong tag, 99.0.0, -rc1, an empty or missing dist, 0.0.1.dev1+g... files, an sdist/wheel mismatch.
  • actionlint passes on both workflows.
  • Mutations: 15 of the script plus 1 of the action. 3 non-equivalent ones survive (R1.1). The release.yml call site cannot be pinned without a release.

Verdict: request changes, for R1.1 (the guard's $ and its exact compare are untested, and without them a non-vX.Y.Z tag would publish) and R1.2.


# Each wrong input must fail the version check. If one passes, the check no longer guards
# the upload.
- name: A wrong tag or a wrong file version must fail the check

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[Should fix] R1.1 Three mutants of the version guard survive this controls step, so the check can break and the Release check stays green:

  • check-release-version.sh:21 without the $: the tag v99.0.0rc1 or v99.0.0.1 passes the regex, and hatch-vcs builds exactly that version (probe: tag the commit v99.0.0rc1, uv build --package vision-agents --wheel gives vision_agents-99.0.0rc1-py3-none-any.whl; v99.0.0.1 gives 99.0.0.1). So a non-vX.Y.Z release would publish. The existing v99.0.0-rc1 row does not catch it, because the files in dist are at 99.0.0, so the file compare fails anyway.
  • :35 as a prefix match ([[ $version == "$want"* ]]): a file at 99.0.0.post1 passes.
  • The check step at build-python-packages/action.yml:32-38 removed, or its GITHUB_OUTPUT write at :40 removed: this job stays green, because the controls call the script directly and nothing reads the action's output. release.yml would then upload unchecked files, or test-core-index would install vision-agents==.

Rows to add (each one checked: it fails as expected on the head and passes under its mutant):
(a) a dir with one wheel and one sdist renamed to -99.0.0.1- / -99.0.0.1.tar.gz: fails .github/scripts/check-release-version.sh v99.0.0.1 <dir>
(b) a dir with a right wheel and an sdist renamed to 99.0.0.post1: fails .github/scripts/check-release-version.sh "$TAG" <dir>
(c) id: build on the build step at :47, and a step test "${{ steps.build.outputs.version }}" = "${TAG#v}".
The PR body calls the $ mutant equivalent. It is not, so update that line too.

@kanat kanat Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in f43a88a (rows) / 4015c70 head: release-check.yml now has row (a) fails ... v99.0.0.1 four (files renamed 99.0.0.1), row (b) fails ... "$TAG" post (right wheel + sdist 99.0.0.post1), and (c) id: build plus step test "${{ steps.build.outputs.version }}" = "${TAG#v}". Local mutations: M3 ($ dropped) killed by the four row, M10 (prefix compare) killed by the post row, simulated GITHUB_OUTPUT removal fails the (c) step. On GitHub, dispatch run https://github.com/GetStream/Agents/actions/runs/45208993646 is green (log: build output: '99.0.0', tag: 'v99.0.0'); with the action check step removed (throwaway branch, deleted) the job is red: https://github.com/GetStream/Agents/actions/runs/45209042497 (build output: '').

`cancelled` and 1 `skipped`. The packages of 0.6.5 to 0.6.9 reached PyPI outside it, and 0.6.9
has no Trusted Publishing provenance (AI-3561). Until AI-3561 is fixed, step 6 is unverified. If the run does not succeed, the packages are not on PyPI. Report it
on AI-3561, and do not upload by hand.
has no Trusted Publishing provenance (AI-3561). The first run of the fixed workflow is the first

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[Should fix] R1.2 Publishing is not gated on the integration job, and that is decided: provider suites being red must not block a release. But two things do not match this decision yet:

  • Step 6 of this skill (line 108) still says gh run list ... --workflow release.yml must show success. The integration job runs in the same workflow and has been red in every past run, so a release that published correctly ends failure.
  • The PR body still asks this as Question 1, and release.yml build-core (line 22) does not say that the missing needs: integration is deliberate.

Fix: step 6 checks the Build & Test Core SDK and Verify PIP install works jobs (gh run view <id> --json jobs) and says that the integration result is reported but does not gate. Add a one-line comment at build-core in release.yml. In the body, turn the question into the decision.

@kanat kanat Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 4015c70: skill step 6 now reads the jobs Build & Test Core SDK and Verify PIP install works via gh run view <id> --json jobs, says the run conclusion is not to be read and that integration is not a gate; release.yml has a comment at build-core; the PR body states the decision and Question 1 is removed.

want=${tag#v}

shopt -s nullglob
files=("$dist"/*.whl "$dist"/*.tar.gz)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[Nit] R1.3 Only *.whl and *.tar.gz are checked, but uv publish uploads every distribution it finds in dist/*. Today dist is cleaned first and uv build --all writes only these two kinds, so this cannot happen now. To make "every file has the version" hold whatever lands in dist, fail on any other file there except .gitignore. Ticket.

@kanat kanat Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in f43a88a: check-release-version.sh fails on any file in the dist dir that is not a wheel, an sdist or .gitignore. Test: row fails ... "$TAG" stray (a .zip beside right files); mutation M16 (stray files allowed) killed, M17 (.gitignore rejected) killed by the good build.

steps:
# No dependency cache in a job that holds an OIDC token: a cache poisoned by another
# run would hand that token to whatever it planted.
- uses: ./.github/actions/python-uv-setup

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[Nit] R1.5 This step runs a full uv sync --all-extras --dev --frozen (all extras, torch included) inside the job that holds id-token: write. uv build --all does not need it, because each build gets its own isolated env with the constrained backends. This was already there before the PR, so ticket: the job would install uv and Python only.

@kanat kanat Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 8884e08: python-uv-setup gets a sync input (default true), the build action passes sync: "false". The dispatch run 45208993646 shows Install the project dependencies skipped and uv build --all plus the version check green (82 files at 99.0.0).

kanat and others added 3 commits November 23, 2026 16:46
…ay files and the action output (R1.1, R1.3)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ronment (R1.5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n is not a gate (R1.2)

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

@kanat kanat left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Delta review, round 2 (head 4015c70, onto main 1c87c73). Verdict: GO. No new findings.

Prior findings:

  • R1.1 fixed. Mutants M3 (tag regex without $) and M10 (prefix compare) are killed by the new four and post rows. Removing the action's check step turns the job red at the new output step (run 45209042497). Removing the GITHUB_OUTPUT write fails the same step (simulated locally). 21 script mutants rerun on the real 82-file dist: 0 non-equivalent survivors. The equivalent ones are M2, M6 and the hidden-file pair M18/M20: uv publish skips hidden and invalidly named files, probed against a closed loopback port.
  • R1.2 fixed. SKILL.md step 6 names Build & Test Core SDK and Verify PIP install works, matching name: in release.yml exactly. The no-gate decision is stated at build-core and in the PR body.
  • R1.3 fixed. The stray-file check passes on the real uv build --all output (82 files plus .gitignore) and fails on a stray file (row stray; M16 and M19 killed).
  • R1.5 fixed. sync defaults to "true"; the other four python-uv-setup callers pass nothing and keep their behaviour. Only the OIDC job passes "false". In run 45208993646 the install step is skipped and the build and check are green. There is no uv publish step in that run.
  • R1.4 and R1.6 are tickets, out of scope.

CI: Build every package at the release version is skipped on the PR (draft, #2130); the workflow_dispatch run 45208993646 on this head is green.

Details: reviewer-2.md in the ledger.

@kanat
kanat marked this pull request as ready for review November 23, 2026 15:53
@kanat
kanat merged commit 284349e into main Nov 23, 2026
12 checks passed
@kanat
kanat deleted the ci/ai-3561-release-publishes branch November 23, 2026 16:58

@kanat kanat left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[security R1] Security review of 4015c70 (round 1, after merge). Verdict: GO.

Checked: the only job that can mint a PyPI token is still build-core in release.yml, run on a published v* release. This PR adds no trigger, input or job that reaches the pypi environment. Release check holds no environment, no id-token and no secrets. A fork pull request gets read-only permissions, so it cannot mint a token. The OIDC job now runs less code than before: no uv sync and no uvx hatch. The tag reaches the script only through env. The script's tag pattern admits only digits and dots, so a crafted tag name runs nothing and does not get past the check. Nothing that Release check writes (cache or artifact) is read by the release job.

One Nit inline.

with:
enable-cache: "false"
# `uv build` makes its own build environments and needs none of the dev dependencies.
sync: "false"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[Nit] S1.1 enable-cache: "false" and sync: "false" keep the OIDC job free of a restored cache and of the full dependency install. Nothing in release-check.yml asserts either one, so a later edit can flip them and every check stays green. Fix: after Build all distributions in release-check.yml, add test ! -e .venv (uv sync creates it, and setup-uv does not without activate-environment) and a check that this action still passes enable-cache: "false".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant