Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Merge remote-tracking branch 'origin/main'

pulse-triage[bot]e46e8977024a
diff --cc .github/workflows/build-and-test.yml
index 63cb097d0b,e622b6a6c0..745716e1cc
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@@ -143,16 -144,20 +144,24 @@@ jobs
- name: Install frontend dependencies
working-directory: frontend-modern
- # The explicit bounded audits below own the advisory verdict. Avoid
- # npm ci's duplicate best-effort audit POST and its five-minute timeout.
- run: npm ci
++ # The explicit bounded audit below owns the advisory verdict. Avoid
++ # npm ci's duplicate best-effort audit POST and its hidden timeout.
+ run: npm ci --no-audit
# npm audit exits 1 both for a real advisory and for an unreachable
# advisory endpoint. The runner keeps the advisory verdict exactly as
# strict and only retries the endpoint being down; see the script header.
+ #
+ # Only the complete graph is audited here. `--omit=dev` audits a subset
+ # of these packages, so it can only report a subset of these advisories;
+ # and because the complete audit fails the job on any finding, the
+ # production step could only ever run in the cases where it was already
+ # guaranteed clean. The dev-versus-production split is still reported
+ # for every workspace by the scheduled npm-audit job in
+ # security-scan.yml, where it informs rather than blocks delivery.
- name: Audit complete frontend dependency graph
+ id: audit-complete
+ continue-on-error: true
working-directory: frontend-modern
env:
NPM_AUDIT_REQUIRE_RESULT: ${{ needs.changes.outputs.frontend_deps }}
@@@ -200,20 -197,6 +201,18 @@@
working-directory: frontend-modern
run: npm run check:bundlesize
- # Audit service failures and real advisories stay gating, but neither may
- # suppress formatting, tests, type-checking, or the production build.
- - name: Require frontend dependency audits
++ # An audit service failure or real advisory stays gating, but it must not
++ # suppress formatting, tests, type-checking, or production-build proof.
++ - name: Require frontend dependency audit
+ if: ${{ !cancelled() }}
+ env:
+ COMPLETE_AUDIT_RESULT: ${{ steps.audit-complete.outcome }}
- PRODUCTION_AUDIT_RESULT: ${{ steps.audit-production.outcome }}
+ run: |
- if [ "${COMPLETE_AUDIT_RESULT}" != success ] || \
- [ "${PRODUCTION_AUDIT_RESULT}" != success ]; then
- echo "::error::One or more frontend dependency audits failed."
++ if [ "${COMPLETE_AUDIT_RESULT}" != success ]; then
++ echo "::error::The frontend dependency audit failed."
+ exit 1
+ fi
+
backend:
name: Backend tests (${{ matrix.shard }})
needs: changes
diff --cc docs/release-control/v6/internal/subsystems/deployment-installability.md
index 4b4994d55a,1c33b8e450..ffad17a357
--- a/docs/release-control/v6/internal/subsystems/deployment-installability.md
+++ b/docs/release-control/v6/internal/subsystems/deployment-installability.md
@@@ -4058,10 -4026,18 +4026,19 @@@ informs rather than blocks delivery. Th
advisory endpoint: on 2026-09-03 registry.npmjs.org returned 503s and timeouts
for over an hour and no pull request could land, including changes that touch
no JavaScript. It separates the two and nothing else. A conclusive result is
-acted on immediately and any vulnerability at any severity still fails, so a
-severity threshold must never be introduced; only an unreachable endpoint is
+acted on immediately and any vulnerability at any severity still fails, even
+if the same response also carries a transport error, so a severity threshold
- must never be introduced; only an unreachable endpoint is retried through
- bounded one-minute attempts. When retries are exhausted, the run fails if the change touches
++must never be introduced; only an unreachable endpoint is
+ retried. Retrying is bounded by wall clock and not by attempt count alone,
+ because npm's own `fetch-timeout` defaults to five minutes and it retries
+ internally: on 2026-09-04 three attempts against a hanging endpoint ran for
+ 10m56s and cancelled the Frontend job at its own timeout with every test
+ already passing, so a green run was reported as a failed required check. Each
+ attempt is therefore bounded, npm's internal retry loop is disabled in favour
+ of the runner's own, and the sequence stops at a total deadline. That budget
+ must stay well inside the job timeout; it may never be raised to the point
+ where an unreachable endpoint can consume the job. When retries are exhausted,
+ by attempt count or by budget, the run fails if the change touches
`frontend-modern/package.json`, `frontend-modern/package-lock.json`, or the
runner itself, because then the answer is genuinely unknown and the runner may
never be relaxed under cover of its own tolerant mode, and warns without
diff --cc scripts/installtests/build_release_assets_test.go
index 0d0a6a0984,257fa2d50a..e82ebb35ec
--- a/scripts/installtests/build_release_assets_test.go
+++ b/scripts/installtests/build_release_assets_test.go
@@@ -3661,46 -3640,23 +3640,31 @@@ func TestReleasePipelinePromotesOneImmu
}
func TestFrontendDependencySecurityAuditsAreRequired(t *testing.T) {
- buildWorkflowPath := repoFile(".github", "workflows", "build-and-test.yml")
- buildWorkflowBytes, err := os.ReadFile(buildWorkflowPath)
- if err != nil {
- t.Fatalf("read build-and-test workflow: %v", err)
- }
- frontendJob := workflowJobBlock(t, string(buildWorkflowBytes), "frontend")
- for _, needle := range []string{
+ workflowPath := repoFile(".github", "workflows", "build-and-test.yml")
+ assertFileContainsAll(t, workflowPath,
+ `run: npm ci --no-audit`,
`- name: Audit complete frontend dependency graph`,
`npm-audit-retry.sh" all`,
- `- name: Audit production frontend dependencies`,
- `npm-audit-retry.sh" production`,
// The runner may retry an unreachable advisory endpoint, but only a
// change that leaves the dependency graph untouched may proceed
// without a fresh result.
`NPM_AUDIT_REQUIRE_RESULT: ${{ needs.changes.outputs.frontend_deps }}`,
+ `frontend_deps: ${{ steps.filter.outputs.frontend_deps }}`,
+ `continue-on-error: true`,
- `- name: Require frontend dependency audits`,
++ `- name: Require frontend dependency audit`,
+ `if: ${{ !cancelled() }}`,
+ `COMPLETE_AUDIT_RESULT: ${{ steps.audit-complete.outcome }}`,
- `PRODUCTION_AUDIT_RESULT: ${{ steps.audit-production.outcome }}`,
- } {
- if !strings.Contains(frontendJob, needle) {
- t.Fatalf("build-and-test frontend job missing dependency audit contract: %s", needle)
- }
- }
- assertFileContainsAll(t, buildWorkflowPath,
- `frontend_deps: ${{ steps.filter.outputs.frontend_deps }}`,
)
- if verdictIndex, bundleIndex := strings.Index(frontendJob, "- name: Require frontend dependency audits"), strings.Index(frontendJob, "- name: Check frontend bundle size budget"); verdictIndex < bundleIndex || bundleIndex < 0 {
- t.Fatal("build-and-test must report independent frontend evidence before requiring audit success")
- }
-
- securityWorkflowPath := repoFile(".github", "workflows", "security-scan.yml")
- assertFileContainsAll(t, securityWorkflowPath,
- `npm-audit-retry.sh" all --package-lock-only`,
+ // The production-only audit reports a subset of the complete audit's
+ // advisories and cannot gate anything the complete audit did not already
+ // fail on, so it is off the per-pull-request path. It must still run
+ // somewhere: the scheduled scan owns the dev-versus-production split.
+ assertFileContainsAll(t, repoFile(".github", "workflows", "security-scan.yml"),
+ `- name: Audit production dependencies`,
- `npm audit --package-lock-only --omit=dev`,
+ `npm-audit-retry.sh" production --package-lock-only`,
+ `- name: Require dependency audits`,
+ `COMPLETE_AUDIT_RESULT: ${{ steps.audit-complete.outcome }}`,
+ `PRODUCTION_AUDIT_RESULT: ${{ steps.audit-production.outcome }}`,
)
// The gate itself must stay strict. An unreachable endpoint may be
// retried, but no severity threshold may be introduced that lets a real
@@@ -3714,12 -3670,28 +3678,31 @@@
t.Fatalf("%s must not weaken the audit with a severity threshold", runnerPath)
}
assertFileContainsAll(t, runnerPath,
+ `NPM_AUDIT_REQUIRE_RESULT:-true`,
- `NPM_AUDIT_FETCH_TIMEOUT_MS:-60000`,
+ `AUDIT_ARGS=("$@")`,
+ `if isinstance(vulns, dict) and "total" in vulns:`,
`print("vulnerable" if total else "clean")`,
)
+ // Retrying must be bounded by wall clock, not by attempt count alone.
+ // npm's own fetch-timeout defaults to five minutes and it retries
+ // internally, so three unbounded attempts once ran for 10m56s and
+ // cancelled the Frontend job with every test already passing.
+ assertFileContainsAll(t, runnerPath,
+ `NPM_AUDIT_MAX_SECONDS`,
+ `NPM_AUDIT_ATTEMPT_TIMEOUT`,
+ `export npm_config_fetch_retries=0`,
+ `DEADLINE=`,
+ )
+ // The job budget has to stay above the audit budget by a wide margin, or
+ // a stalled endpoint reappears as a cancelled job rather than a warning.
+ workflow, err := os.ReadFile(workflowPath)
+ if err != nil {
+ t.Fatalf("read %s: %v", workflowPath, err)
+ }
+ frontendJob := workflowJobBlock(t, string(workflow), "frontend")
+ if !strings.Contains(frontendJob, "timeout-minutes: 30") {
+ t.Fatal("frontend job must keep a bounded timeout above the audit budget")
+ }
}
func TestReleaseCutGatesCriticalFrontendAndWindowsRuntimeProof(t *testing.T) {
diff --cc scripts/npm-audit-retry.sh
index bf7715a724,8530b4054c..894fef3da6
--- a/scripts/npm-audit-retry.sh
+++ b/scripts/npm-audit-retry.sh
@@@ -48,15 -60,55 +60,57 @@@ case "${SCOPE}" i
exit 2
;;
esac
+shift
+AUDIT_ARGS=("$@")
ATTEMPTS="${NPM_AUDIT_ATTEMPTS:-3}"
- FETCH_TIMEOUT_MS="${NPM_AUDIT_FETCH_TIMEOUT_MS:-60000}"
DELAY="${NPM_AUDIT_RETRY_DELAY:-15}"
+ ATTEMPT_TIMEOUT="${NPM_AUDIT_ATTEMPT_TIMEOUT:-60}"
+ MAX_SECONDS="${NPM_AUDIT_MAX_SECONDS:-240}"
REQUIRE_RESULT="${NPM_AUDIT_REQUIRE_RESULT:-true}"
NPM_BIN="${NPM_AUDIT_CMD:-npm}"
+ # This script is the retry layer. npm's own fetch retry loop would multiply
+ # every attempt by an unbounded amount of hidden waiting, which is exactly
+ # what made a bounded-looking three attempts run for eleven minutes.
+ export npm_config_fetch_retries=0
+ export npm_config_fetch_timeout=$((ATTEMPT_TIMEOUT * 1000))
+
+ DEADLINE=$(( $(date +%s) + MAX_SECONDS ))
+
+ # Run one audit under a hard wall-clock bound, portably: `timeout` is not
+ # present on every developer machine, so a watchdog subshell kills the npm
+ # process if it outlives the limit. Blocking on `wait` for the real child
+ # avoids the zombie-liveness race that a `kill -0` poll would hit.
+ run_audit() {
+ local limit="$1" out="$2"
+
+ : >"${out}"
- "${NPM_BIN}" audit --json "${SCOPE_ARGS[@]}" >"${out}" 2>/dev/null &
++ "${NPM_BIN}" audit --json "${AUDIT_ARGS[@]}" "${SCOPE_ARGS[@]}" >"${out}" 2>/dev/null &
+ local npm_pid=$!
+
+ (
+ sleep "${limit}"
+ kill -TERM "${npm_pid}" 2>/dev/null
+ sleep 2
+ kill -KILL "${npm_pid}" 2>/dev/null
+ ) >/dev/null 2>&1 &
+ local killer_pid=$!
+
+ wait "${npm_pid}" 2>/dev/null
+ local status=$?
+
+ kill -TERM "${killer_pid}" 2>/dev/null
+ wait "${killer_pid}" 2>/dev/null
+
+ # 143 = SIGTERM, 137 = SIGKILL: the watchdog fired. The report is then
+ # empty or truncated, which classify_report already reads as unreachable.
+ if [ "${status}" -eq 143 ] || [ "${status}" -eq 137 ]; then
+ return 124
+ fi
+ return 0
+ }
+
# Classify one audit run. Prints a verdict word on stdout:
# clean — audit completed, no vulnerabilities
# vulnerable — audit completed, vulnerabilities present
@@@ -126,7 -189,7 +196,7 @@@ while [ "${attempt}" -le "${ATTEMPTS}"
echo "::error::npm audit (${SCOPE}) found vulnerabilities: ${summary}"
# Re-run without --json so the log carries the human-readable advisory
# detail a maintainer needs to act on.
- "${NPM_BIN}" audit --fetch-timeout="${FETCH_TIMEOUT_MS}" "${AUDIT_ARGS[@]}" "${SCOPE_ARGS[@]}" || true
- "${NPM_BIN}" audit "${SCOPE_ARGS[@]}" || true
++ "${NPM_BIN}" audit "${AUDIT_ARGS[@]}" "${SCOPE_ARGS[@]}" || true
exit 1
;;
*)