Skip to content

fix(github-backup): drainer owner allowlist (#3326) - #3328

Merged
dezren39 merged 1 commit into
mainfrom
fix/3326-drainer-owner-allowlist
Nov 1, 2026
Merged

dezren39 merged 1 commit into
mainfrom
fix/3326-drainer-owner-allowlist

Conversation

@dezren39

@dezren39 dezren39 commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Closes the foreign-install hole opened by making the backup App public: anyone can install developing-today-backup on their own repos, and their deliveries verify and queue.

Change (infra/github-backup/bin/drain_queue.py): before any fetch work, each queued event's owner is checked against config.json owners — the same set reconcile plans from — case-insensitively. Owner determination: repository.owner.login → repo full_name owner segment → installation.account.login fallback. Foreign or owner-less (malformed) events are dropped: acked as handled-by-policy (never retried, never counted toward the #3219 DRAIN-CHRONIC streak), one loud log line each (DRAIN-DROP foreign owner=<login> repo=<full_name> delivery=<id>), counted as dropped_foreign in the run summary. Fails closed if config has no owners. Allowed-owner behavior and #3219/#3229 ack semantics unchanged.

Tests: tests/test_drain_queue.py 54/54 (22 new). Repro first: the new foreign-owner case run against the pre-fix drainer reached fetch (the hole); with this change it is dropped before any fetch. Sibling suites still green (18/18, 9/9).

Deploy: merge → pull on laptop primary → just github-backup-units → drain run + hand-injected foreign-event proof (results on #3326).

Closes #3326. Refs #3215.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

…ents at the door (#3326)

The backup App is public (org installs require it), so anyone can
install it; their deliveries verify against the App secret and queue.
The drainer now checks each event's owner against config.json owners
(repository.owner.login, then the repo full_name owner segment, then
installation.account.login; case-insensitive) before any fetch work.

Foreign or owner-less events are dropped: acked as handled-by-policy
(never retried, never counted toward the #3219 DRAIN-CHRONIC streak),
logged as one DRAIN-DROP line per event, counted in the run summary.
Fails closed when config carries no owners. Allowed-owner behavior,
including #3219/#3229 ack semantics, is unchanged.

Tests: 54/54 in test_drain_queue.py (22 new: foreign dropped even when
planned, malformed dropped, repository-over-installation precedence,
installation fallback, drop never feeds the chronic streak). The new
foreign case was run against the pre-fix drainer first: it reached
fetch — the hole — and is closed by this change.
@dezren39
dezren39 requested a review from a team as a code owner November 1, 2026 04:12
@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 11 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a1acd911-5c9c-4640-9594-0ca4159765d3
Commits

Reviewing files that changed from the base of the PR and between 6e7f8fc and cc35ae4.

Files selected for processing: 2
  • infra/github-backup/bin/drain_queue.py
  • infra/github-backup/tests/test_drain_queue.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T04:13:01.683227Z cc35ae4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 merged commit 72e3476 into main Nov 1, 2026
1 check passed
@dezren39
dezren39 deleted the fix/3326-drainer-owner-allowlist branch November 1, 2026 04:12
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.

github-backup: drainer needs an owner allowlist — public App admits foreign installs

1 participant