From 16bcaf7e9ddd5e665ad288e5b1042b27188893d4 Mon Sep 17 00:00:00 2001 From: Richard McDaniel <1130888+rmcdaniel@users.noreply.github.com> Date: Thu, 19 Nov 2026 18:37:30 +0000 Subject: [PATCH] Set up CI PHP from the immutable archive mirror Adoption step of qualification/PHP-ARCHIVE-UPDATES.md: ci.yml's setup-php-linux pin moves from cba1285d to 636d0cda, whose catalog binds both setup rows to their durable-workflow/php-archives mirror assets. The new bytes equal the reviewed fixture approved in #422 (b3868834). Tests that compare or derive from ci.yml now use that fixture and pin; the qualification workflow fixtures still use cba1285d. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 2 +- tests/test_native_policy_workflow.py | 2 +- tests/test_protected_policy_data.py | 18 ++++++++++-------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 348e062..a010e51 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: - name: Disable APT download retries (CVE-2026-109518) run: echo 'Acquire::Retries "0";' | sudo tee /etc/apt/apt.conf.d/99-no-retries >/dev/null - - uses: durable-workflow/.github/.github/actions/setup-php-linux@cba1285ddd43696ac9f445d7d04e8aff8fcad545 # bound-linux-php + - uses: durable-workflow/.github/.github/actions/setup-php-linux@636d0cda4ce1e9c94ac6bf649154ff57957558be # bound-linux-php with: php-version: '8.3' ini-file: production diff --git a/tests/test_native_policy_workflow.py b/tests/test_native_policy_workflow.py index 666c109..fa8f5ac 100644 --- a/tests/test_native_policy_workflow.py +++ b/tests/test_native_policy_workflow.py @@ -31,7 +31,7 @@ def test_only_central_pinned_code_is_checked_out_without_persisted_credentials(s def test_current_ci_and_sonar_bind_exact_reviewed_workflow_fixtures(self): checkout = self.workflow["jobs"]["policy"]["steps"][0] self.assertEqual("0bde98cd8a761069fea15ae5392e51d80001a169", checkout["with"]["ref"]) - for name, fixture in (("ci", "ci-php-archive-repair-20261119-source.yml"), + for name, fixture in (("ci", "ci-php-archive-mirror-20261119-source.yml"), ("sonar", "sonar-response-loss-source.yml")): self.assertEqual((ROOT / "tests/fixtures" / fixture).read_bytes(), (ROOT / f".github/workflows/{name}.yml").read_bytes()) diff --git a/tests/test_protected_policy_data.py b/tests/test_protected_policy_data.py index 0c56496..dd37b91 100644 --- a/tests/test_protected_policy_data.py +++ b/tests/test_protected_policy_data.py @@ -27,10 +27,12 @@ REPOSITORY = data.DATA_REPOSITORY REPOSITORY_ID = native.PILOT_ID MIRROR = bootstrap.MIRROR_REPOSITORY +# The qualification workflows still check out cba1285d; ci.yml uses the mirrored setup pin. CURRENT_PIN = "cba1285ddd43696ac9f445d7d04e8aff8fcad545" +CI_PIN = "636d0cda4ce1e9c94ac6bf649154ff57957558be" CI = ".github/workflows/ci.yml" QUALIFY = (".github/workflows/qualify-linux-php-initial.yml", ".github/workflows/qualify-linux-php-ubuntu24.yml") -CI_FIXTURE = "tests/fixtures/ci-php-archive-repair-20261119-source.yml" +CI_FIXTURE = "tests/fixtures/ci-php-archive-mirror-20261119-source.yml" QUALIFY_FIXTURES = ("tests/fixtures/qualify-linux-php-initial-archive-repair-20261119.yml", "tests/fixtures/qualify-linux-php-ubuntu24-archive-repair-20261119.yml") # The registries hard-coded in runtime 90313f07 (the #411 head), as sorted @@ -154,7 +156,7 @@ def archive_update(files: dict[str, bytes], release: str, compressed: bytes, ups return updated, row -def approve_pin(files: dict[str, bytes], pin: str, old_pin: str = CURRENT_PIN) -> dict[str, bytes]: +def approve_pin(files: dict[str, bytes], pin: str, old_pin: str = CI_PIN) -> dict[str, bytes]: """The routine approval: one bound setup pin and pin-substituted reviewed workflow bytes.""" updated = dict(files) policy = json.loads(files[data.POLICY_PATH]) @@ -177,7 +179,7 @@ def approve_pin(files: dict[str, bytes], pin: str, old_pin: str = CURRENT_PIN) - return updated -def adopt_workflows(files: dict[str, bytes], pin: str, old_pin: str = CURRENT_PIN) -> dict[str, bytes]: +def adopt_workflows(files: dict[str, bytes], pin: str, old_pin: str = CI_PIN) -> dict[str, bytes]: updated = dict(files) updated[CI] = files[CI].replace(old_pin.encode(), pin.encode()) return updated @@ -375,11 +377,11 @@ def test_new_or_changed_workflow_approvals_need_a_routine_derivation(self): def test_derivation_admits_only_setup_action_pin_substitution(self): old = self.files[CI_FIXTURE] - self.assertEqual(1, old.count(CURRENT_PIN.encode())) + self.assertEqual(1, old.count(CI_PIN.encode())) pin, other = git_sha("pin"), git_sha("other") - new = old.replace(CURRENT_PIN.encode(), pin.encode()) - self.assertEqual(pin, data.routine_substitution(old, new, frozenset({CURRENT_PIN}), frozenset({pin}))) - unapproved = old.replace(CURRENT_PIN.encode(), git_sha("x").encode()) + new = old.replace(CI_PIN.encode(), pin.encode()) + self.assertEqual(pin, data.routine_substitution(old, new, frozenset({CI_PIN}), frozenset({pin}))) + unapproved = old.replace(CI_PIN.encode(), git_sha("x").encode()) for label, before, after, pins in ( ("extra edit", old, new.replace(b"python -m unittest", b"python -m unittest ; curl evil", 1), {pin}), ("comment edit", old, new.replace(b"# bound-linux-php", b"# other"), {pin}), @@ -389,7 +391,7 @@ def test_derivation_admits_only_setup_action_pin_substitution(self): b"ref: " + pin.encode(), 1), {pin}), ("identical bytes", old, old, {pin})): with self.subTest(label), self.assertRaises(InputRefused): - data.routine_substitution(before, after, frozenset({CURRENT_PIN}), frozenset(pins)) + data.routine_substitution(before, after, frozenset({CI_PIN}), frozenset(pins)) def test_a_pin_swap_in_a_checkout_position_needs_a_runtime_review(self): old = self.files[QUALIFY_FIXTURES[0]]