Fail loudly when an identity filter has no GithubUsername - #197
Merged
Conversation
FilterWaitingOnMe compares every PR against config.GithubUsername. When that value is empty the comparisons are all against "", so the filter matches nothing, returns an empty list, and the section it feeds stays empty with nothing in the log to say why. FilterMyPRs and FilterMyReviewRequested fail the same way; FilterNotMyPRs inverts it and quietly matches *everything*, which is why a config with no username can look like it mostly works. RawWorkflow.GithubUsername made this easy to hit: config.parseConfig has always defaulted it from the root-level setting and the config writer round- trips it, but no filter ever read it. Setting GithubUsername inside a [[Workflows]] block instead of at the root therefore produced exactly one symptom — a single empty section. Identity filters now take their login as a parameter and workflows bind it at build time from the workflow's effective GithubUsername, so: - a per-workflow GithubUsername finally does what the config schema implies; - an unset one fails the workflow build with a message naming the filter, rather than silently matching nothing; - ValidateWorkflows reports the same problem, so the web config editor rejects it before the file is written. main now runs config.Validate + workflows.ValidateWorkflows at startup and logs every problem it finds. A hand-written config had never been validated before — the RPC path only checks configs it is about to write — so typos in Repos, filters, or PRState surfaced solely as sections that did not fill. Also adds cmd/debug_waiting_on_me, which prints the resolved username, the workflows using the filter, any config problems, per-repo fetch errors, and a row per open PR with its requested reviewers and the reason it did or didn't match. A repo the token cannot read is worth calling out on its own: the manager skips a workflow entirely for the whole cycle when any of its repos fails to fetch, which empties the section as items expire. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AbmVRyFX9qnTSoHkgodZBh
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.
Summary
Follow-up to #196, which fixed re-review requests being dropped but left a second way for the "Waiting on Me" section to come up empty:
FilterWaitingOnMecompares every PR againstconfig.GithubUsername, and when that value is empty every comparison is against"". The filter matches nothing, returns an empty list, and the section stays empty with nothing in the log to say why.FilterMyPRsandFilterMyReviewRequestedfail the same way.FilterNotMyPRsinverts it and quietly matches everything, which is why a config with no username can look like it mostly works while exactly one section goes dark.RawWorkflow.GithubUsernamemade this easy to hit.config.parseConfighas always defaulted it from the root-level setting and the config writer round-trips it, but no filter ever read it — so settingGithubUsernameinside a[[Workflows]]block rather than at the root produced precisely one symptom: a single empty section.Changes
FilterWaitingOnMe,FilterWaitingOnAuthor,FilterMyPRs,FilterNotMyPRs,FilterMyReviewRequested) take their login as a parameter; workflows bind it at build time from the workflow's effectiveGithubUsername. A per-workflow username now does what the config schema implies, and an unset one fails the workflow build with a message naming the filter instead of silently matching nothing.ValidateWorkflowsreports the same problem, so the config editor rejects it before writing the file.mainrunsconfig.Validate+workflows.ValidateWorkflowsat startup and logs every problem. A hand-written config had never been validated — the RPC path only checks configs it is about to write — so typos inRepos, filter names, orPRStatepreviously surfaced only as sections that didn't fill.FilterWaitingOnMelogscandidates/matchedcounts once per cycle.cmd/debug_waiting_on_me: prints the resolved username, the workflows using the filter, any config problems, per-repo fetch errors, and one row per open PR with its requested reviewers and the reason it did or didn't match.The per-repo fetch errors are worth calling out separately:
hasUnfetchedRequirementsskips a workflow for the entire cycle when any of its repos fails to fetch, so one inaccessible repo in the inherited globalReposlist empties that section as items expire while narrower workflows keep working.Test Plan
go build ./...passesgo test ./...passesBuildFiltersListrejects an identity filter with no username and accepts a per-workflow one;ValidateWorkflowsreports both the filter andListMyPRsWorkflowcases;explainin the debug command is table-tested against primed interaction state (no API calls).cmd/debug_waiting_on_meagainst a scratch config reproducing the reported setup — withGithubUsernameunset it names the problem and exits; with it set it resolves the workflow and repo list. Live per-PR output needs aCRS_GITHUB_TOKEN, which this environment doesn't have.Generated by Claude Code