Repository navigation
fix: the watchers cannot open an issue in this repository - #152
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both watchers crashed on their first real run. Runs 32882266001 and 32882274257.
What happened
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 becauseGlyndor/.githubhas 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
ghsucceeded. 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
ghreports specifically that issues are disabled, the report goes to$GITHUB_STEP_SUMMARYand the run exits non-zero. The failure is the notification — GitHub notifies on a failed scheduled run on the default branch.Any other
ghfailure 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 1beside a comment promisingexit 0will otherwise fix the wrong one.Verified by running it, all three paths
$GITHUB_STEP_SUMMARYghfails with HTTP 401The 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 checkandruff format --checkclean.