Repository navigation
Description
Problem
devops-cli copies each Trivy-config code scanning alert into an issue.
src/devops_cli/security/alert_filer.py(207 lines, 10 tests) and the workflow.github/workflows/trivy-config-alerts.ymlfile one issue for each rule and file.- It finds duplicates only by the titles of open issues (
:132-136and:163-170, lines at commitd0bc3dffa). SECURITY.md:125describes this workflow.
Breakage in 30 days:
- 85 "Judge ..." triage issues were filed, and 40 of them were closed as not planned.
- 12 of them have the title of this filer. Agents filed the rest by the same pattern.
- Each alert then has two trackers, the alert and the issue, and they drift apart.
Change
Use the code scanning alert itself as the tracker.
- Standard: GitHub code scanning alerts (https://docs.github.com/en/code-security/code-scanning). Each alert has a state, a rule, a file and a history. The Trivy SARIF upload already makes them.
- To accept a finding, dismiss the alert with a reason and a comment through the REST API:
PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}withstate,dismissed_reasonanddismissed_comment. - To accept a finding for a limited time, add a dated entry to
.trivyignore.yamlwithexpired_at. The project already does this. - To fix a finding, change the file. The alert closes on the next scan.
Delete:
alert_filer.py, its 10 tests andtrivy-config-alerts.yml.- The text in
SECURITY.mdthat describes the filer. It describes the alert flow instead.
The open "Judge" issues that copy an alert close as not planned, each with a link to its alert. The alert stays the tracker.
Existing tool considered
- GitHub code scanning with the Trivy SARIF upload (already used). It covers the list, the state, the dismissal with a reason and the history of each alert. It gives no priority label and no roadmap item. A person or an agent reads the open alerts instead.
- Trivy
.trivyignore.yamlwithexpired_at(already used). It covers an acceptance for a limited time.
Done when
alert_filer.py, its tests andtrivy-config-alerts.ymlare deleted.- No workflow or job files an issue for a code scanning alert.
SECURITY.mdtells how to fix, dismiss or ignore an alert, with the REST call.- The open "Judge Trivy-config" issues are closed, each with a link to its alert.
Source
Alternatives check of 2026-11-28: not-applicable.
Class: refactor, no model call.
Tool: none found.
Proposed design
Problem statement
Delete the Trivy-config alert filer and use the code scanning alert as the tracker. devops-cli files one issue for each alert group, so each alert has two trackers that drift apart. In 30 days, agents filed 85 Judge issues, and 40 closed as not planned. The change deletes the filer, its tests and its workflow, and it updates SECURITY.md.
Acceptance criteria
Requirement: Alert filer module removed
The security package SHALL no longer hold the Trivy-config alert filer module.
Scenario: The filer module is absent
- WHEN a test asks
importlib.util.find_specfordevops_cli.security.alert_filer - THEN the call returns
None
Requirement: Alert filer tests removed
The security test suite SHALL no longer hold a test of the alert filer.
Scenario: The filer tests are absent
- WHEN
uv run pytest tests/security --collect-only -qruns - THEN the output holds no test from the alert filer test module
Requirement: Scan alerts command removed
The CLI SHALL no longer run the scan alerts command that files an issue for a code scanning alert.
Scenario: The removed command is invoked
- WHEN a test invokes the CLI with
scan alerts --repo example/repo - THEN the CLI exits non-zero and prints an unknown-command message
Requirement: Alert workflow removed
The repository SHALL hold no workflow that files an issue for a code scanning alert.
Scenario: The workflow checks run
- WHEN
uv run devops ci --check --only actionlint,zizmorruns - THEN the check passes and reports no finding for
trivy-config-alerts.yml
Requirement: Security guide describes the alert flow
SECURITY.md SHALL tell how to fix, dismiss or ignore a Trivy-config alert and give the REST call.
Scenario: The security guide is read
- WHEN a test reads
SECURITY.md - THEN the text names
PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}and holds notrivy-config-alerts.yml
Requirement: Pending a person after the merge
Each open issue titled fix(security): judge Trivy-config ... SHALL close as not planned with a link to its alert after the merge.
Scenario: The cleanup runs after the merge
- WHEN
uv run devops gh issue list --search 'in:title "judge Trivy-config"' --state openruns - THEN the command lists no open issue
Existing Tool Considered
Use GitHub code scanning alerts; the alternatives check of 2026-11-28 records not-applicable for this refactor, with no model call and no tool (see the issue body). The Trivy SARIF upload already creates the alerts. Each alert holds its state, rule, file and history. The alert gives no priority label and no roadmap item, so a person or an agent reads the open alerts. .trivyignore.yaml with expired_at covers a time-limited acceptance. The change builds no new code. It deletes code.
Key questions
- Which tracker holds a Trivy-config finding after the filer is removed?: The GitHub code scanning alert. It holds the state, the rule, the file and the history, and the Trivy SARIF upload already creates it. (best practice) [sources: src/devops_cli/security/alert_filer.py]
- Chosen: GitHub code scanning alert. The Trivy SARIF upload already creates it, and it holds the state, rule, file and history.
- Rejected: Keep the issue filer. It makes a second tracker that drifts from the alert.
- Rejected: A new database. It builds and keeps code that the alert already gives.
- How does a person accept a finding?: Dismiss the alert through the REST API with
state,dismissed_reasonanddismissed_commentatPATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}. (best practice) [sources: SECURITY.md]- Chosen: Dismiss the alert through the REST API. The alert holds the state, the reason and the comment.
- Rejected: Close an issue. The issue is no longer the tracker.
- Rejected: Edit
.trivyignore.yaml. It gives only a time-limited acceptance.
- How does a person accept a finding for a limited time?: Add a dated entry to
.trivyignore.yamlwithexpired_at. The project already reads that field. (best practice) [sources: .trivyignore.yaml, src/devops_cli/security/trivy.py, tests/security/test_trivy_config_ignore.py]- Chosen: Add a dated
.trivyignore.yamlentry. The project already readsexpired_atfrom it. - Rejected: Dismiss the alert with a comment. The dismissal has no expiry.
- Rejected: Add a new suppression file. It duplicates the existing file.
- Chosen: Add a dated
- Which code and workflow go with the filer?: Delete
alert_filer.py, its tests and.github/workflows/trivy-config-alerts.yml. The workflow is the caller ofdevops scan alerts, so the command goes too. (best practice) [sources: .github/workflows/trivy-config-alerts.yml, src/devops_cli/security/alert_filer.py]- Chosen: Delete the filer, its tests, the workflow and the command. The workflow is the caller of
devops scan alerts, so the command has no caller. - Rejected: Keep the command. It files no issue and has no caller.
- Chosen: Delete the filer, its tests, the workflow and the command. The workflow is the caller of
- What happens to the open Judge Trivy-config issues?: Close each as not planned with a link to its alert. The alert stays the tracker. (best practice) [sources: src/devops_cli/security/alert_filer.py, SECURITY.md]
- Chosen: Close each as not planned with a link to its alert. The alert stays the tracker, and the issue stops a second tracker.
- Rejected: Leave them open. They keep a second tracker that drifts from the alert.
- Rejected: Convert them to discussions. A discussion is no tracker for a finding.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 28, 2026
Both manage Trivy-config code scanning alerts, but #4409 asks to judge 52 specific alerts while the candidate removes the filer mechanism and workflow entirely.devops-cli-service commentedon Nov 28, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
devops-cli-service commentedon Nov 29, 2026
Released in v0.244.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.244.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 05:10 UTC