Repository navigation
fix(release): let a storage contract bump pass the companion gate - #1948
Conversation
A storage contract bump deadlocked the release gate. adcp 10.0.0b24 (contract 3) refuses to publish beside adcp-reporting-storage 0.2.0b4 (contract 2), and the storage release cannot publish first: with its floor at 10.0.0b4 it is smoked against contract-2 adcp and fails, and with its floor at 10.0.0b24 no published adcp satisfies it. When the storage floor is newer than every adcp on PyPI, the storage gate now smokes the storage wheel with the adcp wheel built from the same release commit (--adcp-dist) and refuses unless that wheel is the floor. The published-adcp checks run unchanged once any published adcp satisfies the floor. release-publish.yml builds that wheel outside dist/, so a storage publish never uploads adcp. Raise the storage floor to adcp>=10.0.0b24,<11 (contract 3) and make RELEASING.md and docs/releasing.md give one release order for a contract bump. Closes #1947 Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — release-infrastructure PR with no blocking or medium findings.
This PR adds a companion-gate path for the storage-contract-bump window (#1947) where both packages change in one commit and neither companion is on PyPI yet. The unreleased_floor + _gate_unreleased_floor logic smokes the storage wheel against the same-commit adcp wheel, refusing unless that wheel's version is exactly the floor. The reviewer verified:
- Fail-closed behavior (yanked-release and later-commit cases both refuse rather than approve).
- The adcp wheel builds outside
dist/, so the storage publish never uploads adcp. - Source constants (STORAGE_CONTRACT=3, _FIRST_ADCP=10.0.0b24, floor adcp>=10.0.0b24) match every claim in the diff and docs.
- New branches are thoroughly covered by tests.
Decision table: no critical/high findings (row 1 n/a); gated_paths false (row 2 n/a); high_risk false, no deletions/modified-sensitive triggers (rows 3–5 n/a); no prior decision (row 6 n/a); no no-auto-approve team match (row 7 n/a); zero medium findings (row 8 n/a). Falls through to row 9 → approve.
Closes #1947.
The deadlock
#1945 raised the reporting storage contract from 2 to 3 (
media_buy_scope, migration 0009). Release PR #1946 (adcp 10.0.0-beta.24) merged, and its publish failed at the companion gate (run 45369898960):The storage release (#1884, 0.2.0b5) can't publish first either.
gate_companionsmokes the storage wheel against the oldest and newest published adcp that its floor accepts:>=10.0.0b4, the gate smokes against b4 and b23 (contract 2), and the smoke fails.>=10.0.0b24, no published adcp satisfies it, so the gate fails with "publish adcp first".RELEASING.md said to publish storage first. docs/releasing.md said to publish adcp first. Neither order works. This is the first contract bump since the gate was added.
The fix
The gate's guarantee doesn't change: no pair whose contracts differ, or that fails the PostgreSQL round-trip, reaches PyPI.
scripts/check_companion_releases.py: when the storage floor is newer than every adcp on PyPI,gate_companionsmokes the storage wheel with the adcp wheel built from the same release commit (new--adcp-dist). It refuses in these cases:--adcp-distwas passed;A yanked floor still counts as on PyPI, because it can't be published again. Once any published adcp satisfies the floor, the gate checks the oldest and newest published releases exactly as before, and the wheel is ignored.
--adcp-distis rejected for--package adcp..github/workflows/release-publish.yml: the storage job already checks out the release SHA. It now also builds that commit's adcp wheel into$RUNNER_TEMP/adcp-distand passes it with--adcp-dist. The wheel goes outsidedist/, so a storage publish never uploads adcp.packages/adcp-reporting-storage/pyproject.toml: the floor goes toadcp>=10.0.0b24,<11(contract 3). I checked that v10.0.0-beta.23 declares contract 2 and b24 declares 3.RELEASING.md and docs/releasing.md now give the same release order for a contract bump. I also removed RELEASING.md's stale
adcp>=9.0.0,<11statement about next's range.Tests: new unit tests in
tests/test_check_companion_releases.pycover:--adcp-distwith--package adcpis rejected.tests/test_release_configuration.pyasserts the new floor, the--adcp-distargument, and the out-of-dist/build.Verification
make lintandmake typecheck-allpass, along with black, ruff and mypy on the changed scripts and tests.--adcp-dist, the same run exits 1 with "adcp 10.0.0b24 ... is not published".Release sequence for 10.0.0b24 and storage 0.2.0b5 after this merges
The storage gate runs
scripts/check_companion_releases.pyfrom the storage release commit. So this PR has to be innextbefore #1884 merges.next. It touchespackages/adcp-reporting-storage/, so Release Please refreshes chore(next): release adcp-reporting-storage 0.2.0-beta.5 #1884 with the new floor and this commit in its changelog. It also touches root files, so Release Please will open an adcp 10.0.0-beta.25 release PR. Don't merge the b25 PR yet.packages/adcp-reporting-storage/pyproject.tomlhas version0.2.0b5and"adcp>=10.0.0b24,<11", and that rootpyproject.tomlonnextis still10.0.0b24.release-please-next.ymldispatchesrelease-publish.ymlwithpackage=adcp-reporting-storage. The gate sees the floor 10.0.0b24 is not on PyPI, builds the adcp wheel of the same commit (10.0.0b24), and runs the contract check and the PostgreSQL round-trip. Approve therelease-publishenvironment, and storage 0.2.0b5 publishes.gh run rerun 45369898960 --failed --repo adcontextprotocol/adcp-client-python. Its gate now finds 0.2.0b5, which accepts 10.0.0b24, and smokes the pair. Approve the environment, and adcp 10.0.0b24 publishes.If an adcp release PR merges between steps 1 and 3, the storage commit's adcp version is no longer the floor, and the gate refuses. To recover, raise the storage floor to that adcp version, which also declares contract 3, and release storage again. The 10.0.0b24 adcp publish then stays unpublished.
🤖 Generated with Claude Code