Skip to content

ci(python): fail the lint workflow on fixable vulnerabilities - #3807

Merged
mcosgriff merged 3 commits into
mainfrom
use-uv-audit-in-ci
Sep 8, 2026
Merged

ci(python): fail the lint workflow on fixable vulnerabilities#3807
mcosgriff merged 3 commits into
mainfrom
use-uv-audit-in-ci

Conversation

@mcosgriff

@mcosgriff mcosgriff commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Run uv audit after uv sync --frozen in the ruff job and filter the JSON report to advisories that have a fix_versions entry, so the build only breaks on vulnerabilities that can actually be resolved by bumping a dependency.

Audit exit code 1 means vulnerabilities were found and is handled; anything higher is a network or configuration failure and is propagated unchanged rather than being reported as a clean audit.

What changed

Making use of uv audit to check our python dependencies against fixed CVEs

Why it changed

Testing out the ability to check the python dependencies for fixable CVEs

uv audit workflow for enterprise in https://github.com/OpenC3/cosmos-enterprise/pull/716

Run uv audit after uv sync --frozen in the ruff job and filter the
JSON report to advisories that have a fix_versions entry, so the build
only breaks on vulnerabilities that can actually be resolved by bumping
a dependency.

Audit exit code 1 means vulnerabilities were found and is handled;
anything higher is a network or configuration failure and is propagated
unchanged rather than being reported as a clean audit.

Co-Authored-By: Claude Opus 5 (1M conte
@mcosgriff mcosgriff self-assigned this Sep 1, 2026
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.19%. Comparing base (40f6fd7) to head (c2587b0).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3807      +/-   ##
==========================================
- Coverage   79.20%   79.19%   -0.02%     
==========================================
  Files         894      894              
  Lines       67034    67034              
  Branches     2553     2601      +48     
==========================================
- Hits        53095    53086       -9     
- Misses      13278    13287       +9     
  Partials      661      661              
Flag Coverage Δ
frontend 66.04% <ø> (-0.09%) ⬇️
python 79.32% <ø> (-0.01%) ⬇️
ruby-api 82.18% <ø> (+0.04%) ⬆️
ruby-backend 84.51% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Add .github/workflows/python_lint.yml to the pull_request paths
filter so edits to the workflow are exercised by the PR that makes them,
instead of only running once a Python file happens to change.

Co-Authored-By: Claude Opus 5 (1M context)
- Switch uv audit to --output-format sarif and upload the report to
  code scanning and as an artifact, matching how ty is published; uv
  emits SARIF natively so no converter is needed
- Publish every advisory, including ones with no fix yet, and gate only
  on results carrying uv/fixVersions, replacing the jq rewrite that
  dropped unfixable findings before they were reported
- Move the gate after the ruff steps so a vulnerable dependency no
  longer skips lint results in the same run
- Grant the ruff job security-events: write, which the code scanning
  upload requires and the workflow-level contents: read did not give

Co-Authored-By: Claude Opus 5 (1M context)
@github-advanced-security

Copy link
Copy Markdown
Contributor

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@sonarqubecloud

sonarqubecloud Bot commented Sep 2, 2026

Copy link
Copy Markdown

@mcosgriff
mcosgriff marked this pull request as ready for review September 2, 2026 21:10
@mcosgriff
mcosgriff merged commit 4232f06 into main Sep 8, 2026
40 of 41 checks passed
@mcosgriff
mcosgriff deleted the use-uv-audit-in-ci branch September 8, 2026 19:09
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.

4 participants