Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions metadata/baselines/0.3.120-after-upload.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion metadata/baselines/0.3.120-current.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"schemaVersion":"current-release-baseline-pointer-v1","snapshotPath":"0.3.120-initial.json","snapshotSha256":"c6ef13b82a12003c1d527f28e399afd8b51f6c76ccb36efdb0faa946eaa28f5c"}
{"schemaVersion":"current-release-baseline-pointer-v1","snapshotPath":"0.3.120-after-upload.json","snapshotSha256":"85d65fcf6b53d58b5ba1e24dd569d8fcd16ee956867d45bd0fa00038f64380ef"}
2 changes: 1 addition & 1 deletion metadata/releases/0.3.120.json

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions tests/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from warehouse_lib import ( # noqa: E402
WarehouseError,
load_json,
load_release_baseline,
resolve_catalog,
stable_index,
validate_baseline_change_rows,
Expand Down Expand Up @@ -99,7 +100,8 @@ def test_exact_legacy_backfill(self) -> None:
validate_catalog(self.catalog, self.schema)
legacy = [row for row in self.catalog["entries"] if row["publicationState"] == "published"]
planned = [row for row in self.catalog["entries"] if row["publicationState"] == "planned"]
self.assertEqual((len(legacy), len(planned), len(self.catalog["entries"])), (66, 31, 97))
uploading = [row for row in self.catalog["entries"] if row["publicationState"] == "uploading"]
self.assertEqual((len(legacy), len(planned), len(uploading), len(self.catalog["entries"])), (66, 0, 31, 97))
self.assertEqual(len({row["semanticId"] for row in legacy}), 66)
self.assertEqual(len({row["asset"]["name"] for row in legacy}), 66)
for row in legacy:
Expand Down Expand Up @@ -409,7 +411,7 @@ def test_resolver_rejects_mixed_or_orphan_selectors(self) -> None:
def test_committed_index_and_state_transitions_are_bound(self) -> None:
index = stable_index(self.catalog)
validate_repository_state(self.catalog, index, copy.deepcopy(self.catalog))
current = load_json(ROOT / "metadata/baselines/0.3.120-initial.json")
current = load_release_baseline(ROOT / "metadata/baselines/0.3.120-current.json")
validate_snapshot_catalog_binding(self.catalog, current)
extra = copy.deepcopy(current["assets"][0])
extra.update({
Expand Down Expand Up @@ -454,7 +456,7 @@ def test_committed_index_and_state_transitions_are_bound(self) -> None:

def test_planned_rows_and_global_destination_identities_are_exact(self) -> None:
_, entry = self.known_software_catalog("indexer-standalone")
previous = self.published_catalog()
previous = copy.deepcopy(self.catalog)
planned = copy.deepcopy(previous)
entry = copy.deepcopy(entry)
entry["version"] = "9.9.9"
Expand Down
19 changes: 8 additions & 11 deletions tests/test_clean_room.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
canonical_sha256,
inspect_archive,
load_json,
load_release_baseline,
resolve_catalog,
sha256_file,
stable_index,
Expand All @@ -34,12 +35,8 @@
from tests.test_proof_contract import proof_entry # noqa: E402


def published_catalog() -> dict:
catalog = load_json(ROOT / "metadata/releases/0.3.120.json")
catalog["entries"] = [
row for row in catalog["entries"] if row["publicationState"] == "published"
]
return catalog
def current_catalog() -> dict:
return load_json(ROOT / "metadata/releases/0.3.120.json")


class CleanRoomReadmeTests(unittest.TestCase):
Expand All @@ -65,7 +62,7 @@ def future_proposal(self, candidates: list[dict], *, binary_names: list[str], pr
}

def planned_indexer(self, candidate: dict, *, family: str = "indexer-standalone", version: str = "9.9.9", archive: dict | None = None) -> tuple[dict, dict]:
catalog = published_catalog()
catalog = current_catalog()
contracts = load_json(ROOT / "metadata/contracts/families-v1.json")
contract = next(row for row in contracts["softwareFamilies"] if row["family"] == family)
name = contract["nameTemplate"].format(os="linux", arch="amd64", version=version)
Expand Down Expand Up @@ -150,7 +147,7 @@ def receipt_from_exact_two_pin_record(self, verification: dict) -> dict:
"tool": {"name": "check-manual-publisher-prereqs.sh", "scriptSha256": sha256_file(ROOT / "scripts/check-manual-publisher-prereqs.sh"), "ghVersion": "gh version hosted-two-pin-fixture"},
"effectiveWrite": True, "result": "pass",
}
snapshot = load_json(ROOT / "metadata/baselines/0.3.120-initial.json")
snapshot = load_release_baseline(ROOT / "metadata/baselines/0.3.120-current.json")
snapshot["release"]["bodySha256"] = hashlib.sha256((ROOT / "metadata/templates/release-body.md").read_bytes()).hexdigest()
receipt = make_receipt(
snapshot=snapshot, candidate=candidate, candidate_manifest=manifest,
Expand Down Expand Up @@ -269,7 +266,7 @@ def test_readme_exact_proposal_and_receipt_boundary_executes(self) -> None:
"liveEvidenceSha256": canonical_sha256(live),
"liveEvidence": live, "contentIdentitySha256": canonical_sha256(candidate),
}
snapshot = load_json(ROOT / "metadata/baselines/0.3.120-initial.json")
snapshot = load_release_baseline(ROOT / "metadata/baselines/0.3.120-current.json")
snapshot["release"]["bodySha256"] = hashlib.sha256((ROOT / "metadata/templates/release-body.md").read_bytes()).hexdigest()
paths = {
"manifest": transaction_root / "candidate.json",
Expand Down Expand Up @@ -331,7 +328,7 @@ def test_readme_exact_proposal_and_receipt_boundary_executes(self) -> None:

# Execute the documented state choreography without exposing the planned row
# through the stable index and without skipping a transition.
base = published_catalog()
base = current_catalog()
validate_repository_state(planned_catalog, stable_index(planned_catalog), base)
uploading = copy.deepcopy(planned_catalog)
row = next(item for item in uploading["entries"] if item["publicationState"] == "planned")
Expand Down Expand Up @@ -361,7 +358,7 @@ def test_readme_exact_proposal_and_receipt_boundary_executes(self) -> None:
self.assertEqual(len(stable_index(published)["entries"]), 67)

def test_readme_extension_future_k_and_static_revision_gates_execute(self) -> None:
catalog = published_catalog()
catalog = current_catalog()
family_contract = load_json(ROOT / "metadata/contracts/families-v1.json")
extended_contract = copy.deepcopy(family_contract)
extended_contract["softwareFamilies"].append({
Expand Down
11 changes: 4 additions & 7 deletions tests/test_promotion.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
validate_receipt_bindings,
verify_envelope_candidate_binding,
)
from warehouse_lib import WarehouseError, canonical_bytes, canonical_sha256, compare_snapshots, inspect_archive, load_json, sha256_file, snapshot_identity, write_canonical # noqa: E402
from warehouse_lib import WarehouseError, canonical_bytes, canonical_sha256, compare_snapshots, inspect_archive, load_json, load_release_baseline, sha256_file, snapshot_identity, write_canonical # noqa: E402


class PromotionTests(unittest.TestCase):
@classmethod
def setUpClass(cls) -> None:
cls.snapshot = load_json(ROOT / "metadata/baselines/0.3.120-initial.json")
cls.snapshot = load_release_baseline(ROOT / "metadata/baselines/0.3.120-current.json")
body = (ROOT / "metadata/templates/release-body.md").read_bytes()
cls.snapshot["release"]["bodySha256"] = hashlib.sha256(body).hexdigest()
cls.proposal = load_json(ROOT / "metadata/proposals/initial-31-v1.json")
Expand Down Expand Up @@ -138,9 +138,6 @@ def evidence(self, envelope_bytes: bytes, authority: str = "owner-approval-1") -

def planned_catalog(self, candidate: list[dict]) -> dict:
catalog = load_json(ROOT / "metadata/releases/0.3.120.json")
catalog["entries"] = [
row for row in catalog["entries"] if row["publicationState"] == "published"
]
for row in candidate:
match = re.fullmatch(r"indexer-standalone-linux-amd64-v(.+)[.]zip", row["name"])
self.assertIsNotNone(match, row["name"])
Expand Down Expand Up @@ -481,13 +478,13 @@ def uploaded_snapshot(self, candidates: list[dict]) -> dict:
"apiUrl": f"https://api.github.com/repos/effectstream/binaries/releases/assets/{index}",
"downloadUrl": "https://github.com/effectstream/binaries/releases/download/0.3.120/" + candidate["name"],
"contentType": "application/zip" if candidate["name"].endswith(".zip") else "application/octet-stream",
"createdAt": "2026-08-28T00:00:00Z", "updatedAt": "2026-08-28T00:00:00Z",
"createdAt": "2026-08-29T00:00:00Z", "updatedAt": "2026-08-29T00:00:00Z",
})
result["assets"].sort(key=lambda row: row["name"])
result["pagination"]["totalCount"] = len(result["assets"])
result["pagination"]["pages"][0]["count"] = len(result["assets"])
if candidates:
result["release"]["updatedAt"] = "2026-08-28T00:00:00Z"
result["release"]["updatedAt"] = "2026-08-29T00:00:00Z"
return result

def test_mocked_create_readback_interruption_stale_and_confirmation(self) -> None:
Expand Down