Add dependency vulnerability scanning to CI#75
Conversation
Introduce a dedicated workflow that audits Python (pip-audit) and Node (npm audit) dependencies for known vulnerabilities. Runs on pushes and PRs to main, plus a weekly Monday schedule to catch newly disclosed CVEs.
There was a problem hiding this comment.
Pull request overview
Adds a dedicated GitHub Actions workflow to run dependency vulnerability audits for both the Python (uv-managed) and frontend Node.js dependency sets, intended to run on main/PRs and on a weekly schedule.
Changes:
- Introduces
.github/workflows/dependency-scan.ymlwith separate Python and Node audit jobs. - Python job runs
pip-auditafter installing dependencies viauv. - Node job runs
npm auditafternpm ciinfrontend/.
| schedule: | ||
| # Run weekly on Monday at 06:00 UTC | ||
| - cron: "0 6 * * 1" |
There was a problem hiding this comment.
This repository already has a scheduled dependency/security scanning workflow in .github/workflows/container-scan-trivy.yml (includes a dependency-scan job and a Monday cron). Adding a separate dependency-scan.yml will duplicate scheduled runs and can create conflicting/noisy CI signals. Consider folding pip-audit/npm-audit into the existing security workflow (or removing the older job) so there is a single source of truth for dependency scanning.
| schedule: | |
| # Run weekly on Monday at 06:00 UTC | |
| - cron: "0 6 * * 1" |
| - name: Install pip-audit | ||
| run: uv pip install pip-audit | ||
|
|
||
| - name: Run pip-audit | ||
| run: uv run pip-audit --strict --desc |
There was a problem hiding this comment.
uv sync --frozen suggests the environment should exactly match the lockfile, but the subsequent uv pip install pip-audit mutates the environment outside the lock. Prefer running pip-audit as an isolated tool (e.g., via uv tool run ...) or pin/lock pip-audit as a dependency group so the audit environment stays reproducible.
| - name: Install pip-audit | |
| run: uv pip install pip-audit | |
| - name: Run pip-audit | |
| run: uv run pip-audit --strict --desc | |
| - name: Run pip-audit | |
| run: uv tool run pip-audit --strict --desc |
| - name: Set up Node.js | ||
| uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: "22" |
There was a problem hiding this comment.
Node is set to 22 here, but other CI workflows in this repo use Node 18 (e.g. .github/workflows/docker-image.yml and codeql-analysis.yml). Using a newer major Node version just for npm ci/npm audit can cause inconsistent results or install failures if the lockfile/tooling was generated against Node 18. Consider aligning this to the same Node version used elsewhere (or centralizing the version via a single file/env var).
| node-version: "22" | |
| node-version: "18" |
|
Closing in favor of including this workflow in PR #79, which consolidates all pending changes. |
Rewrite ImageView.measurements.test.js to use URL-based fetch mocking instead of sequential mockResolvedValueOnce chains, and remove act() wrappers that caused hanging due to unresolved async effects. All 9 measurement tests now pass reliably. Add dependency-scan.yml workflow (from PR #75) for Python pip-audit and Node npm audit, running on push/PR to main and weekly cron schedule.
Rewrite ImageView.measurements.test.js to use URL-based fetch mocking instead of sequential mockResolvedValueOnce chains, and remove act() wrappers that caused hanging due to unresolved async effects. All 9 measurement tests now pass reliably. Add dependency-scan.yml workflow (from PR #75) for Python pip-audit and Node npm audit, running on push/PR to main and weekly cron schedule.
Rewrite ImageView.measurements.test.js to use URL-based fetch mocking instead of sequential mockResolvedValueOnce chains, and remove act() wrappers that caused hanging due to unresolved async effects. All 9 measurement tests now pass reliably. Add dependency-scan.yml workflow (from PR #75) for Python pip-audit and Node npm audit, running on push/PR to main and weekly cron schedule.
Summary
dependency-scan.yml) that audits both Python and Node dependencies for known vulnerabilitiespip-audit --strict --descagainst the uv-managed dependency setnpm audit --audit-level=highagainst frontend dependenciesTest plan