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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_native_policy_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
18 changes: 10 additions & 8 deletions tests/test_protected_policy_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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])
Expand All @@ -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
Expand Down Expand Up @@ -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}),
Expand All @@ -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]]
Expand Down
Loading