fix(ci): repair develop's workflow policy test and page crawl log check (#8687)

* fix(ci): drop the publisher's obsolete checkout credential allowance

#8648 scoped the remediation publisher's git credentials to its push step,
so its checkouts now set persist-credentials: false and no longer need the
CHECKOUT_WRITE_WORKFLOWS entry #8668 added. The rejection test removed the
publisher from that list and expected a violation, which can no longer
occur, so it failed on develop and on every branch that merged develop.

Remove the stale entry, assert the publisher passes without it, and
exercise the rejection path with a workflow that still keeps checkout
credentials.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* fix(ci): ignore the audit log purge note in the page crawl log check

Daily maintenance logs "NOTE: Purged N Audit Log Records" when the
poller runs at its scheduled time, so locked integration fails whenever a
run crosses that time. Filter the note like the other routine maintenance
lines.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

---------

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
This commit is contained in:
Thomas Vincent authored and GitHub committed 2026-11-09 21:24:57 -05:00
1 parent 50111c475c
commit 4c2f00a987
3 files changed
+16 -9

No files matched your search

-1
View File
@@ -17,7 +17,6 @@ DEFAULT_WORKFLOW_GLOB = ".github/workflows/*"
DEFAULT_ACTION_GLOB = ".github/actions/**/action.y*ml"
ALLOWED_RUNNERS = {"ubuntu-24.04", "ubuntu-slim"}
CHECKOUT_WRITE_WORKFLOWS = {
".github/workflows/released-dependency-audit.yml",
".github/workflows/security-baseline-refresh.yml",
".github/workflows/update-contributors.yml",
}
+1
View File
@@ -758,6 +758,7 @@ FILTERED_LOG="$(grep -v \
-e "DSDEBUG Bad Data" \
-e "PUSHOUT Child Started" \
-e "MAINTENANCE INFO: Another maintenance session is already running" \
-e "POLLER: Poller\[[0-9]*\] PID\[[0-9]*\] NOTE: Purged [0-9]* Audit Log Records from Cacti" \
-e "io_uring_queue_init() failed" \
"$CACTI_LOG")" || true
+15 -8
View File
@@ -13,6 +13,7 @@ from unittest import mock
ROOT = Path(__file__).resolve().parents[2]
SCRIPT = ROOT / ".github/scripts/check-workflow-policy.py"
PUBLISHER = ".github/workflows/released-dependency-audit.yml"
CONTRIBUTORS = ".github/workflows/update-contributors.yml"
sys.dont_write_bytecode = True
SPEC = importlib.util.spec_from_file_location("check_workflow_policy", SCRIPT)
@@ -31,23 +32,29 @@ def run_policy(*workflows: str) -> tuple[int, str]:
class WorkflowPolicyTest(unittest.TestCase):
def test_publisher_checkout_may_keep_credentials_for_its_push(self) -> None:
def test_publisher_passes_without_a_credentialed_checkout_allowance(self) -> None:
# The publisher scopes its git credentials to the push step, so its
# checkouts no longer need an entry in CHECKOUT_WRITE_WORKFLOWS.
self.assertNotIn(PUBLISHER, POLICY.CHECKOUT_WRITE_WORKFLOWS)
status, output = run_policy(PUBLISHER)
self.assertEqual(0, status, output)
def test_unlisted_workflow_with_a_credentialed_checkout_is_rejected(self) -> None:
allowed = POLICY.CHECKOUT_WRITE_WORKFLOWS - {PUBLISHER}
allowed = POLICY.CHECKOUT_WRITE_WORKFLOWS - {CONTRIBUTORS}
with mock.patch.object(POLICY, "CHECKOUT_WRITE_WORKFLOWS", allowed):
status, output = run_policy(PUBLISHER)
status, output = run_policy(CONTRIBUTORS)
self.assertEqual(1, status)
self.assertIn(
f"{PUBLISHER}:Checkout released branch for publication: "
"read-only checkout must set persist-credentials: false",
output,
)
self.assertIn("read-only checkout must set persist-credentials: false", output)
self.assertIn(f"{CONTRIBUTORS}:", output)
def test_listed_workflow_may_keep_checkout_credentials(self) -> None:
status, output = run_policy(CONTRIBUTORS)
self.assertEqual(0, status, output)
if __name__ == "__main__":