From 8b51af7f977be3eb97f7bf001bbf80246dd9c5c7 Mon Sep 17 00:00:00 2001 From: Threepwood-7 Date: Tue, 24 Nov 2026 17:24:17 +0100 Subject: [PATCH 1/2] Assemble image evidence with its pinned producer --- .github/workflows/release.yml | 9 ++++++++- tools/tests/test_release_linux_provisioning.py | 10 ++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9f272dff..ed8ec8b6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1091,6 +1091,13 @@ jobs: ref: ${{ env.EMULEBB_RELEASE_VALIDATOR_REF }} path: emulebb-build persist-credentials: false + - name: Checkout the pinned image producer for evidence assembly + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: emulebb/emulebb-build + ref: ${{ env.EMULEBB_BUILD_REF }} + path: emulebb-image-build + persist-credentials: false - name: Checkout pinned image evidence reader uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -1178,7 +1185,7 @@ jobs: merge-multiple: true path: ${{ runner.temp }}/emulebb-rust-out/image-evidence/alpine - name: Bind both native CPU proofs to each exact OCI archive - working-directory: emulebb-build + working-directory: emulebb-image-build shell: bash env: EMULEBB_WORKSPACE_OUTPUT_ROOT: ${{ runner.temp }}/emulebb-rust-out diff --git a/tools/tests/test_release_linux_provisioning.py b/tools/tests/test_release_linux_provisioning.py index 96428685..171efaff 100644 --- a/tools/tests/test_release_linux_provisioning.py +++ b/tools/tests/test_release_linux_provisioning.py @@ -146,6 +146,16 @@ def test_native_smoke_proves_identity_and_owns_profile_contention_scratch(self): self.assertIn("${{ matrix.os == 'windows' && matrix.arch == 'x64' && '--render-webui' || '' }}", smoke["run"]) self.assertNotIn("continue-on-error", smoke) + def test_image_evidence_assembly_uses_the_producer_checkout(self): + steps = self.workflow["jobs"]["assemble-candidate"]["steps"] + assemble = next(step for step in steps if "assemble-emulebb-rust-image-evidence-ci" in step.get("run", "")) + producer = next(step for step in steps if step.get("with", {}).get("path") == assemble["working-directory"]) + validator = next(step for step in steps if step.get("with", {}).get("path") == "emulebb-build") + self.assertLess(steps.index(producer), steps.index(assemble)) + self.assertEqual(producer["with"]["repository"], "emulebb/emulebb-build") + self.assertEqual(producer["with"]["ref"], "${{ env.EMULEBB_BUILD_REF }}") + self.assertEqual(validator["with"]["ref"], "${{ env.EMULEBB_RELEASE_VALIDATOR_REF }}") + def test_musl_and_image_consumers_select_mirrors_without_changing_runtime_base(self): for job, command in (("musl-package", "package-emulebb-rust-linux-ci"), ("image-candidate", "package-emulebb-rust-image-ci")): From a3554584262354d4ce5f8ea811487d0b68355ddc Mon Sep 17 00:00:00 2001 From: Threepwood-7 Date: Tue, 24 Nov 2026 17:34:53 +0100 Subject: [PATCH 2/2] Use producer tool inputs during candidate revalidation --- .github/workflows/release.yml | 17 ++++++++++------- tools/release_publish.py | 2 ++ tools/tests/test_release_linux_provisioning.py | 11 +++++++++++ 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ed8ec8b6..100fab99 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,8 +55,8 @@ env: EMULEBB_LINUX_PREPARED_IMAGE: ghcr.io/emulebb/emulebb-build-ci/ubuntu-rust@sha256:182090666a847a8c49e4e782f172ab845e295646eb2f246e75ff3ad989519237 EMULEBB_BUILD_TESTS_REF: 135930dcbf350cc37477baf528f9d29ff4a573e9 EMULEBB_TOOLING_REF: ac8609756b097d1294308abeef962fe1592e4e38 - EMULEBB_RELEASE_VALIDATOR_REF: 79bdc2d240fcb3b11a9e3e937df16dec2121eee6 - EMULEBB_APK_BUILD_REF: 79bdc2d240fcb3b11a9e3e937df16dec2121eee6 + EMULEBB_RELEASE_VALIDATOR_REF: f9fd190ed6236c6ebb3a71aac8ff0e73e7a06b84 + EMULEBB_APK_BUILD_REF: f9fd190ed6236c6ebb3a71aac8ff0e73e7a06b84 EMULEBB_APK_BUILD_TESTS_REF: 5a082f4542a74aad3d36ed9b3e17640028ed47f9 EMULEBB_ANDROID_SIGNER_SHA256: 9edc742d7230a714a0149c20eb2afb235b8ad5237166090f10e7ac69e2bb359f MINIUPNP_REF: 4e7a10948004ca2085ac8103e14fc77edb898b4c @@ -1091,7 +1091,8 @@ jobs: ref: ${{ env.EMULEBB_RELEASE_VALIDATOR_REF }} path: emulebb-build persist-credentials: false - - name: Checkout the pinned image producer for evidence assembly + - &release-producer-checkout + name: Checkout the pinned producer for release evidence uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: emulebb/emulebb-build @@ -1241,7 +1242,7 @@ jobs: --release-dir "$RELEASE_DIR" --output "$RELEASE_DIR/emulebb-rust-v$RELEASE_VERSION-candidate-manifest.json" --archives-dir "$EMULEBB_WORKSPACE_OUTPUT_ROOT/artifacts" - --build-repo emulebb-build --apk-harness-repo emulebb-apk-tests --harness-repo emulebb-build-tests + --build-repo emulebb-build --producer-build-repo emulebb-image-build --apk-harness-repo emulebb-apk-tests --harness-repo emulebb-build-tests --github-output "$GITHUB_OUTPUT" - name: Retain the exact public release candidate uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 @@ -1288,6 +1289,7 @@ jobs: ref: ${{ env.EMULEBB_RELEASE_VALIDATOR_REF }} path: emulebb-build persist-credentials: false + - *release-producer-checkout - name: Checkout pinned OCI graph reader uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -1340,7 +1342,7 @@ jobs: run: >- python -B emulebb-rust/tools/release_publish.py publish-images --release-dir "$RELEASE_DIR" --archives-dir "$EMULEBB_WORKSPACE_OUTPUT_ROOT/artifacts" - --build-repo emulebb-build --apk-harness-repo emulebb-apk-tests --harness-repo emulebb-build-tests + --build-repo emulebb-build --producer-build-repo emulebb-image-build --apk-harness-repo emulebb-apk-tests --harness-repo emulebb-build-tests --assembled-candidate-sha256 "$ASSEMBLED_CANDIDATE_SHA" --github-output "$GITHUB_OUTPUT" - name: Attest the published Ubuntu digest uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 @@ -1388,6 +1390,7 @@ jobs: ref: ${{ env.EMULEBB_RELEASE_VALIDATOR_REF }} path: emulebb-build persist-credentials: false + - *release-producer-checkout - name: Checkout independently pinned APK evidence reader if: ${{ inputs.channel == 'nightly' }} uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -1414,7 +1417,7 @@ jobs: run: | set -euo pipefail python -B emulebb-rust/tools/release_publish.py release-assets \ - --release-dir "$RELEASE_DIR" --build-repo emulebb-build --apk-harness-repo emulebb-apk-tests \ + --release-dir "$RELEASE_DIR" --build-repo emulebb-build --producer-build-repo emulebb-image-build --apk-harness-repo emulebb-apk-tests \ --verified-candidate-sha256 "$VERIFIED_CANDIDATE_SHA" --phase before-upload - name: Attest the exact native release candidate uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 @@ -1440,7 +1443,7 @@ jobs: run: | set -euo pipefail python -B emulebb-rust/tools/release_publish.py release-assets \ - --release-dir "$RELEASE_DIR" --build-repo emulebb-build --apk-harness-repo emulebb-apk-tests \ + --release-dir "$RELEASE_DIR" --build-repo emulebb-build --producer-build-repo emulebb-image-build --apk-harness-repo emulebb-apk-tests \ --verified-candidate-sha256 "$VERIFIED_CANDIDATE_SHA" --phase after-upload --release-id "$RELEASE_ID" gh api --method PATCH "repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID" -F draft=false diff --git a/tools/release_publish.py b/tools/release_publish.py index dd055343..a35588cd 100644 --- a/tools/release_publish.py +++ b/tools/release_publish.py @@ -318,6 +318,7 @@ def candidate_context(args: argparse.Namespace, owner): "runAttempt": args.run_attempt, "workflowSha": args.workflow_sha}, platform_profile=args.platform_profile, release_validator_build_sha=args.release_validator_build_ref, + producer_build_root=getattr(args, "producer_build_repo", None), **apk, ).checked() @@ -706,6 +707,7 @@ def build_parser() -> argparse.ArgumentParser: candidate.add_argument("--" + flag, default=default, required=not default, help=f"Expected identity; defaults to the caller's {environment}.") candidate.add_argument("--build-repo", required=True, type=Path) + candidate.add_argument("--producer-build-repo", type=Path) for flag, environment in {"apk-build-ref": "EMULEBB_APK_BUILD_REF", "apk-harness-ref": "EMULEBB_APK_BUILD_TESTS_REF", "apk-signer-sha256": "EMULEBB_ANDROID_SIGNER_SHA256"}.items(): candidate.add_argument("--" + flag, default=os.environ.get(environment)) diff --git a/tools/tests/test_release_linux_provisioning.py b/tools/tests/test_release_linux_provisioning.py index 171efaff..4d338c61 100644 --- a/tools/tests/test_release_linux_provisioning.py +++ b/tools/tests/test_release_linux_provisioning.py @@ -156,6 +156,17 @@ def test_image_evidence_assembly_uses_the_producer_checkout(self): self.assertEqual(producer["with"]["ref"], "${{ env.EMULEBB_BUILD_REF }}") self.assertEqual(validator["with"]["ref"], "${{ env.EMULEBB_RELEASE_VALIDATOR_REF }}") + def test_candidate_readers_verify_tool_data_from_the_pinned_producer(self): + for name in ("assemble-candidate", "publish-image", "publish-native"): + steps = self.workflow["jobs"][name]["steps"] + producer = next(step for step in steps if step.get("with", {}).get("path") == "emulebb-image-build") + self.assertEqual(producer["with"]["ref"], "${{ env.EMULEBB_BUILD_REF }}") + readers = [step for step in steps if "--build-repo " in step.get("run", "")] + self.assertTrue(readers) + for reader in readers: + self.assertLess(steps.index(producer), steps.index(reader)) + self.assertIn("--producer-build-repo emulebb-image-build", reader["run"]) + def test_musl_and_image_consumers_select_mirrors_without_changing_runtime_base(self): for job, command in (("musl-package", "package-emulebb-rust-linux-ci"), ("image-candidate", "package-emulebb-rust-image-ci")):