The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(release): publish replaces the stable head instead of create-only
Tekniumdf8c3ca54e7d
diff --git a/scripts/releases/channel_releases.py b/scripts/releases/channel_releases.pyindex e2e83a67536..5851001b742 100644--- a/scripts/releases/channel_releases.py+++ b/scripts/releases/channel_releases.py@@ -463,7 +463,10 @@ def publish_release(policy: str, env: dict, root: Path) -> dict:publisher.verify_build = qualifiedif accepted is not None:log("Writing releases/stable/release-candidates.json and promoting the stable feeds")- publisher._write("releases/stable/release-candidates.json", accepted)+ # The head already names the previous release after the first bundled one: replace it+ # under its current ETag, since a create-only write refuses an existing object.+ head = publisher.store.get("releases/stable/release-candidates.json")+ publisher._write("releases/stable/release-candidates.json", accepted, head[1] if head else None)if publisher.reader.read_bytes("releases/stable/release-candidates.json") != canonical_json(accepted):raise ChannelError("Stable candidate pointer read-back differs")promote_stable_feeds(accepted, root, publisher.public_base)diff --git a/tests/scripts/test_release_channels.py b/tests/scripts/test_release_channels.pyindex 9ea55b82772..91ce13a6c76 100644--- a/tests/scripts/test_release_channels.py+++ b/tests/scripts/test_release_channels.py@@ -541,12 +541,15 @@ def test_accepted_release_receipts_feed_the_protected_head_without_rebuilding(tmdef put(**kwargs):pub.store.put(kwargs["key"], __import__("pathlib").Path(kwargs["file"]).read_bytes())monkeypatch.setattr(r2, "put", put)+ # A previous bundled release already owns the stable head.+ pub.store.put("releases/stable/release-candidates.json", b'{"tag":"v1.9.0"}')with pytest.raises(ChannelError, match="fixture feed failure"):channel_releases.publish_release("stable-release", {"GITHUB_REPOSITORY": pub.repository}, tmp_path / "failed")assert pub._read("released")[0]["head"] is Noneresult = channel_releases.publish_release("stable-release", {"GITHUB_REPOSITORY": pub.repository}, tmp_path / "downloaded")assert result["name"] == "released"assert pub.reader.resolve("released").manifest == manifest+ assert json.loads(pub.store.get("releases/stable/release-candidates.json")[0]) == acceptedassert manifest["request"]["sourceVersion"] == "2.0.0"before = dict(objects)assert channel_releases.publish_release("stable-release", {"GITHUB_REPOSITORY": pub.repository}, tmp_path / "retry") == result