The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(release): termux-only claims finish and partial releases keep the shared downloads page
ethernet6743ab711a2f
diff --git a/.github/workflows/stable-release.yml b/.github/workflows/stable-release.ymlindex e705916ac99..ed5a7730585 100644--- a/.github/workflows/stable-release.yml+++ b/.github/workflows/stable-release.yml@@ -643,16 +643,21 @@ jobs:RELEASE_CLAIM_TAG: ${{ needs.admit.outputs.claim-tag }}RELEASE_COMMIT: ${{ needs.admit.outputs.commit }}CANDIDATE_MANIFEST_SHA256: ${{ needs.candidate-manifest.outputs.manifest-sha256 }}- # It lists the archive and writes the tag and channel pages on R2.+ DESKTOP_CHANNEL: ${{ fromJSON(needs.admit.outputs.lanes)['desktop-channel'] }}+ # It lists the archive and writes the tag page, and the shared channel page when the+ # release built every desktop package the channel serves.CLOUDFLARE_R2_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_R2_ACCOUNT_ID }}CLOUDFLARE_R2_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }}CLOUDFLARE_R2_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }}CLOUDFLARE_R2_BUCKET: ${{ vars.CLOUDFLARE_R2_BUCKET }}CLOUDFLARE_R2_PUBLIC_URL: ${{ vars.CLOUDFLARE_R2_PUBLIC_URL }}run: |+ args=()+ if [ "$DESKTOP_CHANNEL" != true ]; then args+=(--no-channel-page); fipython scripts/render-builds-table.py --tag "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" \--archive "$RELEASE_CLAIM_TAG" \- --candidate-manifest-sha256 "$CANDIDATE_MANIFEST_SHA256" --candidate-commit "$RELEASE_COMMIT"+ --candidate-manifest-sha256 "$CANDIDATE_MANIFEST_SHA256" --candidate-commit "$RELEASE_COMMIT" \+ "${args[@]}"- name: Set up Docker Buildx for ordered alias promotionuses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3- name: Log in to Docker Hub for ordered alias promotiondiff --git a/scripts/releases/lanes.py b/scripts/releases/lanes.pyindex bd82b7e14d5..a88bd46ca06 100644--- a/scripts/releases/lanes.py+++ b/scripts/releases/lanes.py@@ -51,10 +51,12 @@ BUNDLES = (*DESKTOP, "termux")# built every desktop package the channel serves. A partial set still stages, verifies and (for# Windows) submits its packages, but leaves the channels on the previous release.CHANNEL_DESKTOP = ("windows", "macos-arm64")+DERIVED = ("bundles", "desktop-channel")# Each stable-release.yml job and the lanes that must all be on for it to run. A job named here-# reports `skipped` when one is off and `success` otherwise; a job not named never skips. "bundles"-# is derived: any build lane except docker.+# reports `skipped` when one is off and `success` otherwise; a job not named never skips. DERIVED+# names are computed from the lanes: "bundles" is any build lane except docker, "desktop-channel"+# is the full desktop set the protected channel serves.JOB_LANES: dict[str, frozenset[str]] = {name: frozenset(needs) for name, needs in {"ci": ("ci",),"nix": ("nix",),@@ -81,6 +83,8 @@ JOB_LANES: dict[str, frozenset[str]] = {name: frozenset(needs) for name, needs i"windows-packaged": ("windows", "upgrade"),}.items()}+CANDIDATE_CALLS = tuple(job for job in JOB_LANES if job.startswith("candidates-"))+# Candidate handoff group and manifest target, each with the lane that builds it.HANDOFF_LANE = {"win32-x64": "windows", "win32-arm64": "windows", "windows-universal": "windows","darwin-arm64": "macos-arm64", "darwin-x64": "macos-intel", "termux": "termux"}@@ -121,18 +125,19 @@ def parse_list(values: Iterable[str] | None) -> list[str] | None:def effective(lanes: Iterable[str]) -> frozenset[str]:lanes = frozenset(lanes)- return lanes | {"bundles"} if lanes & set(BUNDLES) else lanes+ return lanes | {name for name, derived in (("bundles", has_bundles(lanes)),+ ("desktop-channel", advances_desktop(lanes))) if derived}def flags(lanes: Iterable[str]) -> dict[str, bool]:- """One flag per lane plus the derived ``bundles``: what ``admit`` hands the workflow."""+ """One flag per lane plus the derived names: what ``admit`` hands the workflow."""on = effective(lanes)- return {name: name in on for name in (*NAMES, "bundles")}+ return {name: name in on for name in (*NAMES, *DERIVED)}def from_flags(raw: object) -> frozenset[str]:"""The lane set of a ``flags`` mapping; refuses anything but a boolean for every lane."""- if not isinstance(raw, Mapping) or set(raw) != {*NAMES, "bundles"} \+ if not isinstance(raw, Mapping) or set(raw) != {*NAMES, *DERIVED} \or any(not isinstance(value, bool) for value in raw.values()):raise ValueError("lanes must be a boolean for every lane")return frozenset(name for name in NAMES if raw[name])diff --git a/scripts/releases/stable.py b/scripts/releases/stable.pyindex 52ff8175804..1759765e669 100644--- a/scripts/releases/stable.py+++ b/scripts/releases/stable.py@@ -797,14 +797,14 @@ def candidate_manifest(env: dict) -> None:runs = lane_set.jobs_to_run(lanes)calls = {call: job for call, job in CALL_SMOKE_JOBS.items() if runs[call]}smoke = {job: {"result": "skipped"} for job in CALL_SMOKE_JOBS.values()}- if not lane_set.runs_smokes(lanes):- # The calls built and staged their groups but ran no smoke. Record- # that as skipped. Never let a green call stand in for a smoke.- require_success(needs, list(calls))- else:+ if lane_set.runs_smokes(lanes):ran = {job: {"result": (needs.get(call) or {}).get("result")} for call, job in calls.items()}require_success(ran, list(ran))smoke.update(ran)+ # Every call the claim built, smoked or not (Termux has no smoke): a green call never stands in+ # for a smoke, but a failed or missing one leaves no manifest. A claim that builds a bundle+ # runs at least one call, so this list is never empty.+ require_success(needs, [call for call in lane_set.CANDIDATE_CALLS if runs[call]])base = env["CLOUDFLARE_R2_PUBLIC_URL"].rstrip("/")archive = claim["claim_tag"]with tempfile.TemporaryDirectory() as directory:diff --git a/scripts/render-builds-table.py b/scripts/render-builds-table.pyindex 5a3f5c71887..91d24b32f25 100755--- a/scripts/render-builds-table.py+++ b/scripts/render-builds-table.py@@ -618,6 +618,10 @@ def main() -> int:help="Actual workflow run URL for incomplete-build diagnostics")parser.add_argument("--r2-base-url", default=os.environ.get("CLOUDFLARE_R2_PUBLIC_URL"),help="Public base URL of the R2 bucket (default: $CLOUDFLARE_R2_PUBLIC_URL)")+ parser.add_argument("--no-channel-page", action="store_true",+ help="Render the attempt page and release table but leave the shared channel "+ "downloads page alone (a release that did not build every desktop package "+ "the channel serves)")parser.add_argument("--dry-run", action="store_true",help="Print the spliced body instead of editing the release ""(writes nothing, including the channel page)")@@ -731,7 +735,7 @@ def main() -> int:return 1release = json.loads(view.stdout)body = release.get("body") or ""- if not args.pending_run_url and not args.dry_run and not incomplete and names:+ if not args.pending_run_url and not args.dry_run and not incomplete and names and not args.no_channel_page:write_channel_page(args.tag, assets, args.r2_base_url, repo=args.repo, smoke_results=smoke_results)if MARKER not in body:print("::warning::release body has no HERMES_BUILDS_TABLE marker; leaving it unchanged")diff --git a/tests/scripts/test_release_artifacts.py b/tests/scripts/test_release_artifacts.pyindex c42d4e9e066..72bfb328917 100644--- a/tests/scripts/test_release_artifacts.py+++ b/tests/scripts/test_release_artifacts.py@@ -359,6 +359,7 @@ def candidate_workflow_step(tmp_path, r2_server, staged_candidate):'${{ needs.admit.outputs.tag }}': manifest['tag'],'${{ needs.admit.outputs.claim-tag }}': manifest['archive'],'${{ needs.admit.outputs.commit }}': manifest['commit'],+ "${{ fromJSON(needs.admit.outputs.lanes)['desktop-channel'] }}": 'true','${{ needs.validate.outputs.archive-tag }}': manifest['archive'],'${{ needs.candidates.outputs.manifest-sha256 }}': pinned,'${{ needs.candidate-manifest.outputs.manifest-sha256 }}': pinned,diff --git a/tests/scripts/test_release_lanes.py b/tests/scripts/test_release_lanes.pyindex fe8e9597cca..e808273765f 100644--- a/tests/scripts/test_release_lanes.py+++ b/tests/scripts/test_release_lanes.py@@ -35,7 +35,7 @@ def test_options_flatten_repeats_and_commas():def test_every_job_names_real_lanes():for job, needs in lane_set.JOB_LANES.items():- assert needs <= {*lane_set.NAMES, "bundles"}, job+ assert needs <= {*lane_set.NAMES, *lane_set.DERIVED}, jobfor target, lane in lane_set.TARGET_LANE.items():assert lane in lane_set.NAMES, targetfor handoff, lane in lane_set.HANDOFF_LANE.items():@@ -59,6 +59,8 @@ def test_a_job_runs_only_when_every_lane_it_needs_is_on():def test_flags_round_trip_and_refuse_anything_loose():flags = lane_set.flags(["windows", "docker"])assert flags["bundles"] is True and flags["macos-arm64"] is False+ assert flags["desktop-channel"] is False+ assert lane_set.flags(lane_set.DEFAULT)["desktop-channel"] is Trueassert lane_set.from_flags(flags) == {"windows", "docker"}assert lane_set.flags(["docker"])["bundles"] is Falsefor bad in (None, {}, {**flags, "extra": True}, {**flags, "ci": "true"},diff --git a/tests/scripts/test_render_builds_publication.py b/tests/scripts/test_render_builds_publication.pyindex e94decccfe5..305c8a99c99 100644--- a/tests/scripts/test_render_builds_publication.py+++ b/tests/scripts/test_render_builds_publication.py@@ -94,6 +94,17 @@ def test_tag_publication_pending_rerun_stale_and_dry_run(monkeypatch, r2_server,render()assert release_body['body'] == 'no marker here' and release_body['edits'] == edits+ # A release that does not serve the channel (--only windows,docker) renders its own page and+ # table but leaves the shared downloads page alone; the same page is replaced without the flag.+ release_body['body'] = rbt.MARKER+ older = rbt.render_page('v1.2.3+canary.20200101T000000Z' if '+canary.' in tag else 'v0.0.1', {}, base).encode()+ r2_server.store[channel_key] = (older, '"e"')+ render('--no-channel-page')+ assert r2_server.store[channel_key][0] == older+ release_body['body'] = rbt.MARKER+ render()+ assert r2_server.store[channel_key][0].decode() == page+@pytest.mark.parametrize('asset_present', [False, True])@pytest.mark.parametrize('result', ['failure', 'cancelled', 'skipped'])diff --git a/tests/scripts/test_stable_release.py b/tests/scripts/test_stable_release.pyindex 0233fa7aa3a..14fe58914fb 100644--- a/tests/scripts/test_stable_release.py+++ b/tests/scripts/test_stable_release.py@@ -558,9 +558,7 @@ def test_a_default_claim_builds_no_macos_intel_or_termux_and_lanes_restore_them(_stage_windows_handoff(built, "arm64")_stage_universal_bundle(built)monkeypatch.setattr(stable, "stable_context", _fake_stable_context(lanes=lane_set.DEFAULT))- calls = {call: {"result": "success"} for call in stable.CALL_SMOKE_JOBS- if call != "candidates-darwin-x64"}- calls["candidates-darwin-x64"] = {"result": "skipped"}+ calls = _calls(lane_set.DEFAULT)env = {**_receipt_env(tmp_path, https_origin.base), "RELEASE_NEEDS": json.dumps(calls)}stable.main(["candidate-manifest"], env)stored, _ = r2_server.store[f"releases/tag/{ATTEMPT}/release-candidates.json"]@@ -581,10 +579,34 @@ def test_a_default_claim_builds_no_macos_intel_or_termux_and_lanes_restore_them(RELEASE_EPOCH, archive=ATTEMPT)# A claim that built Termux needs its handoff: a missing one leaves no manifest.del r2_server.store[f"releases/tag/{ATTEMPT}/release-candidates.json"]- monkeypatch.setattr(stable, "stable_context",- _fake_stable_context(lanes=lane_set.select(with_=["termux"])))+ termux = lane_set.select(with_=["termux"])+ monkeypatch.setattr(stable, "stable_context", _fake_stable_context(lanes=termux))with pytest.raises(Exception, match="handoff-termux"):- stable.main(["candidate-manifest"], env)+ stable.main(["candidate-manifest"], {**env, "RELEASE_NEEDS": json.dumps(_calls(termux))})+ assert f"releases/tag/{ATTEMPT}/release-candidates.json" not in r2_server.store+++def test_a_termux_only_claim_assembles_a_termux_only_manifest(+ tmp_path, r2_server, https_origin, monkeypatch):+ """--only termux: no desktop call exists, so there is no smoke to judge, only the Termux call."""+ from scripts.releases import stable++ https_origin.store = r2_server.store+ built = tmp_path / "built"+ built.mkdir()+ _stage_termux_handoff(built)+ lanes = lane_set.select(only=["termux", "docker"])+ monkeypatch.setattr(stable, "stable_context", _fake_stable_context(lanes=lanes))+ env = {**_receipt_env(tmp_path, https_origin.base), "RELEASE_NEEDS": json.dumps(_calls(lanes))}+ stable.main(["candidate-manifest"], env)+ manifest = json.loads(r2_server.store[f"releases/tag/{ATTEMPT}/release-candidates.json"][0])+ assert {f"{row['platform']}/{row['arch']}" for row in manifest["packages"]} == {"termux/aarch64"}+ stable.require_targets_match_claim(manifest, lanes)+ # The Termux call is judged like any other: a failed one leaves no manifest.+ del r2_server.store[f"releases/tag/{ATTEMPT}/release-candidates.json"]+ failed = {**env, "RELEASE_NEEDS": json.dumps({"candidates-termux": {"result": "failure"}})}+ with pytest.raises(ValueError, match="candidates-termux=failure"):+ stable.main(["candidate-manifest"], failed)assert f"releases/tag/{ATTEMPT}/release-candidates.json" not in r2_server.store@@ -601,7 +623,7 @@ def test_a_windows_only_claim_assembles_a_windows_only_manifest(_stage_universal_bundle(built)lanes = lane_set.select(only=["windows", "docker"])monkeypatch.setattr(stable, "stable_context", _fake_stable_context(lanes=lanes))- calls = {"candidates-win32-x64": {"result": "success"}, "candidates-win32-arm64": {"result": "success"}}+ calls = _calls(lanes)env = {**_receipt_env(tmp_path, https_origin.base), "RELEASE_NEEDS": json.dumps(calls)}stable.main(["candidate-manifest"], env)manifest = json.loads(r2_server.store[f"releases/tag/{ATTEMPT}/release-candidates.json"][0])@@ -936,6 +958,12 @@ WINDOWS_VERSION = "2026.5761.123.0"RELEASE_EPOCH = 1_787_965_323+def _calls(lanes=lane_set.NAMES):+ """The candidate calls' results: success for each the claim built, skipped for the rest."""+ runs = lane_set.jobs_to_run(lanes)+ return {call: {"result": "success" if runs[call] else "skipped"} for call in lane_set.CANDIDATE_CALLS}++def _fake_stable_context(*, lanes=lane_set.NAMES):def context(env):return "v1.2.3", RECEIPT_COMMIT, {"claim_tag": ATTEMPT, "claim_object": "0" * 40,@@ -1229,8 +1257,7 @@ def test_candidate_manifest_needs_every_call_and_stages_the_archive_manifest(_stage_termux_handoff(built)monkeypatch.setattr(stable, "stable_context", _fake_stable_context())env = {**_receipt_env(tmp_path, https_origin.base),- "RELEASE_NEEDS": json.dumps({call: {"result": "success"}- for call in stable.CALL_SMOKE_JOBS})}+ "RELEASE_NEEDS": json.dumps(_calls())}stable.main(["candidate-manifest"], env)stored, _ = r2_server.store[f"releases/tag/{ATTEMPT}/release-candidates.json"]@@ -1248,9 +1275,7 @@ def test_candidate_manifest_needs_every_call_and_stages_the_archive_manifest(# A candidate call that did not succeed (a failed smoke behind it) leaves# no accepted manifest in the archive.failed = dict(env)- failed["RELEASE_NEEDS"] = json.dumps({**{call: {"result": "success"}- for call in stable.CALL_SMOKE_JOBS},- "candidates-darwin-x64": {"result": "failure"}})+ failed["RELEASE_NEEDS"] = json.dumps({**_calls(), "candidates-darwin-x64": {"result": "failure"}})del r2_server.store[f"releases/tag/{ATTEMPT}/release-candidates.json"](tmp_path / "output").unlink()with pytest.raises(ValueError, match="smoke-darwin-x64"):@@ -1272,7 +1297,7 @@ def test_a_claim_without_the_smoke_lane_records_skipped_smokes_never_passed(_stage_universal_bundle(built)_stage_termux_handoff(built)monkeypatch.setattr(stable, "stable_context", _fake_stable_context(lanes=lane_set.select(only=lane_set.NAMES, without=["smoke"])))- calls = {call: {"result": "success"} for call in stable.CALL_SMOKE_JOBS}+ calls = _calls()env = {**_receipt_env(tmp_path, https_origin.base), "RELEASE_NEEDS": json.dumps(calls)}# A build call that failed still leaves no manifest, even with the smokes off.failed = {**env, "RELEASE_NEEDS": json.dumps({**calls, "candidates-win32-x64": {"result": "failure"}})}