ci: move dependency audit off the critical path, enable OSV alerts #161

Merged
ullrich merged 2 commits from ci/dependency-audit into main 2026-09-23 09:23:10 +00:00
Owner

Two related changes to what CI spends time on.

1. Move the dependency audit off the critical path

pnpm audit resolves the whole workspace graph and cross-references the
advisory database locally. On this monorepo that pegs a core for ~15 minutes.

Measured on task 3592: 894s of the job's 979s — 91% of Checks — while
checkout, install, typecheck, lint, unit tests, build and openspec together
took ~85s.

Because e2e has needs: checks, that delay hit the E2E suite too. And the
step was continue-on-error: true, so none of it gated anything.

Measured directly today: with the audit killed mid-run, Checks finished in
317s instead of 1667s.

Advisories change when the advisory database changes, not when someone edits a
file, so it now runs daily at 06:30 UTC (offset from disk-maintenance's 04:30
and staging-cleanup's Monday 04:00), plus workflow_dispatch.

Deliberate change: the scheduled run is allowed to FAIL, matching the
reasoning already in disk-maintenance.yml — a scheduled-run failure is the
notification. A permanently-green nightly writing advisories into a summary
nobody opens would be worse than what it replaced.

2. Enable OSV vulnerability alerts in Renovate

renovate.json5 already said this was the missing piece:

The cost: if a future advisory can only be satisfied by crossing a minor or
major (say undici 7 goes EOL), Renovate will not raise it and it has to be
done by hand. That is the right trade while osvVulnerabilityAlerts is
unconfigured
, because nothing here is advisory-driven today.

This is that configuration. Renovate fixes advisories by opening a PR, rather
than reporting them. OSV.dev rather than the GitHub advisory API, which
Renovate cannot use on Forgejo.

vulnerabilityAlerts overrides two globals for security PRs only:

  • schedule — the global window is Monday mornings, so an advisory landing
    Tuesday would wait six days
  • minimumReleaseAge — the 3-day soak catches a compromised release, but an
    unpatched advisory is exploited during it. This is a genuine trade against
    deliberate reasoning; reverse it if you weigh those risks differently.

Deliberately NOT set: labels (Renovate can attach but not create them on
Forgejo, so an unknown label is dropped silently) and automerge (these cross
the version lines pnpm.overrides freezes on purpose — see #44/#35).

Unverified: whether vulnerabilityAlerts takes precedence over the
packageRules entry disabling major/minor for pnpm.overrides. That is the
exact gap this is meant to close, so it needs one Renovate cycle to confirm.
If it does not take precedence, part 2 is cosmetic and needs another approach.


Part 1 is safe to merge on its own. Part 2 is the one that wants a cycle of
observation.

Two related changes to what CI spends time on. ### 1. Move the dependency audit off the critical path `pnpm audit` resolves the whole workspace graph and cross-references the advisory database locally. On this monorepo that pegs a core for ~15 minutes. Measured on task 3592: **894s of the job's 979s — 91% of `Checks`** — while checkout, install, typecheck, lint, unit tests, build and openspec together took ~85s. Because `e2e` has `needs: checks`, that delay hit the E2E suite too. And the step was `continue-on-error: true`, so none of it gated anything. Measured directly today: with the audit killed mid-run, `Checks` finished in **317s instead of 1667s**. Advisories change when the advisory database changes, not when someone edits a file, so it now runs daily at 06:30 UTC (offset from `disk-maintenance`'s 04:30 and `staging-cleanup`'s Monday 04:00), plus `workflow_dispatch`. **Deliberate change:** the scheduled run is allowed to FAIL, matching the reasoning already in `disk-maintenance.yml` — a scheduled-run failure is the notification. A permanently-green nightly writing advisories into a summary nobody opens would be worse than what it replaced. ### 2. Enable OSV vulnerability alerts in Renovate `renovate.json5` already said this was the missing piece: > The cost: if a future advisory can only be satisfied by crossing a minor or > major (say undici 7 goes EOL), Renovate will not raise it and it has to be > done by hand. That is the right trade **while `osvVulnerabilityAlerts` is > unconfigured**, because nothing here is advisory-driven today. This is that configuration. Renovate *fixes* advisories by opening a PR, rather than reporting them. OSV.dev rather than the GitHub advisory API, which Renovate cannot use on Forgejo. `vulnerabilityAlerts` overrides two globals for security PRs only: - **`schedule`** — the global window is Monday mornings, so an advisory landing Tuesday would wait six days - **`minimumReleaseAge`** — the 3-day soak catches a compromised release, but an unpatched advisory is exploited during it. This is a genuine trade against deliberate reasoning; reverse it if you weigh those risks differently. Deliberately NOT set: `labels` (Renovate can attach but not create them on Forgejo, so an unknown label is dropped silently) and `automerge` (these cross the version lines `pnpm.overrides` freezes on purpose — see #44/#35). **Unverified:** whether `vulnerabilityAlerts` takes precedence over the `packageRules` entry disabling major/minor for `pnpm.overrides`. That is the exact gap this is meant to close, so it needs one Renovate cycle to confirm. If it does not take precedence, part 2 is cosmetic and needs another approach. --- Part 1 is safe to merge on its own. Part 2 is the one that wants a cycle of observation.
pnpm audit resolves the whole workspace graph and cross-references the advisory
database locally; on this monorepo that pegs a core for ~15 minutes. Measured
on task 3592: 894s of the job's 979s (91% of Checks), while checkout, install,
typecheck, lint, unit tests, build and openspec together took ~85s.

Because e2e is gated on needs: checks, that delay hit the E2E suite too. And
the step was continue-on-error, so none of it gated anything.

Advisories change when the advisory database changes, not when someone edits a
file, so a daily run finds the same things far cheaper.

The scheduled run is allowed to FAIL, matching disk-maintenance.yml: a
scheduled-run failure is the notification. A green nightly reporting advisories
into a summary nobody opens would be worse than what it replaced.
renovate: enable OSV vulnerability alerts
All checks were successful
CI / Security Scan (pull_request) Successful in 23s
CI / Dockerfile Package Check (pull_request) Successful in 14s
CI / Checks (pull_request) Successful in 1m58s
CI / Visual Tests (pull_request) Successful in 1m33s
CI / Journal Image Smoke Test (pull_request) Successful in 4m25s
CI / E2E Tests (pull_request) Successful in 5m18s
Cancel superseded CI / Cancel in-flight CI (pull_request) Successful in 13s
aa7fafe678
Until now nothing in this repo was advisory-driven. The CI dependency audit
only reported, and the pnpm.overrides rule states outright that an advisory
needing a minor/major bump 'has to be done by hand ... while
osvVulnerabilityAlerts is unconfigured'. This is that configuration.

OSV.dev rather than the GitHub advisory API, which Renovate cannot use on
Forgejo.

vulnerabilityAlerts overrides two global settings for security PRs only:
  - schedule: the global window is Monday mornings, so an advisory landing on
    a Tuesday would wait six days
  - minimumReleaseAge: the 3-day soak catches a compromised release, but an
    unpatched advisory is exploited during it

Deliberately NOT set: labels (Renovate can attach but not create them on
Forgejo, so an unknown label is dropped silently) and automerge (these cross
the version lines pnpm.overrides freezes on purpose).

Unverified: whether vulnerabilityAlerts takes precedence over the
packageRules entry that disables major/minor for pnpm.overrides. That is the
exact gap this is meant to close, so it needs watching for one cycle.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
trails-cool/trails!161
No description provided.