Allow ignoring PRs with specific labels from review#245
Merged
Conversation
Add `ignoreReviewLabels` config option that filters PRs bearing any of the listed labels from the review board, badge counts, and notifications. Fetches labels via the GitHub GraphQL query and applies case-insensitive matching alongside the existing repo-exclude filter. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dhilgaertner
approved these changes
May 6, 2026
Contributor
dhilgaertner
left a comment
There was a problem hiding this comment.
Code & Security Review
Security Review
Strengths:
- No new attack surface. The GraphQL change just adds
labels(first: 20) { nodes { name } }to an existing hardcoded query — values flow throughgh api graphql -Fparameters, not string interpolation, so no injection vector. - Label parsing in
IssueTracker.swift:1106-1107is type-safe (compactMap { $0["name"] as? String }) with a sensible empty-array fallback. - All filtering is local; the user-configured label list is never sent to a remote system.
Concerns:
- None.
Code Quality
Strengths:
- Backwards-compatible config decoding — missing
ignoreReviewLabelskey falls back to[], covered byignoreReviewLabelsDefaultsEmptyWhenKeyMissingtest (AppConfigTests.swift:261-265). - Filter pattern mirrors the existing
excludeReviewReposflow exactly: applied inIssueTracker.swift:307-313before storing intoappState.reviewRequests, and again inAppState.filteredReviewRequestsfor defense in depth. Consistency is good. - Notification dedup correctness preserved:
previousReviewRequestIDs = allCurrentIDsis set from the unfiltered ID set, so a PR transitioning between hidden/visible (label added or removed) doesn't spuriously fire as a "new review request" toast (IssueTracker.swift:302,316). - Case-insensitive label match aligns with the repo-pattern matching convention.
- 17 lines of new tests including round-trip and missing-key cases.
Considerations (non-blocking):
labels(first: 20)inIssueTracker.swift:572— a PR with more than 20 labels would silently truncate beyond the cap; if a configured ignore-label is the 21st on a noisy PR it won't be filtered. Almost certainly fine in practice; just worth being aware of.- Labels are now fetched on every review-PR refresh even when
ignoreReviewLabelsis empty — payload-size cost is trivial, but notable. - The settings
TextFieldis initialized fromdefaults.wrappedValue.ignoreReviewLabelsonce at init time (AutomationSettingsView.swift:31); external mutations to defaults won't update the visible text. This matches the pre-existing pattern forexcludeReviewReposText, so not a regression. ReviewRequest.labelsis only populated on the GitHub path (IssueTracker.swift:1109-1122); there's no GitLab MR equivalent, but GitLab review requests aren't currently surfaced throughreviewRequestsanyway, so nothing breaks.
Build & Tests
swift buildagainstPackages/CrowCoresucceeds clean.swift testpasses all 143 tests in 5 suites (including the 2 new ones).- The umbrella
swift buildfrom repo root fails on a missingFrameworks/GhosttyKit.xcframeworkbinary artifact — unrelated to this PR's changes.
Summary Table
| Priority | Issue |
|---|---|
| 🟢 | Consider surfacing why a PR is hidden in the review board UI (e.g., a "filtered by label" affordance), so users don't wonder where their PRs went. |
| 🟢 | Consider widening labels(first: 20) or paginating if any tracked repos use heavy label taxonomies. |
Recommendation: Approve. Tightly scoped, follows existing patterns, backwards-compatible, well tested. No security or correctness concerns.
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.
Closes #244
Summary
ignoreReviewLabelsconfiguration option (comma-separated label names) to filter PRs from the review boardlabels(first: 20) { nodes { name } })Test plan
ignoreReviewLabels: ["dependencies"]and verify matching PRs are filtered from the review board🤖 Generated with Claude Code