Skip to content

perf(ci): the Static Analysis job runs Bandit once - #2305

Merged
dan-petty merged 1 commit into
mainfrom
perf/1746-static-job-runs-bandit-once
Oct 26, 2026
Merged

dan-petty merged 1 commit into
mainfrom
perf/1746-static-job-runs-bandit-once

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Summary

The Static Analysis CI job runs Bandit twice on every push: once during uv run devops ci --check (via the security check row) and once during uv run devops scan report --sarif .data/scan.sarif. Bandit AST scan takes ~42 seconds across src/ and tests/.

This change adds --skip (and alias --skip-scanner) support to devops scan report so users and workflows can skip specific registered security scanners. It updates .github/workflows/ci.yml to pass --skip bandit to devops scan report, stopping the redundant second Bandit scan in the Static Analysis job.

Feasibility

  • The static job in .github/workflows/ci.yml runs both uv run devops ci and uv run devops scan report.
  • devops ci checks the security row, which executes Bandit.
  • Adding --skip to devops scan report matches devops ci --skip and allows skipping Bandit in the report step.

Verification

The workflow contract and scanner unit tests verify the behavior:

  • tests/test_workflow_contracts.py::test_the_static_job_starts_bandit_once
  • tests/test_scan_outcomes_and_gating.py::test_scan_report_skips_named_scanners

Fail-to-pass check output:

$ uv run devops ci fail-to-pass --base origin/main
5 failed on base (5 failed and 163 passed in tests/test_ci.py, tests/test_scan_outcomes_and_gating.py, tests/test_workflow_contracts.py; 0 errored).

Closes #1746

Skip Bandit in the Security Scan step because the CI gate security row already runs it.
Add --skip and --skip-scanner support to devops scan report.
Add workflow contract and unit tests.
Archive OpenSpec change 1746-static-job-runs-bandit-once.

Closes #1746
@dan-petty
dan-petty marked this pull request as ready for review October 26, 2026 16:01
@dan-petty
dan-petty merged commit 9cca449 into main Oct 26, 2026
16 checks passed
@dan-petty
dan-petty deleted the perf/1746-static-job-runs-bandit-once branch October 26, 2026 16:02
dan-petty pushed a commit that referenced this pull request Oct 26, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.6.4](v0.6.3...v0.6.4)
(2026-10-26)


### Bug Fixes

* **devcontainer:** report a developer tool's failed installer download
as a failure
([#2304](#2304))
([6ca95c1](6ca95c1))
* **k8s:** network policy peers name only namespaces that exist
([#1656](#1656))
([#2302](#2302))
([c77b6e3](c77b6e3))
* **k8s:** skip post-Helm deletes whose CRD is not installed
([#2307](#2307))
([fe01b30](fe01b30)),
closes [#1818](#1818)
* **k8s:** warn on kubectl and kubelet version skew in doctor and
deploy-stack
([#2306](#2306))
([001a7af](001a7af)),
closes [#1640](#1640)
* **review:** do not cache rejected review plan replies
([#1810](#1810))
([#2308](#2308))
([aece067](aece067))


### Performance Improvements

* **ci:** the Static Analysis job runs Bandit once
([#2305](#2305))
([9cca449](9cca449)),
closes [#1746](#1746)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(ci): the Static Analysis job runs Bandit once

1 participant