Skip to content

The agent that grows with you

feat(release): start each install arm from its own receipt

ethernet20f3b5f38bd1
diff --git a/.github/workflows/desktop-bundled-release.yml b/.github/workflows/desktop-bundled-release.yml
index b3510e61b80..83302d57590 100644
--- a/.github/workflows/desktop-bundled-release.yml
+++ b/.github/workflows/desktop-bundled-release.yml
@@ -2323,69 +2323,6 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: python -m scripts.releases.commit_build receipt
- candidate-manifest:
- name: Stage verified stable candidate artifacts
- needs:
- [
- validate,
- build-win32-x64,
- build-win32-arm64,
- build-darwin-arm64,
- build-darwin-x64,
- assemble-win32-bundle,
- smoke-darwin-arm64,
- smoke-darwin-x64,
- smoke-win32-arm64,
- smoke-win32-x64,
- termux-deb
- ]
- if: >-
- !cancelled() && inputs.release-phase == 'candidate'
- && needs.validate.result == 'success' && needs.validate.outputs.sha != ''
- && needs.validate.outputs.darwin-arm64 == 'true' && needs.validate.outputs.darwin-x64 == 'true'
- && needs.validate.outputs.win32-arm64 == 'true' && needs.validate.outputs.win32-x64 == 'true'
- && needs.validate.outputs.win32-bundle == 'true' && needs.validate.outputs.termux == 'true'
- && needs.build-win32-x64.result == 'success' && needs.build-win32-arm64.result == 'success'
- && needs.build-darwin-arm64.result == 'success' && needs.build-darwin-x64.result == 'success'
- && needs.assemble-win32-bundle.result == 'success' && needs.termux-deb.result == 'success'
- && needs.smoke-darwin-arm64.result == 'success' && needs.smoke-darwin-x64.result == 'success'
- && needs.smoke-win32-arm64.result == 'success' && needs.smoke-win32-x64.result == 'success'
- runs-on: ubuntu-latest-32-core
- environment: release-signing
- timeout-minutes: 90
- outputs:
- manifest-url: ${{ steps.manifest.outputs.manifest-url }}
- manifest-sha256: ${{ steps.manifest.outputs.manifest-sha256 }}
- env:
- RELEASE_TAG: ${{ inputs.tag }}
- HERMES_ARCHIVE_TAG: ${{ needs.validate.outputs.archive-tag }}
- HERMES_RELEASE_EPOCH: ${{ needs.validate.outputs.release-epoch }}
- 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 }}
- steps:
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- with:
- ref: ${{ needs.validate.outputs.sha }}
- - uses: ./.github/actions/setup-pm
- with:
- cache-python: false
- - name: Retrieve candidate receipts and native metadata from R2
- env:
- RELEASE_COMMIT: ${{ needs.validate.outputs.sha }}
- run: |
- python -m scripts.releases.handoff fetch --tag "${HERMES_ARCHIVE_TAG:-$RELEASE_TAG}" --commit "$RELEASE_COMMIT" \
- --name win32-x64 --name win32-arm64 --name darwin-x64 --name darwin-arm64 \
- --name termux --name windows-universal --root candidates \
- --include 'metadata-*.json' --include '*.msixbundle'
- - id: manifest
- env:
- RELEASE_NEEDS: ${{ toJSON(needs) }}
- run: python -m scripts.bundles.release_artifacts assemble --root candidates --out release-candidates.json \
- --archive "${HERMES_ARCHIVE_TAG:?stable candidate assembly needs HERMES_ARCHIVE_TAG}"
-
stable-publish:
name: Verify published candidate files
needs: validate
@@ -2467,7 +2404,6 @@ jobs:
smoke-win32-arm64,
smoke-win32-x64,
termux-deb,
- candidate-manifest,
stable-publish,
stable-store
]
diff --git a/.github/workflows/stable-release.yml b/.github/workflows/stable-release.yml
index e1a8b70e7ed..9e0f30c199c 100644
--- a/.github/workflows/stable-release.yml
+++ b/.github/workflows/stable-release.yml
@@ -215,9 +215,9 @@ jobs:
release-phase: candidate
jobs: termux
- transitions:
- name: Pin actual OLD and NEW signed packages
- needs: [admit, candidates-darwin-arm64, candidates-darwin-x64, candidates-win32-bundle]
+ transitions-darwin-arm64:
+ name: Pin actual OLD and NEW signed packages (darwin-arm64)
+ needs: [admit, candidates-darwin-arm64]
runs-on: ubuntu-24.04
environment: release-signing
outputs:
@@ -235,15 +235,12 @@ jobs:
run: python -m scripts.releases.stable transitions
env:
GH_TOKEN: ${{ github.token }}
+ RECEIPT: darwin-arm64
+ RECEIPT_URL: ${{ needs.candidates-darwin-arm64.outputs.darwin-arm64-receipt-url }}
+ RECEIPT_SHA256: ${{ needs.candidates-darwin-arm64.outputs.darwin-arm64-receipt-sha256 }}
RELEASE_TAG: ${{ needs.admit.outputs.tag }}
RELEASE_CLAIM_TAG: ${{ needs.admit.outputs.claim-tag }}
RELEASE_CLAIM_OBJECT: ${{ needs.admit.outputs.claim-object }}
- RECEIPT_DARWIN_ARM64_URL: ${{ needs.candidates-darwin-arm64.outputs.darwin-arm64-receipt-url }}
- RECEIPT_DARWIN_ARM64_SHA256: ${{ needs.candidates-darwin-arm64.outputs.darwin-arm64-receipt-sha256 }}
- RECEIPT_DARWIN_X64_URL: ${{ needs.candidates-darwin-x64.outputs.darwin-x64-receipt-url }}
- RECEIPT_DARWIN_X64_SHA256: ${{ needs.candidates-darwin-x64.outputs.darwin-x64-receipt-sha256 }}
- RECEIPT_WIN32_BUNDLE_URL: ${{ needs.candidates-win32-bundle.outputs.win32-bundle-receipt-url }}
- RECEIPT_WIN32_BUNDLE_SHA256: ${{ needs.candidates-win32-bundle.outputs.win32-bundle-receipt-sha256 }}
BASELINE_MANIFEST_URL: ${{ inputs.baseline-manifest }}
CLOUDFLARE_R2_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_R2_ACCOUNT_ID }}
CLOUDFLARE_R2_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }}
@@ -251,12 +248,115 @@ jobs:
CLOUDFLARE_R2_BUCKET: ${{ vars.CLOUDFLARE_R2_BUCKET }}
CLOUDFLARE_R2_PUBLIC_URL: ${{ vars.CLOUDFLARE_R2_PUBLIC_URL }}
+ transitions-darwin-x64:
+ name: Pin actual OLD and NEW signed packages (darwin-x64)
+ needs: [admit, candidates-darwin-x64]
+ runs-on: ubuntu-24.04
+ environment: release-signing
+ outputs:
+ windows: ${{ steps.plan.outputs.windows }}
+ macos: ${{ steps.plan.outputs.macos }}
+ steps:
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ ref: ${{ github.sha }}
+ fetch-depth: 0
+ - uses: ./.github/actions/setup-pm
+ with:
+ cache-python: false
+ - id: plan
+ run: python -m scripts.releases.stable transitions
+ env:
+ GH_TOKEN: ${{ github.token }}
+ RECEIPT: darwin-x64
+ RECEIPT_URL: ${{ needs.candidates-darwin-x64.outputs.darwin-x64-receipt-url }}
+ RECEIPT_SHA256: ${{ needs.candidates-darwin-x64.outputs.darwin-x64-receipt-sha256 }}
+ RELEASE_TAG: ${{ needs.admit.outputs.tag }}
+ RELEASE_CLAIM_TAG: ${{ needs.admit.outputs.claim-tag }}
+ RELEASE_CLAIM_OBJECT: ${{ needs.admit.outputs.claim-object }}
+ BASELINE_MANIFEST_URL: ${{ inputs.baseline-manifest }}
+ 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 }}
+
+ transitions-win32:
+ name: Pin actual OLD and NEW signed packages (win32)
+ needs: [admit, candidates-win32-bundle]
+ runs-on: ubuntu-24.04
+ environment: release-signing
+ outputs:
+ windows: ${{ steps.plan.outputs.windows }}
+ macos: ${{ steps.plan.outputs.macos }}
+ steps:
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ ref: ${{ github.sha }}
+ fetch-depth: 0
+ - uses: ./.github/actions/setup-pm
+ with:
+ cache-python: false
+ - id: plan
+ run: python -m scripts.releases.stable transitions
+ env:
+ GH_TOKEN: ${{ github.token }}
+ RECEIPT: win32-bundle
+ RECEIPT_URL: ${{ needs.candidates-win32-bundle.outputs.win32-bundle-receipt-url }}
+ RECEIPT_SHA256: ${{ needs.candidates-win32-bundle.outputs.win32-bundle-receipt-sha256 }}
+ RELEASE_TAG: ${{ needs.admit.outputs.tag }}
+ RELEASE_CLAIM_TAG: ${{ needs.admit.outputs.claim-tag }}
+ RELEASE_CLAIM_OBJECT: ${{ needs.admit.outputs.claim-object }}
+ BASELINE_MANIFEST_URL: ${{ inputs.baseline-manifest }}
+ 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 }}
+
+ candidate-manifest:
+ name: Stage verified stable candidate artifacts
+ # Runs after every candidate call, so after every smoke (decision 23).
+ # The recorded smoke results are the calls' own workflow results: a
+ # call's stable-phase-result fails when its smokes fail, so a failed
+ # smoke fails this job's RELEASE_NEEDS check and stages no manifest.
+ if: always()
+ needs: [admit, candidates-darwin-arm64, candidates-darwin-x64, candidates-win32-arm64,
+ candidates-win32-x64, candidates-win32-bundle, candidates-termux]
+ runs-on: ubuntu-24.04
+ environment: release-signing
+ timeout-minutes: 90
+ outputs:
+ manifest-url: ${{ steps.manifest.outputs.manifest-url }}
+ manifest-sha256: ${{ steps.manifest.outputs.manifest-sha256 }}
+ env:
+ RELEASE_TAG: ${{ needs.admit.outputs.tag }}
+ RELEASE_CLAIM_TAG: ${{ needs.admit.outputs.claim-tag }}
+ RELEASE_CLAIM_OBJECT: ${{ needs.admit.outputs.claim-object }}
+ RELEASE_NEEDS: ${{ toJSON(needs) }}
+ 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 }}
+ steps:
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ ref: ${{ github.sha }}
+ fetch-depth: 0
+ fetch-tags: true
+ - uses: ./.github/actions/setup-pm
+ with:
+ cache-python: false
+ - id: manifest
+ run: python -m scripts.releases.stable candidate-manifest
+
windows-packaged:
name: Windows signed-package acceptance
- needs: transitions
+ needs: transitions-win32
strategy:
fail-fast: false
- matrix: ${{ fromJSON(needs.transitions.outputs.windows) }}
+ matrix: ${{ fromJSON(needs.transitions-win32.outputs.windows) }}
uses: ./.github/workflows/install-e2e-windows-run.yml
with:
install-method: packaged-app
@@ -267,12 +367,28 @@ jobs:
bundle-manifest-sha256: ${{ matrix.manifest_sha256 }}
bundle-arch: ${{ matrix.arch }}
- macos-packaged:
- name: macOS signed-package acceptance
- needs: transitions
+ macos-packaged-arm64:
+ name: macOS arm64 signed-package acceptance
+ needs: transitions-darwin-arm64
+ strategy:
+ fail-fast: false
+ matrix: ${{ fromJSON(needs.transitions-darwin-arm64.outputs.macos) }}
+ uses: ./.github/workflows/install-e2e-macos-run.yml
+ with:
+ install-method: packaged-app
+ update-method: open-app-update
+ install-ref: ${{ matrix.old }}
+ leg-id: stable-${{ matrix.id }}
+ bundle-manifest-url: ${{ matrix.manifest }}
+ bundle-manifest-sha256: ${{ matrix.manifest_sha256 }}
+ bundle-arch: ${{ matrix.arch }}
+
+ macos-packaged-x64:
+ name: macOS x64 signed-package acceptance
+ needs: transitions-darwin-x64
strategy:
fail-fast: false
- matrix: ${{ fromJSON(needs.transitions.outputs.macos) }}
+ matrix: ${{ fromJSON(needs.transitions-darwin-x64.outputs.macos) }}
uses: ./.github/workflows/install-e2e-macos-run.yml
with:
install-method: packaged-app
@@ -350,7 +466,9 @@ jobs:
needs: [admit, ci, docker, nix, pm-bundle, termux-checks, windows-live, install-e2e,
candidates-darwin-arm64, candidates-darwin-x64, candidates-win32-arm64,
candidates-win32-x64, candidates-win32-bundle, candidates-termux,
- transitions, windows-packaged, macos-packaged, bootstrap-version]
+ candidate-manifest, transitions-darwin-arm64, transitions-darwin-x64,
+ transitions-win32, windows-packaged, macos-packaged-arm64, macos-packaged-x64,
+ bootstrap-version]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -359,7 +477,7 @@ jobs:
- uses: ./.github/actions/setup-pm
with:
cache-python: false
- - run: python -m scripts.releases.stable gate admit ci docker nix pm-bundle termux-checks windows-live install-e2e candidates-darwin-arm64 candidates-darwin-x64 candidates-win32-arm64 candidates-win32-x64 candidates-win32-bundle candidates-termux transitions windows-packaged macos-packaged bootstrap-version
+ - run: python -m scripts.releases.stable gate admit ci docker nix pm-bundle termux-checks windows-live install-e2e candidates-darwin-arm64 candidates-darwin-x64 candidates-win32-arm64 candidates-win32-x64 candidates-win32-bundle candidates-termux candidate-manifest transitions-darwin-arm64 transitions-darwin-x64 transitions-win32 windows-packaged macos-packaged-arm64 macos-packaged-x64 bootstrap-version
env:
RELEASE_NEEDS: ${{ toJSON(needs) }}
@@ -377,8 +495,7 @@ jobs:
publish-bundles:
name: Publish tested bundle artifacts
- # B4 wires the candidate-manifest digest back into manifest-sha256.
- needs: [admit, acceptance]
+ needs: [admit, acceptance, candidate-manifest]
permissions:
contents: write
actions: read
@@ -390,6 +507,7 @@ jobs:
claim-tag: ${{ needs.admit.outputs.claim-tag }}
claim-object: ${{ needs.admit.outputs.claim-object }}
release-phase: publish
+ manifest-sha256: ${{ needs.candidate-manifest.outputs.manifest-sha256 }}
publication:
name: All artifact publication succeeded
@@ -410,7 +528,8 @@ jobs:
complete:
name: Stable release is green
if: always()
- needs: [admit, ci, docker, acceptance, publication, publish-docker, windows-packaged, macos-packaged]
+ needs: [admit, ci, docker, acceptance, candidate-manifest, publication, publish-docker,
+ windows-packaged, macos-packaged-arm64, macos-packaged-x64]
runs-on: ubuntu-24.04
environment: release-signing
permissions:
@@ -429,16 +548,17 @@ jobs:
with:
toolchain: node
cache-python: false
- - run: python -m scripts.releases.stable gate admit ci docker acceptance publication publish-docker
+ - run: python -m scripts.releases.stable gate admit ci docker acceptance candidate-manifest publication publish-docker
env:
RELEASE_NEEDS: ${{ toJSON(needs) }}
- name: Validate the accepted candidate archive
- # B4 wires the candidate-manifest URL and digest outputs here.
run: python -m scripts.releases.stable complete
env:
RELEASE_TAG: ${{ needs.admit.outputs.tag }}
RELEASE_CLAIM_TAG: ${{ needs.admit.outputs.claim-tag }}
RELEASE_CLAIM_OBJECT: ${{ needs.admit.outputs.claim-object }}
+ CANDIDATE_MANIFEST_URL: ${{ needs.candidate-manifest.outputs.manifest-url }}
+ CANDIDATE_MANIFEST_SHA256: ${{ needs.candidate-manifest.outputs.manifest-sha256 }}
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 }}
@@ -449,6 +569,7 @@ jobs:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ needs.admit.outputs.tag }}
RELEASE_COMMIT: ${{ needs.admit.outputs.commit }}
+ CANDIDATE_MANIFEST_SHA256: ${{ needs.candidate-manifest.outputs.manifest-sha256 }}
run: |
python scripts/render-builds-table.py --tag "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" \
--archive "$RELEASE_CLAIM_TAG" \
diff --git a/scripts/releases/job_groups.py b/scripts/releases/job_groups.py
index 562f22d90cd..d033be6e162 100644
--- a/scripts/releases/job_groups.py
+++ b/scripts/releases/job_groups.py
@@ -56,7 +56,11 @@ def selects_all(raw: str | None) -> bool:
def phase_jobs(selected: dict[str, bool], phase: str) -> list[str]:
- """Jobs the stable phase result judges: an unselected group never fails it."""
+ """Jobs the stable phase result judges: an unselected group never fails it.
+
+ B4 moved candidate-manifest into stable-release.yml, so the desktop
+ workflow no longer owns it and the phase result never names it.
+ """
required = ["validate"]
if phase == "publish":
return required + ["stable-publish", "stable-store"]
@@ -65,8 +69,6 @@ def phase_jobs(selected: dict[str, bool], phase: str) -> list[str]:
for group, jobs in GROUP_JOBS.items():
if selected.get(group):
required.extend(jobs)
- if all(selected.get(group) for group in GROUP_JOBS):
- required.append("candidate-manifest")
return required
diff --git a/scripts/releases/stable.py b/scripts/releases/stable.py
index 6ac5f957a48..b9688fc94e0 100644
--- a/scripts/releases/stable.py
+++ b/scripts/releases/stable.py
@@ -303,7 +303,10 @@ def stage_receipt(env: dict, receipt: str) -> None:
def read_manifest(url: str, expected_hash: str | None = None, *, expected_origin: str | None = None,
- opener=urllib.request.urlopen) -> dict:
+ opener=None) -> dict:
+ # Resolved per call: a default bound at import would pin the opener that
+ # existed then and ignore the process's trust setup.
+ opener = opener or urllib.request.urlopen
location = urlsplit(url)
origin = urlsplit(expected_origin or url)
@@ -536,13 +539,6 @@ def verify(env: dict) -> None:
"release-epoch": claim["claim_epoch"]}, env)
-RECEIPT_SOURCES = {
- "darwin-arm64": "RECEIPT_DARWIN_ARM64",
- "darwin-x64": "RECEIPT_DARWIN_X64",
- "win32-bundle": "RECEIPT_WIN32_BUNDLE",
-}
-
-
def _stage_transition(env: dict, archive: str, base: str, row: dict) -> dict:
from scripts.releases.r2 import put
@@ -581,19 +577,67 @@ def _receipt_from_env(env: dict, receipt: str, prefix: str, base: str) -> dict:
def transitions(env: dict) -> None:
+ """Plan one install arm from its own receipt.
+
+ Each transitions job reads exactly one group's receipt (decision 11) and
+ emits only that group's rows, so a Mac arch and the Windows bundle start
+ their install arms independently of the other groups.
+ """
+ receipt = env.get("RECEIPT", "")
+ if receipt not in RECEIPT_TARGETS:
+ raise ValueError(f"Unknown receipt: {receipt}")
tag, commit, claim = stable_context(env)
base = env["CLOUDFLARE_R2_PUBLIC_URL"].rstrip("/")
archive = claim["claim_tag"]
previous = _published_baseline(env, base)
+ receipt_manifest = _receipt_from_env(env, receipt, "RECEIPT", base)
matrices = {"windows": {"include": []}, "macos": {"include": []}}
- for receipt, prefix in RECEIPT_SOURCES.items():
- receipt_manifest = _receipt_from_env(env, receipt, prefix, base)
- for row in plan_receipt_transitions(previous, receipt_manifest, receipt, base):
- matrices[row["transition"]["platform"]]["include"].append(
- _stage_transition(env, archive, base, row))
+ for row in plan_receipt_transitions(previous, receipt_manifest, receipt, base):
+ matrices[row["transition"]["platform"]]["include"].append(
+ _stage_transition(env, archive, base, row))
emit(matrices, env)
+# The candidate manifest is written after the smokes (decision 23): the smoke
+# results it records are the candidate calls' own workflow results — each
+# call's stable-phase-result only succeeds when its selected groups' smokes
+# did, so a failed smoke leaves no accepted manifest behind.
+CALL_SMOKE_JOBS = {
+ "candidates-darwin-arm64": "smoke-darwin-arm64",
+ "candidates-darwin-x64": "smoke-darwin-x64",
+ "candidates-win32-arm64": "smoke-win32-arm64",
+ "candidates-win32-x64": "smoke-win32-x64",
+}
+CANDIDATE_HANDOFFS = ("win32-x64", "win32-arm64", "darwin-x64", "darwin-arm64",
+ "termux", "windows-universal")
+CANDIDATE_INCLUDES = ("metadata-*.json", "*.msixbundle")
+
+
+def candidate_manifest(env: dict) -> None:
+ """Merge the staged handoffs into the accepted candidate manifest."""
+ from scripts.bundles.release_artifacts import assemble
+ from scripts.releases.handoff import fetch
+
+ needs = json.loads(env.get("RELEASE_NEEDS", "{}"))
+ if not isinstance(needs, dict):
+ raise ValueError("Candidate call results must be a needs object")
+ smoke = {job: {"result": (needs.get(call) or {}).get("result")}
+ for call, job in CALL_SMOKE_JOBS.items()}
+ tag, commit, claim = stable_context(env)
+ base = env["CLOUDFLARE_R2_PUBLIC_URL"].rstrip("/")
+ archive = claim["claim_tag"]
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ fetch(tag=archive, commit=commit, names=list(CANDIDATE_HANDOFFS), root=root,
+ includes=list(CANDIDATE_INCLUDES))
+ out = root / "release-candidates.json"
+ assemble(root, tag, commit, base, out, smoke_results=smoke,
+ release_epoch=claim["claim_epoch"], archive=archive)
+ digest = hashlib.sha256(out.read_bytes()).hexdigest()
+ emit({"manifest-url": f"{base}/releases/tag/{archive}/release-candidates.json",
+ "manifest-sha256": digest}, env)
+
+
def _final_metadata(tag: str, commit: str, claim: dict, candidate_manifest_sha256: str,
docker_manifest_digest: str, release_id: int) -> dict:
if not DIGEST.fullmatch(candidate_manifest_sha256):
@@ -753,9 +797,10 @@ def main(argv: list[str] | None = None, env: dict | None = None) -> None:
raise ValueError("Expected stage-receipt --receipt darwin-arm64|darwin-x64|win32-bundle")
stage_receipt(env, argv[2])
return
- commands = {"admit": admit, "verify": verify, "transitions": transitions, "complete": complete}
+ commands = {"admit": admit, "verify": verify, "transitions": transitions,
+ "candidate-manifest": candidate_manifest, "complete": complete}
if len(argv) != 1 or argv[0] not in commands:
- raise ValueError("Expected admit, verify, gate, transitions, stage-receipt or complete")
+ raise ValueError("Expected admit, verify, gate, transitions, candidate-manifest, stage-receipt or complete")
commands[argv[0]](env)
diff --git a/tests/ci/test_desktop_bundle_smoke.py b/tests/ci/test_desktop_bundle_smoke.py
index 780a5dd1145..b4ece9d43d5 100644
--- a/tests/ci/test_desktop_bundle_smoke.py
+++ b/tests/ci/test_desktop_bundle_smoke.py
@@ -75,11 +75,10 @@ def test_native_consumers_and_publication_fail_closed_across_trust_skips(tmp_pat
jobs = _workflow()['jobs']
base_inputs = {'build_commit': '', 'upload_release': True, 'release-phase': '', 'jobs': ALL_JOBS, 'tag': TAG}
consumers = ['smoke-darwin-arm64', 'smoke-darwin-x64', 'smoke-win32-arm64', 'smoke-win32-x64',
- 'assemble-win32-bundle', 'publish-win32-updater', 'publish-darwin-updater',
- 'candidate-manifest']
+ 'assemble-win32-bundle', 'publish-win32-updater', 'publish-darwin-updater']
for name in consumers:
job = jobs[name]
- inputs = {**base_inputs, 'release-phase': 'candidate' if name == 'candidate-manifest' else ''}
+ inputs = {**base_inputs, 'release-phase': ''}
needs = admitted(job['needs'])
# A skipped execution exists in the ancestry of every native result.
needs['build-win32-commit'] = {'result': 'skipped'}
@@ -332,7 +331,7 @@ def test_stable_phase_and_canary_gates_require_smoke_but_preserve_other_phases(t
for group in group_jobs:
# A group that was not selected is not a failure of the phase.
assert run_phase('candidate', every - {group}).returncode == 0, group
- for failed in ('smoke-darwin-arm64', 'build-win32-x64', 'candidate-manifest'):
+ for failed in ('smoke-darwin-arm64', 'build-win32-x64', 'termux-deb'):
assert run_phase('candidate', every, failed=failed).returncode != 0, failed
assert run_phase('candidate', every, failed='stable-publish').returncode == 0
# A partial selection still judges the groups it selected.
diff --git a/tests/ci/test_stable_release_graph.py b/tests/ci/test_stable_release_graph.py
index 71524738c83..c91f178a1b5 100644
--- a/tests/ci/test_stable_release_graph.py
+++ b/tests/ci/test_stable_release_graph.py
@@ -39,8 +39,10 @@ def test_release_reuses_whole_ci_and_docker_before_publication():
assert "ci" in ancestors(jobs, "docker")
candidate_calls = ["candidates-darwin-arm64", "candidates-darwin-x64", "candidates-win32-arm64",
"candidates-win32-x64", "candidates-win32-bundle", "candidates-termux"]
- required = {"ci", "docker", "nix", "pm-bundle", "install-e2e", "windows-packaged", "macos-packaged",
- "termux-checks", "windows-live", "transitions", "bootstrap-version", *candidate_calls}
+ required = {"ci", "docker", "nix", "pm-bundle", "install-e2e", "windows-packaged",
+ "macos-packaged-arm64", "macos-packaged-x64", "termux-checks", "windows-live",
+ "candidate-manifest", "transitions-darwin-arm64", "transitions-darwin-x64",
+ "transitions-win32", "bootstrap-version", *candidate_calls}
assert required <= ancestors(jobs, "acceptance")
# B3: stable calls one build group at a time; the bundle group waits for
# both Windows arches, and the Linux groups are not called at all.
@@ -54,6 +56,20 @@ def test_release_reuses_whole_ci_and_docker_before_publication():
assert {"tag", "claim-tag", "claim-object"} <= set(call["with"])
assert {"candidates-win32-arm64", "candidates-win32-x64"} <= set(jobs["candidates-win32-bundle"]["needs"])
assert not any("linux" in name for name in jobs)
+ # B4: each install arm starts from its own receipt, and the manifest is
+ # written after every candidate call (so after every smoke).
+ for name in ("transitions", "macos-packaged"):
+ assert name not in jobs
+ assert set(jobs["candidate-manifest"]["needs"]) == \
+ {"admit", *candidate_calls}
+ for receipt, call, packaged, matrix in (
+ ("transitions-darwin-arm64", "candidates-darwin-arm64", "macos-packaged-arm64", "macos"),
+ ("transitions-darwin-x64", "candidates-darwin-x64", "macos-packaged-x64", "macos"),
+ ("transitions-win32", "candidates-win32-bundle", "windows-packaged", "windows")):
+ assert jobs[receipt]["needs"] == ["admit", call]
+ assert jobs[packaged]["needs"] == receipt
+ assert jobs[packaged]["strategy"]["matrix"] == \
+ "${{ fromJSON(needs." + receipt + ".outputs." + matrix + ") }}"
# B5: publish-docker starts when the docker tests pass; it does not wait
# for the acceptance join. publish-bundles still does.
assert jobs["publish-docker"]["needs"] == ["admit", "docker"]
@@ -106,14 +122,17 @@ def test_claim_custody_and_final_payload_identity_reach_every_privileged_phase()
assert desktop["on"]["workflow_call"]["outputs"][f"{group}-receipt-{suffix}"]["value"] == expected
for name in ("smoke-darwin-arm64", "smoke-darwin-x64"):
assert f"stage-receipt-{name.removeprefix('smoke-')}" in desktop["jobs"][name]["needs"]
- for call, key, output in (("candidates-darwin-arm64", "RECEIPT_DARWIN_ARM64_URL", "darwin-arm64-receipt-url"),
- ("candidates-darwin-arm64", "RECEIPT_DARWIN_ARM64_SHA256", "darwin-arm64-receipt-sha256"),
- ("candidates-darwin-x64", "RECEIPT_DARWIN_X64_URL", "darwin-x64-receipt-url"),
- ("candidates-darwin-x64", "RECEIPT_DARWIN_X64_SHA256", "darwin-x64-receipt-sha256"),
- ("candidates-win32-bundle", "RECEIPT_WIN32_BUNDLE_URL", "win32-bundle-receipt-url"),
- ("candidates-win32-bundle", "RECEIPT_WIN32_BUNDLE_SHA256", "win32-bundle-receipt-sha256")):
+ for call, key, output in (("candidates-darwin-arm64", "RECEIPT_URL", "darwin-arm64-receipt-url"),
+ ("candidates-darwin-arm64", "RECEIPT_SHA256", "darwin-arm64-receipt-sha256"),
+ ("candidates-darwin-x64", "RECEIPT_URL", "darwin-x64-receipt-url"),
+ ("candidates-darwin-x64", "RECEIPT_SHA256", "darwin-x64-receipt-sha256"),
+ ("candidates-win32-bundle", "RECEIPT_URL", "win32-bundle-receipt-url"),
+ ("candidates-win32-bundle", "RECEIPT_SHA256", "win32-bundle-receipt-sha256")):
+ receipt_job = {"candidates-darwin-arm64": "transitions-darwin-arm64",
+ "candidates-darwin-x64": "transitions-darwin-x64",
+ "candidates-win32-bundle": "transitions-win32"}[call]
expected = "${{ needs." + call + ".outputs." + output + " }}"
- assert jobs["transitions"]["steps"][-1]["env"][key] == expected
+ assert jobs[receipt_job]["steps"][-1]["env"][key] == expected
for name in ("docker", "nix", "pm-bundle"):
assert jobs[name]["with"]["version"] == "${{ needs.admit.outputs.version }}"
for name in ("docker", "nix", "pm-bundle"):
@@ -127,8 +146,12 @@ def test_claim_custody_and_final_payload_identity_reach_every_privileged_phase()
if step.get("name", "").startswith("Validate the accepted candidate archive"))
assert "DOCKER_MANIFEST_DIGEST" not in complete[validation]["env"]
assert "RELEASE_ID" not in complete[validation]["env"]
- # B4 wires the candidate-manifest outputs back into these env entries.
- assert "CANDIDATE_MANIFEST_SHA256" not in complete[validation]["env"]
+ # B4: complete and the render read the manifest that stable-release.yml's
+ # candidate-manifest job wrote.
+ assert complete[validation]["env"]["CANDIDATE_MANIFEST_SHA256"] == \
+ "${{ needs.candidate-manifest.outputs.manifest-sha256 }}"
+ assert jobs["publish-bundles"]["with"]["manifest-sha256"] == \
+ "${{ needs.candidate-manifest.outputs.manifest-sha256 }}"
render = next(i for i, step in enumerate(complete) if step.get("name", "").startswith("Render the admitted"))
reconcile = next(i for i, step in enumerate(complete) if step.get("name", "").startswith("Reconcile ordered"))
assert validation < render < reconcile
diff --git a/tests/scripts/test_job_groups.py b/tests/scripts/test_job_groups.py
index 52913ac15c7..6849b5c12d7 100644
--- a/tests/scripts/test_job_groups.py
+++ b/tests/scripts/test_job_groups.py
@@ -49,10 +49,12 @@ def test_phase_jobs_judge_only_the_selected_groups():
"build-darwin-x64", "smoke-darwin-x64",
"build-win32-arm64", "smoke-win32-arm64",
"build-win32-x64", "smoke-win32-x64",
- "assemble-win32-bundle", "termux-deb", "candidate-manifest"]
+ "assemble-win32-bundle", "termux-deb"]
termux_only = {**{group: False for group in JOB_GROUPS}, "termux": True}
assert phase_jobs(termux_only, "candidate") == ["validate", "termux-deb"]
- # candidate-manifest stays required only when every group it needs ran.
+ # B4 moved candidate-manifest into stable-release.yml; the desktop phase
+ # result judges only the group jobs themselves.
+ assert "candidate-manifest" not in candidate
partial = {**{group: False for group in JOB_GROUPS}, "darwin-arm64": True}
assert phase_jobs(partial, "candidate") == ["validate", "build-darwin-arm64", "smoke-darwin-arm64"]
assert phase_jobs(every, "publish") == ["validate", "stable-publish", "stable-store"]
diff --git a/tests/scripts/test_stable_release.py b/tests/scripts/test_stable_release.py
index 8cb1c5741d2..0a0e5720cac 100644
--- a/tests/scripts/test_stable_release.py
+++ b/tests/scripts/test_stable_release.py
@@ -682,7 +682,7 @@ def _stage_darwin_handoff(built, arch):
metadata = built / f"metadata-macos-{arch}.json"
metadata.write_text(json.dumps({
"platform": "macos", "arch": arch, "tag": "v1.2.3", "commit": RECEIPT_COMMIT,
- "baseVersion": "1.2.3", "identity": "Product", "version": "1.2.3",
+ "baseVersion": "1.2.3", "identity": "test.application", "version": "1.2.3",
"teamId": "ABCDEFGHIJ", "filename": package,
}), encoding="utf-8")
handoff.stage(ATTEMPT, RECEIPT_COMMIT, f"darwin-{arch}", built, [package, metadata.name])
@@ -698,7 +698,7 @@ def _stage_windows_handoff(built, arch, *, with_metadata=True):
metadata = built / f"metadata-windows-{arch}.json"
metadata.write_text(json.dumps({
"platform": "windows", "arch": arch, "tag": "v1.2.3", "commit": RECEIPT_COMMIT,
- "baseVersion": "1.2.3", "identity": "Product",
+ "baseVersion": "1.2.3", "identity": "test.application",
"version": WINDOWS_VERSION, "executableVersion": WINDOWS_VERSION,
"publisher": "CN=Test", "applicationId": "App",
}), encoding="utf-8")
@@ -712,9 +712,10 @@ def _stage_universal_bundle(built):
bundle = built / "Product-1.2.3-win.msixbundle"
with zipfile.ZipFile(bundle, "w") as archive:
archive.writestr("AppxMetadata/AppxBundleManifest.xml",
- f'<Bundle><Identity Name="Product" Publisher="CN=Test" Version="{WINDOWS_VERSION}"/>'
+ f'<Bundle><Identity Name="test.application" Publisher="CN=Test" Version="{WINDOWS_VERSION}"/>'
'<Packages><Package Type="application" Architecture="arm64"/>'
'<Package Type="application" Architecture="x64"/></Packages></Bundle>')
+ (built / "Store-Product-1.2.3-win.msixbundle").write_bytes(b"Store bundle transport fixture")
handoff.stage(ATTEMPT, RECEIPT_COMMIT, "windows-universal", built, ["*.msixbundle"])
@@ -785,3 +786,149 @@ def test_stage_receipt_refuses_a_bundle_whose_arm64_row_is_absent(tmp_path, r2_s
with pytest.raises(ValueError):
stable.main(["stage-receipt", "--receipt", "win32-bundle"], _receipt_env(tmp_path, https_origin.base))
assert f"releases/tag/{ATTEMPT}/win32-bundle-receipt.json" not in r2_server.store
+
+
+def _stage_termux_handoff(built):
+ from scripts.releases import handoff
+
+ deb = built / "deb" / "product.deb"
+ deb.parent.mkdir(exist_ok=True)
+ deb.write_bytes(b"termux deb transport fixture")
+ metadata = built / "metadata-termux-aarch64.json"
+ metadata.write_text(json.dumps({
+ "platform": "termux", "arch": "aarch64", "tag": "v1.2.3", "commit": RECEIPT_COMMIT,
+ "baseVersion": "1.2.3", "identity": "hermes-desktop", "version": "1.2.3-1",
+ "filename": "deb/product.deb",
+ }), encoding="utf-8")
+ handoff.stage(ATTEMPT, RECEIPT_COMMIT, "termux", built, ["deb/*", metadata.name])
+
+
+def _local_baseline(base):
+ """The published previous stable, keyed to the fixture's HTTPS origin."""
+ baseline = candidates("v1.2.2", "9" * 40, "3" * 64)
+ for row in baseline["packages"]:
+ row["artifact"]["url"] = row["artifact"]["url"].replace(BASE, base)
+ return baseline
+
+
+def _transitions_env(tmp_path, base, receipt, url, digest):
+ # A runner always provides RUNNER_TEMP as an existing directory.
+ (tmp_path / "runner-temp").mkdir(exist_ok=True)
+ return {"RECEIPT": receipt, "RECEIPT_URL": url, "RECEIPT_SHA256": digest,
+ "RELEASE_TAG": "v1.2.3", "RELEASE_CLAIM_TAG": ATTEMPT,
+ "RELEASE_CLAIM_OBJECT": "0" * 40,
+ "BASELINE_MANIFEST_URL": f"{base}/baseline.json",
+ "CLOUDFLARE_R2_PUBLIC_URL": base,
+ "RUNNER_TEMP": str(tmp_path / "runner-temp"),
+ "GITHUB_OUTPUT": str(tmp_path / "output"),
+ "GITHUB_REPOSITORY": "example/project"}
+
+
+def _staged_receipt(tmp_path, r2_server, https_origin, monkeypatch, receipt):
+ """Stage one group's handoffs and publish its receipt; return its URL+digest."""
+ import urllib.request
+
+ from scripts.releases import stable
+
+ # The receipt and the baseline are read over the fixture's self-signed
+ # origin; trust it the way the production opener would trust the CDN.
+ monkeypatch.setattr(urllib.request, "urlopen", https_origin.opener)
+ https_origin.store = r2_server.store
+ built = tmp_path / "built"
+ built.mkdir(exist_ok=True)
+ if receipt == "darwin-arm64":
+ _stage_darwin_handoff(built, "arm64")
+ elif receipt == "win32-bundle":
+ _stage_windows_handoff(built, "x64")
+ _stage_windows_handoff(built, "arm64")
+ _stage_universal_bundle(built)
+ monkeypatch.setattr(stable, "stable_context", _fake_stable_context())
+ stable.main(["stage-receipt", "--receipt", receipt], _receipt_env(tmp_path, https_origin.base))
+ key = f"releases/tag/{ATTEMPT}/{receipt}-receipt.json"
+ stored, _ = r2_server.store[key]
+ return f"{https_origin.base}/releases/tag/{ATTEMPT}/{receipt}-receipt.json", \
+ hashlib.sha256(stored).hexdigest()
+
+
+def test_transitions_from_one_darwin_receipt_emit_one_macos_row(tmp_path, r2_server, https_origin,
+ monkeypatch):
+ from scripts.releases import stable
+
+ url, digest = _staged_receipt(tmp_path, r2_server, https_origin, monkeypatch, "darwin-arm64")
+ baseline = _local_baseline(https_origin.base)
+ https_origin.store["baseline.json"] = (json.dumps(baseline).encode(), '"e"')
+ monkeypatch.setattr(stable, "output", lambda argv: json.dumps(
+ {"tagName": baseline["tag"], "isDraft": False, "isPrerelease": False}))
+ stable.main(["transitions"], _transitions_env(tmp_path, https_origin.base,
+ "darwin-arm64", url, digest))
+ emitted = dict(line.split("=", 1)
+ for line in (tmp_path / "output").read_text(encoding="utf-8").splitlines())
+ macos = json.loads(emitted["macos"])
+ windows = json.loads(emitted["windows"])
+ assert [row["arch"] for row in macos["include"]] == ["arm64"]
+ assert windows["include"] == []
+ assert all(row["manifest"].startswith(f"{https_origin.base}/releases/tag/{ATTEMPT}/")
+ for row in macos["include"])
+
+
+def test_transitions_from_the_bundle_receipt_emit_two_windows_rows(tmp_path, r2_server, https_origin,
+ monkeypatch):
+ from scripts.releases import stable
+
+ url, digest = _staged_receipt(tmp_path, r2_server, https_origin, monkeypatch, "win32-bundle")
+ baseline = _local_baseline(https_origin.base)
+ https_origin.store["baseline.json"] = (json.dumps(baseline).encode(), '"e"')
+ monkeypatch.setattr(stable, "output", lambda argv: json.dumps(
+ {"tagName": baseline["tag"], "isDraft": False, "isPrerelease": False}))
+ stable.main(["transitions"], _transitions_env(tmp_path, https_origin.base,
+ "win32-bundle", url, digest))
+ emitted = dict(line.split("=", 1)
+ for line in (tmp_path / "output").read_text(encoding="utf-8").splitlines())
+ macos = json.loads(emitted["macos"])
+ windows = json.loads(emitted["windows"])
+ assert [row["arch"] for row in windows["include"]] == ["x64", "arm64"]
+ assert macos["include"] == []
+
+
+def test_candidate_manifest_needs_every_call_and_stages_the_archive_manifest(
+ tmp_path, r2_server, https_origin, monkeypatch):
+ from scripts.releases import stable
+
+ https_origin.store = r2_server.store
+ built = tmp_path / "built"
+ built.mkdir()
+ _stage_darwin_handoff(built, "arm64")
+ _stage_darwin_handoff(built, "x64")
+ _stage_windows_handoff(built, "x64")
+ _stage_windows_handoff(built, "arm64")
+ _stage_universal_bundle(built)
+ _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})}
+ stable.main(["candidate-manifest"], env)
+
+ stored, _ = r2_server.store[f"releases/tag/{ATTEMPT}/release-candidates.json"]
+ manifest = json.loads(stored)
+ assert {f"{row['platform']}/{row['arch']}" for row in manifest["packages"]} == {
+ "macos/arm64", "macos/x64", "windows/x64", "windows/arm64", "termux/aarch64"}
+ stable.validate_candidates(manifest, "v1.2.3", RECEIPT_COMMIT, https_origin.base,
+ RELEASE_EPOCH, archive=ATTEMPT)
+ emitted = dict(line.split("=", 1)
+ for line in (tmp_path / "output").read_text(encoding="utf-8").splitlines())
+ assert emitted["manifest-url"] == \
+ f"{https_origin.base}/releases/tag/{ATTEMPT}/release-candidates.json"
+ assert emitted["manifest-sha256"] == hashlib.sha256(stored).hexdigest()
+
+ # 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"}})
+ del r2_server.store[f"releases/tag/{ATTEMPT}/release-candidates.json"]
+ (tmp_path / "output").unlink()
+ with pytest.raises(ValueError, match="smoke-darwin-x64"):
+ stable.main(["candidate-manifest"], failed)
+ assert f"releases/tag/{ATTEMPT}/release-candidates.json" not in r2_server.store