Skip to content

🌱 ci: gate devDependency advisories in npm audit - #519

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-515
Oct 30, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-515

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Why: the sixth dev-tree advisory (re2js) went undetected because the audit uses --omit=dev. Adds a second audit step covering devDependencies, using .github/npm-audit-exceptions.json (with expiry) so unpatched upstreams don't block. Per the approved ratchet decision, the new gate is warning-only (continue-on-error) for one release, then enforced.

Closes #515

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@netlify

netlify Bot commented Oct 29, 2026

Copy link
Copy Markdown

❌ Deploy Preview for hivecommons-docs failed. Why did it fail? →

Name Link
🔨 Latest commit 49fef2d
🔍 Latest deploy log https://app.netlify.com/projects/hivecommons-docs/deploys/6ae3dae51d7e483200500d9d

@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Netlify deploy preview (6ae3dae51d7e483200500d9d) is the only red check; every GitHub Actions check on this head is green and the diff touches only .github/workflows/npm-audit.yml, which Netlify never reads. Treating as an external deploy-infrastructure failure, not a PR defect — deferring; no retry from this side.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed (correctness) — no blocking findings.

Advisory, non-blocking: both gate steps read the same .github/npm-audit-exceptions.json (scripts/npm-audit-gate.ts:216-221). Once a dev-only exception is added, the production step (.github/workflows/npm-audit.yml:46-47) will emit ::warning::Unused npm audit exception … on every run (scripts/npm-audit-gate.ts:239-241) because that advisory is absent from the --omit=dev report. Harmless noise now; worth a scope field or a second exceptions file when the gate is enforced.

— hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the full workflow and scripts/npm-audit-gate.ts at merge-base, then ran the new step locally on this head. Looks correct to me; nothing blocking.

What I verified:

  • scripts/npm-audit-gate.ts:67-83 (validateAuditReport) and :96-115 (collectAdvisories) only need a vulnerabilities object, so a full npm audit --json report works unchanged, as #515 claims. The gate reads .github/npm-audit-exceptions.json from process.cwd() (:208-212), which is the same path the production step already relies on.
  • npm ci at .github/workflows/npm-audit.yml:38 installs dev deps (no --omit=dev), so the unfiltered npm audit at the new step actually sees the dev tree.
  • npm audit --json on 49fef2d reports 0 advisories (the re2js >=2.8.7 override from #516 is in package.json:85), so the gate starts from an empty baseline — "fail only on increases" and "fail on any un-excepted high" are the same thing here. Baseline tracking is the (currently empty) exceptions file, which already carries an expiry.
  • permissions: contents: read and the SHA-pinned actions are untouched; the diff adds two steps and no new secrets or tokens.

Two notes, not defects:

  • continue-on-error: true is the only thing making this warning-only; nothing will remind anyone to drop it after one release. A follow-up issue (or a expires-style date in the YAML comment) would keep the ratchet honest.
  • The red Netlify checks (deploy-preview / Header rules / Redirect rules / Pages changed) cannot be caused by a change confined to .github/workflows/npm-audit.yml; worth re-running before reading them as a signal.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me; implements the ratchet exactly as decided on #515 (warning-only for one release via continue-on-error, then enforce by dropping it).

What I verified on head 49fef2d:

  • The job's permissions: contents: read is unchanged and the two new steps only invoke the repo's own scripts/npm-audit-gate.ts (.github/workflows/npm-audit.yml:14-15, :56-59). No new actions, secrets, or triggers.
  • npm audit --json (no --omit=dev) against this tree's lockfile reports total: 0, so the new dev gate passes with the current empty .github/npm-audit-exceptions.json. That empty file is the recorded baseline the decision asks for — there is nothing to list yet.
  • scripts/npm-audit-gate.ts:200-209 already validates the report shape, so a registry error in the dev run fails (soft, for now) rather than passing silently — same behaviour as the prod step.

One low-severity observation, not a blocker: both steps read the same exceptions file (scripts/npm-audit-gate.ts:224-229), and main emits ::warning::Unused npm audit exception … for any active entry the current report didn't use (:244-246). Once a dev-only exception (e.g. the re2js one from #515) is added, the production step will warn it is unused on every run, and vice versa. Harmless noise today; if it gets annoying, a --exceptions=<file> flag or a scope field on entries would separate them.

Suggestion: when this merges, open a tracker to remove continue-on-error after the next release so the "one release" clock is visible somewhere other than a YAML comment.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 546d740 into main Oct 30, 2026
6 of 11 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-515 branch October 30, 2026 00:08
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#51949fef2d` sha256:ef7f46a02c71243c94ad8397b31e9ecb67fa4b4a67c476149d3f2e8cfa16c69c — download from the dashboard or `hivectl review evidence #519`.

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026
clubanderson pushed a commit that referenced this pull request Oct 30, 2026
Ratchets the warning-only devDependency audit step added in #519
(closing the gate proposed in #515) to a hard gate: the "one release"
condition in the ratchet comment never fires because this repo cuts
no tags/releases (continuous Netlify deploy), so the soft gate could
never go red. Verified safe at main@6a4fa59: npm-audit-gate.ts passes
at --level=high on the full tree, the latest npm-audit workflow run
is green, and .github/npm-audit-exceptions.json is empty.

Hive-Run: #530
Hive-Plan: Enforce the devDependency npm audit gate
Hive-Spec: npm-audit-gate#ratchet-515-519

Signed-off-by: onkar717 <[email protected]>
Co-authored-by: onkar717 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off dco-signoff: yes size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[sec-check] Gate proposal: dev-tree npm advisories are never audited in CI (6th instance: re2js GHSA-gg6h-894w-4m9c via markdownlint-cli2)

0 participants