Repository navigation
AI-3561: release.yml publishes only a checked version - #2226
Conversation
…ag's version Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…teps Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d90c407 to
1c7e63a
Compare
kanat
left a comment
There was a problem hiding this comment.
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.ymlhas onlycontents: read, no environment, no secrets, noid-tokenand nopull_request_target, so it cannot reach PyPI.- The
startup_failurecause holds. At v0.6.9 (3a8eec104),run_tests.ymllint asks foractions: writeagainst the caller'scontents: read+id-token: write. It was added by #609, which is not in v0.6.6, and removed by #1488. Noactions: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. actionlintpasses on both workflows.- Mutations: 15 of the script plus 1 of the action. 3 non-equivalent ones survive (R1.1). The
release.ymlcall 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 |
There was a problem hiding this comment.
[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:21without the$: the tagv99.0.0rc1orv99.0.0.1passes the regex, and hatch-vcs builds exactly that version (probe: tag the commitv99.0.0rc1,uv build --package vision-agents --wheelgivesvision_agents-99.0.0rc1-py3-none-any.whl;v99.0.0.1gives99.0.0.1). So a non-vX.Y.Zrelease would publish. The existingv99.0.0-rc1row does not catch it, because the files indistare at 99.0.0, so the file compare fails anyway.:35as a prefix match ([[ $version == "$want"* ]]): a file at99.0.0.post1passes.- The check step at
build-python-packages/action.yml:32-38removed, or itsGITHUB_OUTPUTwrite at:40removed: this job stays green, because the controls call the script directly and nothing reads the action's output.release.ymlwould then upload unchecked files, ortest-core-indexwould installvision-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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
[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.ymlmust showsuccess. Theintegrationjob runs in the same workflow and has been red in every past run, so a release that published correctly endsfailure. - The PR body still asks this as Question 1, and
release.ymlbuild-core(line 22) does not say that the missingneeds: integrationis 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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
[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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
[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.
There was a problem hiding this comment.
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).
…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
left a comment
There was a problem hiding this comment.
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 newfourandpostrows. Removing the action's check step turns the job red at the new output step (run 45209042497). Removing theGITHUB_OUTPUTwrite 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 publishskips hidden and invalidly named files, probed against a closed loopback port. - R1.2 fixed. SKILL.md step 6 names
Build & Test Core SDKandVerify PIP install works, matchingname:in release.yml exactly. The no-gate decision is stated atbuild-coreand in the PR body. - R1.3 fixed. The stray-file check passes on the real
uv build --alloutput (82 files plus.gitignore) and fails on a stray file (rowstray; M16 and M19 killed). - R1.5 fixed.
syncdefaults to "true"; the other fourpython-uv-setupcallers pass nothing and keep their behaviour. Only the OIDC job passes "false". In run 45208993646 the install step isskippedand the build and check are green. There is nouv publishstep 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
left a comment
There was a problem hiding this comment.
[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" |
There was a problem hiding this comment.
[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".
Why
AI-3561:
release.ymlhas 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 endedstartup_failure, 0.7.0skipped. 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 (PyPIupload_timevs the run'screated_at), so it was uploaded by hand.How it works
Why each run failed, and what changes:
startup_failurerun_tests.yml's lint job asked foractions: write(#609, 2026-07-08);release.ymlgrants onlycontents: readandid-token: write, and a called workflow cannot take more than its caller grantsgit show 019edac77:.github/workflows/run_tests.ymlline 33; v0.6.6 (2026-07-01) predates #609, v0.6.7 (2026-07-14) is the firststartup_failureactions: write; noactions:is left in.github/workflows/failureatPublish to PyPIupload_timeskippedvrelease.yml:14vX.Y.Z0.0.1.dev1+g...(probe on a shallow checkout without the tag) or 0.0.0 (fallback_version), and PyPI never takes a version twicecheck-release-version.shfails the job beforeuv publishvision-agents-plugins-omniand-streamare not on PyPI (404): they date from after 0.6.9curl https://pypi.org/pypi/<name>/jsonA shallow checkout of the tag does give
X.Y.Z(probe:git fetch --no-tags --depth=1 origin +<sha>:refs/tags/v9.9.9, asactions/checkoutdoes; 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 bevX.Y.Z, every wheel and sdist indist/must carry that version, and any other file there (but.gitignore) fails it, sinceuv publishuploads all ofdist/..github/actions/build-python-packages: setup (withoutuv sync:uv buildneeds no dev environment), clean,uv build --all, the script.release.ymland the new check both use it. The oldhatch versionstep 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 tagv99.0.0, checks that wrong tags and wrong files fail, runstwine check, and lists projects missing on PyPI. It has nouv publish, nopypienvironment and noid-token.release.yml: uses the action;uv publish --trusted-publishing always, since the defaultautomaticcarries on without credentials when uv cannot get a token.releaseskill, steps 4 and 6: the new check, and the PyPI settings that only a human can read. Step 6 reads the jobsBuild & Test Core SDKandVerify PIP install worksof the run, not its conclusion.integrationjob (noneeds), so a provider outage does not hold back a release. A run can endfailureafter a good publish;release.ymlsays so atbuild-core.Validation
actionlintpasses onrelease.ymlandrelease-check.yml.workflow_dispatchon this branch at4015c708a: https://github.com/GetStream/Agents/actions/runs/45208993646, success. It built 82 files (41 packages) at99.0.0,Install the project dependenciesskipped, the stepThe build reports the tag's versionloggedbuild output: '99.0.0', tag: 'v99.0.0', 9 wrong-input controls failed as expected (wrong tag, nov,-rc1, wrong wheel, wrong sdist, empty dir,99.0.0.post1files, tagv99.0.0.1with99.0.0.1files, a stray.zip),twine checkpassed, and the PyPI list warned aboutomniandstream. Nouv publishstep exists in that run.The build reports the tag's versionwithbuild output: '', tag: 'v99.0.0'(https://github.com/GetStream/Agents/actions/runs/45209042497).dist: 14 of 14 killed (tag-format check, tag regex$, emptydist, wheel field, sdist parse, per-file compare, prefix compare, wheel glob, sdist glob, first file only,exit 0, stray files allowed,.gitignorerejected,wantkeepingv); 2 equivalent (the^of the tag regex,nullglob). Removing theGITHUB_OUTPUTwrite fails the output step, simulated locally.UNVERIFIED (Kanat, on pypi.org)
GetStream/Agents,release.yml, environmentpypias a trusted publisher. The repo was renamed fromVision-Agents(the v0.6.9 run referencesGetStream/Vision-Agents/...), and the packages'SourceURL still saysVision-Agents.vision-agents-plugins-omniand-streamhave a pending publisher.release.ymljob, souv publish --trusted-publishing alwaysitself is unrun.Questions
plugins/localhas no README (twine checkwarns "long_description missing"); AGENTS.md wants one. Left alone.🤖 Generated with Claude Code