Repository navigation
feat: leave alerts in archived repositories out of the security alerts report - #37
Merged
Merged
Conversation
…s report Alerts don't say whether their repository is archived, so when a run finds alerts, the client lists the org's repositories once and drops the alerts of archived ones, counting them; the Slack report notes how many it left out. APP_SECURITY_ALERTS_INCLUDE_ARCHIVED_REPOS=true keeps them. If the repositories can't be listed, every alert is kept and the error is reported, so a failed lookup never hides an alert. ListSecurityAlerts now takes a domain.SecurityAlertsQuery. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
The security alerts report now leaves out alerts in archived repositories by default. Nobody can fix those alerts without unarchiving the repo, so they were noise in every report.
GitHub's org-level alert listings don't say whether an alert's repository is archived. So when a run finds alerts, the client lists the org's repositories once (one request per 100 repos) and drops the alerts of archived ones. Runs without alerts skip the lookup, and names are compared case-insensitively.
APP_SECURITY_ALERTS_INCLUDE_ARCHIVED_REPOS=truekeeps them.archived_alerts, and the Slack footer says "N more in archived repositories not shown" when there are any.ListSecurityAlertsnow takes adomain.SecurityAlertsQueryinstead of separate arguments.After upgrading, the first report leaves the archived repos' alerts out. With
APP_REPORT_REPEAT=dailythat counts as a change, so it posts once right away.Testing:
make checkpasses (lint, unit and e2e tests, govulncheck,go mod tidy). New client tests cover the filtering, case differences, a two-page repository listing, the opt-out, the failed lookup, and skipping the lookup without alerts. The e2e scenario now has an alert in an archived repo that gets dropped. Not yet run against a real org.cruxstack/terraform-aws-github-ops-app will follow with the matching input and a default of v1.3.0.
🤖 Generated with Claude Code