Repository navigation
Description
Problem
Two security modules of devops-cli do the work of open tools that already run. No workflow uses them.
The code (lines at commit d0bc3dffa):
src/devops_cli/security/suppression.py(236 lines, about 28 tests). It holds a suppression policy with an expiry for scan findings. Only an optional--suppressoption reaches it (commands/scan.py:771-780,security/pipeline.py:33). CI passes no policy. The native ignore files with an expiry do this: the project already uses.trivyignore.yamlwithexpired_at.src/devops_cli/security/dependency_remediator.py(240 lines, about 53 tests).devops scan fixuses it (commands/scan.py:592-656,security/scan_plans.py:19). It wrapsuv lock --upgrade-packageandnpm update. Renovate already does this.
A third dead file is src/devops_cli/github/branch_protection.py (502 lines, 25 tests) with commands/gh.py:1845-1975. #5329 already asks to delete it, so this item leaves it to #5329.
Change
Delete the two modules, and use the open tools that already run.
- Trivy ignore files with
expired_at(Trivy, Apache-2.0, already used) replace the suppression policy. - Renovate (already used) opens the upgrade PRs that
devops scan fixplans.
Delete:
security/suppression.py, the--suppressoption of the scan commands, and the suppression parts ofsecurity/pipeline.py.security/dependency_remediator.py, the commanddevops scan fix, its plans insecurity/scan_plans.py, and its rows in the docs and the CLI reference.- The tests of both modules.
Existing tool considered
- Trivy
.trivyignore.yamlwithexpired_at. It covers an accepted finding with an expiry. Each other scanner has its own native ignore file. - Renovate. It covers the upgrade of a vulnerable dependency, and it opens the PR. It does not run on demand on a local tree.
Done when
suppression.py,dependency_remediator.py,devops scan fixand--suppressare gone fromsrc, the docs and the CLI reference.devops scan reportruns with no policy and gives the same findings as before.- The CI checks pass.
Source
Alternatives check of 2026-11-28: not-applicable.
Class: refactor, no model call.
Tool: none found.
Proposed design
Problem statement
devops-cli keeps a suppression policy and a dependency remediator that duplicate open tools. No workflow calls the suppression policy, and Renovate already opens dependency upgrades. The change deletes both modules and their command surface.
Acceptance criteria
Requirement: Suppression module removed
The devops_cli.security package SHALL not provide the suppression module.
Scenario: Suppression module import fails
- WHEN A test imports
devops_cli.security.suppressionwithimportlib.import_module. - THEN The import raises
ModuleNotFoundError.
Requirement: Suppress option removed
The devops scan commands SHALL reject the --suppress option.
Scenario: Suppress option is unknown
- WHEN A test invokes
devops scan report --suppress policy.yamlthrough the CLI runner. - THEN The CLI exits non-zero and reports that
--suppressis not a valid option.
Requirement: Dependency remediator module removed
The devops_cli.security package SHALL not provide the dependency_remediator module.
Scenario: Dependency remediator import fails
- WHEN A test imports
devops_cli.security.dependency_remediatorwithimportlib.import_module. - THEN The import raises
ModuleNotFoundError.
Requirement: Scan fix command removed
The devops scan group SHALL not provide the fix command.
Scenario: Scan fix command is absent
- WHEN A test invokes
devops scan fixthrough the CLI runner. - THEN The CLI exits non-zero and reports that the command does not exist.
Requirement: Scan report keeps findings without a policy
The devops scan report command SHALL report the same findings when no suppression policy exists.
Scenario: Report with no suppression policy
- WHEN A test imports
devops_cli.security.pipelineand runs the report path with a stub scanner that returns one finding and no policy file. - THEN The import succeeds and the report output contains that finding.
Requirement: Documentation drops removed scan features
The user documentation and the CLI reference SHALL not name devops scan fix or --suppress.
Scenario: Documentation scan finds no removed feature
- WHEN A test searches
README.md,docs/CLI_REFERENCE.mdand the files underdocs/outsidedocs/adr/fordevops scan fixand--suppress. - THEN The search returns no match.
Existing Tool Considered
The alternatives check in the issue body records not-applicable for this refactor and names no tool. The change deletes code and builds no replacement. The repository already uses Trivy .trivyignore.yaml with expired_at for accepted findings. It also uses Renovate for dependency upgrades, but Renovate does not run on demand on a local tree.
Key questions
- Does a Trivy ignore file with
expired_atcover an accepted scan finding with an expiry?: Yes. The repository already uses.trivyignore.yamlentries withexpired_at, and Trivy reads that file. The suppression policy is redundant. [sources: .trivyignore.yaml:6, src/devops_cli/security/trivy.py] - Does Renovate cover the dependency upgrades that
devops scan fixplans?: Yes. The repository uses Renovate for dependency updates and security fixes. Thedevops scan fixcommand duplicates that work and has no workflow caller. (best practice) [sources: AGENTS.md, CONTEXT.md]- Rejected: Keep
devops scan fix. It duplicates Renovate and has no workflow caller. - Chosen: Delete
devops scan fixand use Renovate. Renovate already opens dependency upgrade pull requests.
- Rejected: Keep
- Should
devops scan reportkeep its current finding output after the suppression policy is removed?: Yes. The report must keep each finding when no policy is loaded. The--suppressoption is optional, and CI passes no policy. (best practice) [sources: src/devops_cli/commands/scan.py:771-780, src/devops_cli/security/pipeline.py:33]- Rejected: Remove
devops scan reporttoo. The issue keeps the report command and requires the same findings. - Chosen: Keep
devops scan reportwith no policy. The report does not need the suppression policy to list findings.
- Rejected: Remove
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 28, 2026
Both replace a custom security ignore mechanism with a native tool config, but #6419 targets osv-scanner ignore files while this candidate targets Trivy suppression and Renovate upgrade planning.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.243.1: https://github.com/dan-petty/devops-cli/releases/tag/v0.243.1
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 03:13 UTC