Skip to content

fix: doctor says when an org pool's watch list has gone stale - #52

Merged
aicayzer merged 2 commits into
mainfrom
fix/a-stale-watch-list-is-visible
Aug 31, 2026
Merged

aicayzer merged 2 commits into
mainfrom
fix/a-stale-watch-list-is-visible

Conversation

@aicayzer

Copy link
Copy Markdown
Owner

Closes #51.

doctor already fails an org pool whose --watch list is empty. It said nothing about one that is merely incomplete, which is the same defect short of its limit: a repository added to the organisation later queues work that nothing wakes the pool for, and the pool reports healthy because it is.

What it does

Adds a doctor note, not a failure, naming the repositories at an org pool's scope that its watch list does not cover. It reports rather than judges: a repository may legitimately route every job elsewhere, and nothing readable distinguishes that from one that meant to reach the pool.

_rp_unwatched_repos holds the rule and is pure, so it is tested without touching GitHub. tests/watch-list-staleness.sh covers six cases, including the one that matters most — a repository whose name occurs inside a watched one (acme/one inside acme/one-more) must still count as unwatched. Without comma fencing that fails in the silent direction, reporting a list as complete when it is not.

Review fixes in the second commit

  • _rp_unwatched_repos was inserted between _rp_autoscale's section banner and _rp_autoscale itself, so the comment explaining why only stopped pools are polled read as documentation for the new function. Moved above the banner.
  • The test exported RUNPOOL_BASE_DIR, which nothing reads. The variable is RUNPOOL_BASE, so the base fell through to the real installation while the test's own comment claimed otherwise. Harmless today, since the test only calls a pure function, but it is exactly the claim someone extending it would rely on.

Verification

bash -n and shellcheck --severity=warning clean over the CI file set; all three test suites pass.

An org pool wakes by polling the repositories named in POOL_WATCH, because GitHub reports queued runs per repository rather than per organisation. So the list is the wake mechanism, and a repository missing from it queues work nothing wakes the pool for. That failure is silent in both directions: a queued job is not a failed job, so nothing alerts, and the pool reports healthy because it is.

Doctor now lists the repositories at an org pool's scope that its watch list does not name. It reports rather than decides: a repository there may legitimately route every job to a managed runner, and the routing lives in a variable whose name is a convention of whoever set it up rather than of RunPool.

Not polled at tick time on purpose. Waking on any queued run in the organisation would also wake for a public repository's, which the runner group refuses to serve, so the pool would come up for work it can never take. Avoiding that needs each repository's visibility, and re-deriving the public-repository answer is the one thing AGENTS.md says not to do.
Two defects found reviewing the previous commit.

_rp_unwatched_repos was inserted between _rp_autoscale's section banner
and _rp_autoscale itself, so the comment explaining why only stopped
pools are polled read as documentation for the new function. Moved the
function above the banner.

tests/watch-list-staleness.sh exported RUNPOOL_BASE_DIR, which nothing
reads. The variable is RUNPOOL_BASE, so the base fell through to the
real installation while the test's own comment claimed every path
pointed into a scratch directory. Harmless today because the test only
calls a pure function, and precisely the claim someone extending it
would rely on.
@aicayzer
aicayzer merged commit 964f785 into main Aug 31, 2026
2 checks passed
@aicayzer
aicayzer deleted the fix/a-stale-watch-list-is-visible branch August 31, 2026 22:14
aicayzer added a commit that referenced this pull request Aug 31, 2026
The docs described only the empty watch list, which read as though a
non-empty one were fine. #52 added a second failure mode and the docs
were written against main before it merged.

Says what doctor does and does not do: it makes a stale list audible,
it does not maintain one. The list stays hand-maintained, so a
repository added to the organisation is still a change somebody makes
by hand.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An org pool's watch list can go stale, and nothing reports it

1 participant