Context
stuck-job-watchdog.yml enumerates all organization runner groups:
orgs/${OWNER}/actions/runner-groups?per_page=100
It previously filtered with visible_to_repository=<repo name>. That was removed
in #331 rather than corrected, because the correct value could not be
established:
- the REST docs type
visible_to_repository as "string" and state no format,
so repository name and numeric repository id are both plausible and
not distinguishable from the documentation;
- the endpoint requires
admin:org, which no token available in that workspace
carried, so the two forms could not be compared against a live response;
- both wrong-guess outcomes (a 4xx, or an empty list) land in the watchdog's
fail_closed, so guessing wrong fails every one of its 288 daily runs while
reporting a credential or outage problem that does not exist.
The organization registers a single runner group ("Default") today, so the
filter would select exactly what the unfiltered call already returns. Removing it
cost nothing and removed a live failure risk.
Why this needs revisiting eventually
Enumerating all groups over-counts capacity if a second, restricted group is
ever added. The watchdog cancels runs it believes are dispatcher-stuck, and
over-counting capacity is precisely what could turn a legitimately queued run
into a wrongful cancel. The group names are already logged to the step summary
for this reason.
Trigger and required work
Act when a second group name appears in the watchdog's Organization runner groups: summary line.
- With an
admin:org token, call the endpoint three ways and record the
responses: unfiltered, visible_to_repository=<repo name>, and
visible_to_repository=<numeric repo id>.
- Narrow the walk using whichever form the live response confirms, not
whichever the docs seem to suggest.
- Add a fixture row to
validate_stuck_job_watchdog covering a group that is
not visible to this repository, so the narrowing is pinned.
Until then the current unfiltered walk is correct and safe.
Original finding by GitHub Copilot on #331.
Context
stuck-job-watchdog.ymlenumerates all organization runner groups:It previously filtered with
visible_to_repository=<repo name>. That was removedin #331 rather than corrected, because the correct value could not be
established:
visible_to_repositoryas"string"and state no format,so repository name and numeric repository id are both plausible and
not distinguishable from the documentation;
admin:org, which no token available in that workspacecarried, so the two forms could not be compared against a live response;
fail_closed, so guessing wrong fails every one of its 288 daily runs whilereporting a credential or outage problem that does not exist.
The organization registers a single runner group ("Default") today, so the
filter would select exactly what the unfiltered call already returns. Removing it
cost nothing and removed a live failure risk.
Why this needs revisiting eventually
Enumerating all groups over-counts capacity if a second, restricted group is
ever added. The watchdog cancels runs it believes are dispatcher-stuck, and
over-counting capacity is precisely what could turn a legitimately queued run
into a wrongful cancel. The group names are already logged to the step summary
for this reason.
Trigger and required work
Act when a second group name appears in the watchdog's
Organization runner groups:summary line.admin:orgtoken, call the endpoint three ways and record theresponses: unfiltered,
visible_to_repository=<repo name>, andvisible_to_repository=<numeric repo id>.whichever the docs seem to suggest.
validate_stuck_job_watchdogcovering a group that isnot visible to this repository, so the narrowing is pinned.
Until then the current unfiltered walk is correct and safe.
Original finding by GitHub Copilot on #331.