Skip to content

Commit 065826e

Browse files
luisleo526claude
andcommitted
ci(release): the ruleset probe job runs on pf-gcp-post; pf-gcp-main admits only allowlisted workflows (CR-245 F1)
The org runner group pf-gcp-main (id 9) is restricted to workflows on an allow-list that does not name release-ruleset-probe.yml, so a dispatch of the probe on ["self-hosted","pf-gcp-main"] would queue forever. The allow-list is the owner's org security setting and is not widened; the one-time probe uses the unrestricted pf-gcp-post group (the canon fleet for engine post-merge and manual jobs) instead. Everything else is unchanged: workflow_dispatch from main, the App-token mint byte-identical to release.yml's, contents: read, persist-credentials: false, the authz job on pf-gcp-pr, the probe command, release.yml. Changes: the probe job's runs-on (workflow file and the whole-file template RELEASE_RULESETS_PROBE_WORKFLOW), RELEASE_JOB_RUNNERS['release-ruleset-probe.yml'] = {'authz': PR_RUNNER, 'probe': POST_RUNNER} (the per-job map already accepts a non-release label), the fleet tests (the helper now recognises a post override; the probe on pf-gcp-main or pf-gcp-pr is refused with the specific finding; the post label is accepted; the site counts stay 31 and 15, derived from the workflow files), and docs/ci.md with one added sentence saying why. Red-first rows and deletion controls for the new doc sentences. Rewrites that replace earlier text (named for the doc-reverts check), all introduced by 5ce34fc ("the probe's hidden-bypass_actors refusal states what was observed...", round 3 of the probe): docs/ci.md "The manual `release-ruleset-probe.yml` workflow runs `authz` on" ... "and `probe` on `["self-hosted","pf-gcp-main"]`." (only the probe's label changes); docs/ci.md "Release, promotion and the release ruleset probe use the isolated release fleet:" (the probe leaves the pf-gcp-main list; release, notify-hub, Linux x64 prebuilt and promote stay); the comment "# authz uses pf-gcp-pr; the App-token probe uses pf-gcp-main." in the workflow, in ci_preflight.py and in test_ci_preflight.py (now pf-gcp-post), which also touches the comment lines of 6adae66 and 1d5dfd6 that 5ce34fc had rewritten. Lane: ci-fu-cr486t (Codex gpt-6.1-sol). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
1 parent 49a55b5 commit 065826e

5 files changed

Lines changed: 71 additions & 26 deletions

File tree

‎.github/workflows/release-ruleset-probe.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
authz:
1313
name: authz
1414
# Preflight pins executable workflow lines after removing comment-only lines.
15-
# authz uses pf-gcp-pr; the App-token probe uses pf-gcp-main.
15+
# authz uses pf-gcp-pr; the App-token probe uses pf-gcp-post.
1616
runs-on: ["self-hosted", "pf-gcp-pr"]
1717
permissions: {}
1818
# No timeout-minutes: the owner's no-time-limits rule (check-no-time-limits refuses new ones).
@@ -74,7 +74,7 @@ jobs:
7474
7575
probe:
7676
needs: [authz]
77-
runs-on: ["self-hosted","pf-gcp-main"]
77+
runs-on: ["self-hosted","pf-gcp-post"]
7878
steps:
7979
- name: Mint org App token
8080
id: app

‎docs/ci.md‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ fleet. The checker follows local reusable calls, so a PR caller cannot borrow
6969
a post workflow even behind a job condition.
7070

7171
The manual `release-ruleset-probe.yml` workflow runs `authz` on
72-
`["self-hosted","pf-gcp-pr"]` and `probe` on `["self-hosted","pf-gcp-main"]`.
72+
`["self-hosted","pf-gcp-pr"]` and `probe` on `["self-hosted","pf-gcp-post"]`.
7373

7474
`docs.yml` retains the PR build name and `.github/**` exclusion.
7575
`docs-post.yml` builds and deploys on main pushes and manual dispatch.
@@ -1150,9 +1150,11 @@ pins that one job name and image, and the exception never applies to a
11501150
workflow reachable from `pull_request`. The PR build remains
11511151
`build (ubuntu-24.04, Release)` and its aggregate remains `build`.
11521152

1153-
Release, promotion and the release ruleset probe use the isolated release fleet:
1154-
`release`, `notify-hub`, Linux x64 `prebuilt`, baseline `promote` and
1155-
`release-ruleset-probe.yml`'s `probe` job use `["self-hosted","pf-gcp-main"]`.
1153+
Release and promotion use the isolated release fleet:
1154+
`release`, `notify-hub`, Linux x64 `prebuilt` and baseline `promote` use
1155+
`["self-hosted","pf-gcp-main"]`.
1156+
The release ruleset probe runs `authz` on `["self-hosted","pf-gcp-pr"]` and
1157+
`probe` on `["self-hosted","pf-gcp-post"]`.
11561158
Release's ARM/macOS artifact cells keep their existing hosted pins, and
11571159
promotion runs on a push to `main` plus manual dispatch from `main`.
11581160

@@ -1379,6 +1381,10 @@ Dispatch **Release ruleset probe** (`release-ruleset-probe.yml`) once from
13791381
`main` to check actual ruleset visibility with the same App token mint as
13801382
`release.yml`. The workflow file must be on the default branch, and the run
13811383
must use `main`'s copy.
1384+
The probe job runs on `["self-hosted","pf-gcp-post"]`, with `authz` on
1385+
`["self-hosted","pf-gcp-pr"]`.
1386+
`pf-gcp-main` admits only allowlisted workflows (an org runner-group restriction),
1387+
so the one-time probe uses `pf-gcp-post`.
13821388
It runs `python3 scripts/ci_release_gate.py rulesets-probe --repo OWNER/REPO`,
13831389
reading only repository metadata, the parent-inclusive ruleset inventory and
13841390
branch details. Success prints the barrier id/name and one compact inventory

‎scripts/ci_preflight.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
RELEASE_JOB_RUNNERS = {
155155
'release.yml': {'release': RELEASE_RUNNER, 'prebuilt': HOSTED_MATRIX_RUNNER,
156156
'notify-hub': RELEASE_RUNNER},
157-
'release-ruleset-probe.yml': {'authz': PR_RUNNER, 'probe': RELEASE_RUNNER},
157+
'release-ruleset-probe.yml': {'authz': PR_RUNNER, 'probe': POST_RUNNER},
158158
'promote-baseline.yml': {'promote': RELEASE_RUNNER},
159159
}
160160
# Credential-bearing jobs outside the release pins and gated docs build retain
@@ -889,8 +889,8 @@ def workflow_fleet_findings(workflows: dict[str, str]) -> list[str]:
889889
findings = []
890890
routes = workflow_event_routes(workflows)
891891
for name, workflow in workflows.items():
892-
# Isolated-release pins are checked by runner_findings; the probe
893-
# shares release.yml's App credential and isolated runner.
892+
# Per-job release/probe pins are checked by runner_findings; the probe
893+
# shares release.yml's App credential and uses the post fleet.
894894
if name in RELEASE_JOB_RUNNERS:
895895
continue
896896
events = _events(workflow)
@@ -1186,7 +1186,7 @@ def _step_block(step: str, key: str) -> list[str]:
11861186
authz:
11871187
name: authz
11881188
# Preflight pins executable workflow lines after removing comment-only lines.
1189-
# authz uses pf-gcp-pr; the App-token probe uses pf-gcp-main.
1189+
# authz uses pf-gcp-pr; the App-token probe uses pf-gcp-post.
11901190
runs-on: ["self-hosted", "pf-gcp-pr"]
11911191
permissions: {}
11921192
# No timeout-minutes: the owner's no-time-limits rule (check-no-time-limits refuses new ones).
@@ -1248,7 +1248,7 @@ def _step_block(step: str, key: str) -> list[str]:
12481248
12491249
probe:
12501250
needs: [authz]
1251-
runs-on: ["self-hosted","pf-gcp-main"]
1251+
runs-on: ["self-hosted","pf-gcp-post"]
12521252
steps:
12531253
- name: Mint org App token
12541254
id: app

‎scripts/test_ci_preflight.py‎

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
authz:
7979
name: authz
8080
# Preflight pins executable workflow lines after removing comment-only lines.
81-
# authz uses pf-gcp-pr; the App-token probe uses pf-gcp-main.
81+
# authz uses pf-gcp-pr; the App-token probe uses pf-gcp-post.
8282
runs-on: ["self-hosted", "pf-gcp-pr"]
8383
permissions: {}
8484
# No timeout-minutes: the owner's no-time-limits rule (check-no-time-limits refuses new ones).
@@ -140,7 +140,7 @@
140140
141141
probe:
142142
needs: [authz]
143-
runs-on: ["self-hosted","pf-gcp-main"]
143+
runs-on: ["self-hosted","pf-gcp-post"]
144144
steps:
145145
- name: Mint org App token
146146
id: app
@@ -507,16 +507,16 @@ def gcp_sites(self):
507507
if (name, job) in (('ci-post.yml', 'build-macos'),
508508
('promote-baseline.yml', 'promote-guard')):
509509
continue # Both hosted exceptions have their own negative controls.
510-
# Release workflows retain a non-release canon authz runner.
511-
fleet = ('pr' if ci_preflight.RELEASE_JOB_RUNNERS.get(name, {}).get(job) == PR_RUNNER
512-
else workflow_fleet)
510+
# Per-job pins retain the canon PR fleet or the dispatch post fleet.
511+
fixed_runner = ci_preflight.RELEASE_JOB_RUNNERS.get(name, {}).get(job)
512+
fleet = {PR_RUNNER: 'pr', POST_RUNNER: 'post'}.get(fixed_runner, workflow_fleet)
513513
runner = {'pr': PR_RUNNER, 'post': POST_RUNNER, 'main': RELEASE_RUNNER}[fleet]
514514
if (name, job) == ('release.yml', 'prebuilt'):
515515
yield name, job, fleet, f' runner: {RELEASE_RUNNER}\n', RELEASE_MATRIX_FINDING
516516
continue
517517
value, = ci_preflight._job_values(body, 'runs-on', unquote=False)
518518
finding = f'{name} job {job} must run on {runner}'
519-
if fleet == 'main':
519+
if fixed_runner is not None and fixed_runner != PR_RUNNER:
520520
finding += ' (isolated release)'
521521
yield name, job, fleet, f' runs-on: {value}\n', finding
522522

@@ -2025,7 +2025,7 @@ def test_ci_contract_pins_spot_runners_time_limits_and_parallelism(self):
20252025
'notify-hub': '["self-hosted","pf-gcp-main"]'},
20262026
'release-ruleset-probe.yml': {
20272027
'authz': '["self-hosted","pf-gcp-pr"]',
2028-
'probe': '["self-hosted","pf-gcp-main"]'},
2028+
'probe': '["self-hosted","pf-gcp-post"]'},
20292029
'promote-baseline.yml': {
20302030
'promote': '["self-hosted","pf-gcp-main"]'},
20312031
})
@@ -2244,6 +2244,14 @@ def test_gcp_sites_reject_cross_class_routes(self):
22442244
findings = self.routed_file_findings(name, job, before, routed_line(before, runner))
22452245
self.assertIn(finding, findings)
22462246

2247+
def test_gcp_sites_pin_probe_to_the_dispatch_fleet(self):
2248+
sites = [site for site in self.gcp_sites() if site[0] == 'release-ruleset-probe.yml']
2249+
self.assertEqual([(job, fleet) for _, job, fleet, *_ in sites],
2250+
[('authz', 'pr'), ('probe', 'post')])
2251+
self.assertEqual(sites[1][-1],
2252+
f'release-ruleset-probe.yml job probe must run on {POST_RUNNER} '
2253+
'(isolated release)')
2254+
22472255
def test_gcp_sites_reject_retired_and_void_labels(self):
22482256
for name, job, fleet, before, finding in self.gcp_sites():
22492257
runner = {'pr': PR_RUNNER, 'post': POST_RUNNER, 'main': RELEASE_RUNNER}[fleet]
@@ -3638,7 +3646,7 @@ def test_release_ruleset_probe_workflow_is_installed_and_pinned(self):
36383646
self.assertEqual(ci_preflight._code(path.read_text()),
36393647
ci_preflight._code(RULESETS_PROBE_WORKFLOW))
36403648
self.assertEqual(ci_preflight.RELEASE_JOB_RUNNERS.get(path.name),
3641-
{'authz': PR_RUNNER, 'probe': RELEASE_RUNNER})
3649+
{'authz': PR_RUNNER, 'probe': POST_RUNNER})
36423650
probe_app = ci_preflight._step_named(ci_preflight._steps(_jobs(path.read_text())['probe']),
36433651
' - name: Mint org App token')
36443652
release_app = ci_preflight._step_named(
@@ -3647,12 +3655,36 @@ def test_release_ruleset_probe_workflow_is_installed_and_pinned(self):
36473655
self.assertEqual(probe_app, release_app, 'the mint steps must stay byte-identical')
36483656
self.assertEqual(ci_workflow_findings(*self.ci_sources(), others=self.other_sources()), [])
36493657

3658+
def test_release_ruleset_probe_post_fleet_is_accepted(self):
3659+
workflows = {'release-ruleset-probe.yml': RULESETS_PROBE_WORKFLOW}
3660+
self.assertEqual(ci_preflight.runner_findings(workflows), [])
3661+
self.assertEqual(ci_preflight.release_rulesets_probe_workflow_findings(
3662+
RULESETS_PROBE_WORKFLOW, self.other_sources()['release.yml']), [])
3663+
3664+
def test_release_ruleset_probe_refuses_release_and_pr_fleets(self):
3665+
original, others = self.ci_sources(), self.other_sources()
3666+
finding = (f'release-ruleset-probe.yml job probe must run on {POST_RUNNER} '
3667+
'(isolated release)')
3668+
for runner in (RELEASE_RUNNER, PR_RUNNER):
3669+
with self.subTest(runner=runner):
3670+
changed = in_job(RULESETS_PROBE_WORKFLOW, 'probe',
3671+
f' runs-on: {POST_RUNNER}\n',
3672+
f' runs-on: {runner}\n')
3673+
self.assertNotEqual(changed, RULESETS_PROBE_WORKFLOW)
3674+
self.assertIn(finding, ci_preflight.runner_findings(
3675+
{'release-ruleset-probe.yml': changed}))
3676+
self.assertIn(finding, ci_workflow_findings(
3677+
*original, others={**others, 'release-ruleset-probe.yml': changed}))
3678+
self.assertIn(RULESETS_PROBE_FINDING,
3679+
ci_preflight.release_rulesets_probe_workflow_findings(
3680+
changed, others['release.yml']))
3681+
36503682
def test_release_ruleset_probe_comments_describe_the_actual_pin_scope(self):
36513683
source = (ROOT / 'scripts/ci_preflight.py').read_text()
36523684
workflow = (ROOT / '.github/workflows/release-ruleset-probe.yml').read_text()
36533685
header = (
36543686
' # Preflight pins executable workflow lines after removing comment-only lines.\n'
3655-
' # authz uses pf-gcp-pr; the App-token probe uses pf-gcp-main.\n')
3687+
' # authz uses pf-gcp-pr; the App-token probe uses pf-gcp-post.\n')
36563688
requirements = (
36573689
(source,
36583690
'# Scoped CI workflows bind this canon header byte for byte, including its\n'
@@ -3724,7 +3756,8 @@ def test_release_ruleset_probe_workflow_mutations_refuse(self):
37243756
('permissions', ' contents: read', ' contents: write'),
37253757
('extra scope', ' contents: read', ' contents: read\n actions: read'),
37263758
('job permissions', ' probe:\n', ' probe:\n permissions:\n contents: write\n'),
3727-
('runner', RELEASE_RUNNER, POST_RUNNER),
3759+
('runner', POST_RUNNER, RELEASE_RUNNER),
3760+
('PR runner', POST_RUNNER, PR_RUNNER),
37283761
('app action', 'actions/create-github-app-token@v1',
37293762
'actions/create-github-app-token@v2'),
37303763
('app output', ' id: app', ' id: other'),

‎scripts/test_ci_release_gate.py‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,14 +1685,20 @@ def test_probe_dispatch_branch_and_fleets_are_documented(self):
16851685
'PR jobs use `["self-hosted","pf-gcp-pr"]`, and post-merge push/schedule/manual\n'
16861686
'jobs use `["self-hosted","pf-gcp-post"]`.',
16871687
"The manual `release-ruleset-probe.yml` workflow runs `authz` on\n"
1688-
'`["self-hosted","pf-gcp-pr"]` and `probe` on `["self-hosted","pf-gcp-main"]`.',
1689-
"Release, promotion and the release ruleset probe use the isolated release fleet:\n"
1690-
"`release`, `notify-hub`, Linux x64 `prebuilt`, baseline `promote` and\n"
1691-
'`release-ruleset-probe.yml`\'s `probe` job use `["self-hosted","pf-gcp-main"]`.',
1688+
'`["self-hosted","pf-gcp-pr"]` and `probe` on `["self-hosted","pf-gcp-post"]`.',
1689+
"Release and promotion use the isolated release fleet:\n"
1690+
"`release`, `notify-hub`, Linux x64 `prebuilt` and baseline `promote` use\n"
1691+
'`["self-hosted","pf-gcp-main"]`.\n'
1692+
'The release ruleset probe runs `authz` on `["self-hosted","pf-gcp-pr"]` and\n'
1693+
'`probe` on `["self-hosted","pf-gcp-post"]`.',
16921694
"Dispatch **Release ruleset probe** (`release-ruleset-probe.yml`) once from\n"
16931695
"`main` to check actual ruleset visibility with the same App token mint as\n"
16941696
"`release.yml`. The workflow file must be on the default branch, and the run\n"
1695-
"must use `main`'s copy.",
1697+
"must use `main`'s copy.\n"
1698+
'The probe job runs on `["self-hosted","pf-gcp-post"]`, with `authz` on\n'
1699+
'`["self-hosted","pf-gcp-pr"]`.',
1700+
"`pf-gcp-main` admits only allowlisted workflows (an org runner-group restriction),\n"
1701+
"so the one-time probe uses `pf-gcp-post`.",
16961702
)
16971703
message = "docs must state the probe's main dispatch and actual fleet routes"
16981704
for required in requirements:

0 commit comments

Comments
 (0)