Skip to content

feat(digest): survey Dependabot security alerts in the daily digest - #220

Merged
twistedmelonman merged 1 commit into
mainfrom
claude/feat-digest-dependabot-alerts
Oct 22, 2026
Merged

twistedmelonman merged 1 commit into
mainfrom
claude/feat-digest-dependabot-alerts

Conversation

@twistedmelonman

Copy link
Copy Markdown
Member

What

The daily digest now reports, per repo, whether Dependabot security alerts are on. A new "Dependabot alerts" section follows CodeQL and uses the same layout: a count line, a table of gaps and unreadable repos, "No gaps" only when there are none, and an explicit message when every read failed.

On 2026-10-21, alerts turned out to be off on 8 repos (7 NOS repos plus smartwatermelon/vpn-lan-bridge), and nothing flagged it.

How each state is decided

GET repos/{owner}/{repo}/vulnerability-alerts, per non-archived repo:

Response State
exit 0, empty body (204) on
HTTP 404 and the body message is exactly Vulnerability alerts are disabled. off, listed as a gap
anything else: 403, a bare Not Found 404, the disabled message on a non-404, a body on success unreadable, listed with the reason

A bare 404 is how GitHub hides a resource the token cannot see, so it never counts as off. Unreadable never counts as on or off. If every read fails, the section says nothing was verified and names Administration: Read as the likely cause.

There is no exempt class. Off is a gap on every repo, forks included.

Credentials: no App change needed

On both the 204 and the 404 responses, the endpoint returns X-Accepted-GitHub-Permissions: administration=read (captured 2026-10-21). The dependabot-digest-swm App already holds Administration: read for the CodeQL section, and the workflow already asks for it. The workflow comments and the credentials runbook now say that this grant serves both sections, so nobody prunes it thinking only CodeQL uses it.

What is not verified: the exact response an App token without Administration would get. I could not mint such a token. The test fixture for that case copies the CodeQL section's Resource not accessible by integration 403. Whatever that response turns out to be, the probe reports it as unreadable, because only the exact disabled-message 404 counts as off.

Decision for Andrew

A live survey with a user token on 2026-10-21 found one repo still off: twistedmelonman/Instapaper-MCP, a fork. The protection and CodeQL sections exempt forks by recorded decision. No such decision exists for alerts, so this PR flags the fork. Turn alerts on there, or record a fork exemption, and the row goes away.

Tests

test-standards.sh covers on (204, public and private), off (fork and non-fork), and unreadable. The unreadable cases include known-bad shapes: a bare Not Found 404, a 403 that carries the disabled message, an integration 403, and a body returned on success. A mutation check that treats every 404 as off makes the suite fail. Render tests cover the all-unreadable, all-on, missing-field and malformed cases.

Two test fixes were needed:

  • The stub now prints a 404 body's message to stderr, as real gh does.
  • Section slices now end at the next section instead of at ---. CodeQL is no longer the last section, and macOS sed does not support \| alternation.

On 2026-10-21 alerts were off on 8 repos and nothing flagged it. The
survey now reads GET repos/{o}/{r}/vulnerability-alerts per repo and
renders a "Dependabot alerts" section after CodeQL.

- 204 is on. A 404 whose body message is exactly "Vulnerability alerts
  are disabled." is off, and off is always a gap: no class is exempt.
- Everything else is unreadable with its reason: a 403, a bare
  "Not Found" 404 (how GitHub hides what a token cannot see), the
  disabled message on a non-404, or a body on success.
- An all-unreadable survey says nothing was verified and names
  Administration: Read, as the CodeQL section does.

The endpoint needs administration=read (response header, both 204 and
404). The App already holds it for CodeQL, so no grant changes. The
workflow comments and runbook now say the grant serves both.

Tests: on, off and unreadable cases, including known-bad 404 and 403
shapes. The stub now echoes a 404 body's message as real gh does, and
section slices end at the next section instead of at "---".
@twistedmelonman
twistedmelonman merged commit f93032c into main Oct 22, 2026
5 checks passed
@twistedmelonman
twistedmelonman deleted the claude/feat-digest-dependabot-alerts branch October 22, 2026 04:46
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.

1 participant