Skip to content

fix: the watchers cannot open an issue in this repository - #152

Merged
Jaro-c merged 1 commit into
mainfrom
fix/watchers-cannot-open-issues-here
Aug 25, 2026
Merged

Jaro-c merged 1 commit into
mainfrom
fix/watchers-cannot-open-issues-here

Conversation

@Jaro-c

@Jaro-c Jaro-c commented Aug 25, 2026

Copy link
Copy Markdown
Member

Both watchers crashed on their first real run. Runs 32882266001 and 32882274257.

What happened

the 'Glyndor/.github' repository has disabled issues
subprocess.CalledProcessError: Command '['gh', 'issue', 'list', ...]' returned non-zero exit status 1

This repository has issues disabled, and both watchers report by opening one. The same code in podup worked and opened podup#1563, so the logic was right and only the channel was unavailable here. The findings were real and were lost with the traceback.

This was avoidable, and how it got past me

Glyndor/apt#121 — the issue this work came from — opens with the sentence "Filed here because Glyndor/.github has issues disabled". I read it and built two watchers whose only reporting channel is impossible in that repository.

It survived local verification because my stub gh succeeded. The stub modelled the world I assumed rather than the one that exists. Same shape as testing a heredoc outside the YAML that processes it: the harness was wrong, and it answered confidently.

The fix

When gh reports specifically that issues are disabled, the report goes to $GITHUB_STEP_SUMMARY and the run exits non-zero. The failure is the notification — GitHub notifies on a failed scheduled run on the default branch.

Any other gh failure still fails loudly and does not take that path. An expired token and a deliberately closed issue tracker are different problems; collapsing them would hide a real break behind a benign-looking message.

Why exiting non-zero does not contradict the never-fail rule

tooling-audit's docstring says an advisory must not fail the run. That rule exists so a third party's disclosure timing cannot block pull requests — and these workflows run on no pull request. They are scheduled only, so failing one blocks nothing. A silent success would read as "nothing found", which is the worst outcome when the report cannot be delivered.

The docstring now states this. A reader who finds an exit 1 beside a comment promising exit 0 will otherwise fix the wrong one.

Verified by running it, all three paths

case exit $GITHUB_STEP_SUMMARY
findings, issues disabled 1 872 bytes for pin-watch, 2369 and 16 table rows for tooling-audit
findings, gh fails with HTTP 401 1 0 bytes — the fallback correctly did not run
no findings, issues disabled 0 empty

The middle row is the one that matters: it is what stops an expired token being reported as a closed issue tracker.

22 tests pass with --network=none. ruff check and ruff format --check clean.

Both watchers report by opening an issue. This repository has issues
disabled, so both crashed with a traceback on their first real run:

    the 'Glyndor/.github' repository has disabled issues
    subprocess.CalledProcessError: ... 'gh', 'issue', 'list' ... exit status 1

The same code in podup worked and opened podup#1563, so the logic was right
and only the channel was unavailable here. The findings were real and were
lost.

This was avoidable. `Glyndor/apt#121` opens with "Filed here because
Glyndor/.github has issues disabled" — the fact was in the issue the work came
from. It survived local runs because the stub `gh` modelled the world I assumed
rather than the one that exists, which is the same failure as testing a heredoc
outside the YAML that processes it.

When `gh` reports specifically that issues are disabled, the report now goes to
`$GITHUB_STEP_SUMMARY` and the run exits non-zero, so the failure is the
notification — GitHub notifies on a failed scheduled run on the default branch.
Any other `gh` failure still fails loudly and does NOT take that path: an
expired token and a closed issue tracker are different problems, and collapsing
them would hide a real break behind a benign-looking message.

Exiting non-zero here does not contradict tooling-audit's never-fail rule, and
the docstring now says why rather than leaving a reader to reconcile an exit 1
with a comment promising exit 0. That rule exists so a third party's disclosure
timing cannot block pull requests; these workflows are scheduled only and run
on no pull request, so failing one blocks nothing. A silent success would read
as "nothing found", which is the worst outcome when the report cannot be
delivered.

Three tests per script, all offline: the fallback writes the summary and fails,
an auth error fails WITHOUT writing the summary, and no findings with issues
disabled still exits 0. Verified by running both scripts against a stub that
reproduces each case.

Signed-off-by: Jaro-c <75870284+Jaro-c@users.noreply.github.com>
@Jaro-c
Jaro-c merged commit 4ff9d49 into main Aug 25, 2026
9 checks passed
@Jaro-c
Jaro-c deleted the fix/watchers-cannot-open-issues-here branch August 25, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant