Skip to content

fix(ci): clear Daily Maintenance cargo-audit failures - #53

Merged
Mouseww merged 3 commits into
mainfrom
fix/daily-maintenance-audit
Oct 15, 2026
Merged

Mouseww merged 3 commits into
mainfrom
fix/daily-maintenance-audit

Conversation

@Mouseww

@Mouseww Mouseww commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the red Daily Maintenance job (系统健康检查 → 安全漏洞扫描), which has been failing on schedule for about a week (e.g. https://github.com/Mouseww/hakimi-agent/actions/runs/37751078074 with error: 29 vulnerabilities found!). Regular CI on main was already green.

Dependency / lockfile fixes (makes cargo audit exit 0)

Crate From To Advisories
rustls 0.23.40 0.23.45 RUSTSEC-2026-0285
quinn-proto 0.11.14 0.11.19 RUSTSEC-2026-0185
wasmtime / wasmtime-wasi 16.0.0 36.0.17 26 wasmtime(+wasi) RUSTSECs + pulls fixed cap-primitives
anyhow 1.0.102 1.0.104 unsound warning
event-listener 5.4.1 5.4.2 unsound warning

crates/hakimi-plugin WASM loader ported to wasmtime 36 preview1 (WasiP1Ctx / add_to_linker_sync / new preopened_dir API). Feature wasm still optional.

Ignored advisories: none (no audit.toml needed). Remaining cargo audit output is warnings-only (unmaintained transitive crates + lru via ratatui + glib via GTK/Tauri).

Workflow logic fix (blocked from this token)

The step still greps for the JSON key "vulnerabilities" (always present) and can fail on cargo audit's non-zero exit while writing $GITHUB_STEP_SUMMARY.

This PR adds:

  • scripts/ci-security-audit.sh — count via jq on .vulnerabilities.count / .list|length; always report; fail only if count > 0
  • docs/ci/daily-maintenance.yml.intended + snippet — exact replacement for .github/workflows/daily-maintenance.yml

Pushing under .github/workflows/ was refused: current gh OAuth token scopes are repo,gist,read:org (missing workflow). After merge (or on this branch), apply with:

gh auth refresh -s workflow
cp docs/ci/daily-maintenance.yml.intended .github/workflows/daily-maintenance.yml
git add .github/workflows/daily-maintenance.yml
git commit -m "fix(ci): use jq-based cargo-audit gate in Daily Maintenance"
git push

Until that lands, clearing the 29 vulns alone should make the existing step pass (second cargo audit exits 0 when count is 0).

Verification

  • cargo audit → 0 vulnerabilities, exit 0
  • cargo check --all → ok
  • cargo test -p hakimi-plugin --features wasm → 38 passed

Test plan

  • Merge / wait for scheduled or manually dispatch Daily Maintenance
  • Confirm 安全漏洞扫描 is green
  • Apply workflow file update once a workflow-scoped token is available
  • Do not merge until reviewed (opened as requested)

webber added 3 commits October 8, 2026 23:19
Bump vulnerable crates so cargo audit reports 0 vulnerabilities:
- rustls 0.23.40→0.23.45
- quinn-proto 0.11.14→0.11.19
- wasmtime/wasmtime-wasi 16.0→36.0.17 (port wasm_loader to preview1 API)
- anyhow 1.0.102→1.0.104, event-listener 5.4.1→5.4.2

A follow-up (or same PR via workflow-scoped token) is needed for the
Daily Maintenance step logic that greps the JSON key name and fails on
cargo audit's non-zero exit even when reporting to the summary.
The Daily Maintenance workflow currently greps for the JSON key
"vulnerabilities" (always present) and can fail on cargo audit's exit
code while writing the summary.

This adds scripts/ci-security-audit.sh that counts via jq and fails only
when vulnerability count > 0 after ignores, plus an intended workflow
snippet under docs/ci/ for a follow-up that updates
.github/workflows/daily-maintenance.yml (requires a token with the
`workflow` scope).
@Mouseww
Mouseww merged commit 0b101ce into main Oct 15, 2026
2 checks passed
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.

2 participants