Skip to content

ci: run the security audit, benchmark on demand, keep release secrets out of scripts - #449

Merged
Nic-dorman merged 3 commits into
masterfrom
nic/v2-1765-ci-cleanup
Oct 28, 2026
Merged

Nic-dorman merged 3 commits into
masterfrom
nic/v2-1765-ci-cleanup

Conversation

@Nic-dorman

Copy link
Copy Markdown
Member

Linear issue

Closes V2-1765

Summary

This PR fixes items 5, 7 and 8 of the 2026-10-27 faux-CI audit of this repo (V2-1747), workflow files only. Review it commit by commit:

  1. ci: make the daily security audit actually run
    • security_audit.yml was guarded by if: github.repository_owner == 'maidsafe', so it has never run under WithAutonomi. GitHub now lists it as disabled_inactivity.
    • It now runs cargo deny check advisories, with the same tool and deny.toml ignores as merge.yml's PR check, every day. New advisories show up between PRs instead of on whoever opens the next one.
    • The deprecated actions-rs/audit-check is gone, and workflow_dispatch is added for manual runs.
  2. ci: run the benchmarks on demand only
    • benchmark.yml ran on every pull_request and every push with no branch filter, so it ran twice on each PR-branch push. Nothing compared or stored the results.
    • It's now workflow_dispatch only. merge.yml's clippy --all-targets already compiles the benches on every PR.
    • The separate build step is deleted: its if: was a malformed expression, and cargo bench builds anyway.
  3. ci: keep release secrets out of run scripts, drop actions-rs
    • release.yml used to paste CRATES_IO_TOKEN and SELF_ENCRYPTION_PAT into the publish script with ${{ }}. Both now go through the step's env:.
    • release-plz publishes with CARGO_REGISTRY_TOKEN, so the cargo login line goes. The PAT reaches --git-token as "$GIT_TOKEN". SELF_ENCRYPTION_PAT stays, because tags pushed by the default token wouldn't trigger python-publish.yml.
    • The publish job installed the toolchain twice. Only dtolnay/rust-toolchain is left.
    • The deprecated actions-rs/toolchain is replaced with dtolnay/rust-toolchain in release.yml and merge.yml (and in benchmark.yml, in commit 2). actions/checkout goes from v2 to v4, which the rest of the repo already uses.

Runner cost: the benchmark no longer runs on PRs or pushes, which saves two Linux runs per PR-branch push.

Admin follow-up after merge: GitHub doesn't re-enable a workflow it disabled for inactivity, so the audit needs gh workflow enable security_audit.yml -R WithAutonomi/self_encryption. To confirm it works, run gh workflow run security_audit.yml -R WithAutonomi/self_encryption once.

Not changed:

  • The release test gate and post-merge CI. Both follow the org decision in V2-1746.
  • python-publish.yml, tracked in V2-1763.
  • The Node workflows, removed by chore: remove the unpublished Node.js bindings #448.
  • The ADR workflow (deferred).
  • cargo-bins/cargo-binstall@main in release.yml is unpinned, on a job whose checkout holds the PAT. I'm noting it here, not changing it.

Risk tier

  • T0 — docs / tooling / CI / pure UX-output. Repo CI only.
  • T1 — client-only, no network-facing behavior change. CI + prod compat smoke.
  • T2 — node/client logic with behavioral surface, no protocol/format/economics change. Dev testnet + ADR.
  • T3 — protocol / storage format / payments / routing. T2 evidence + adversarial testing.

Compatibility

  • Wire: none
  • Storage: none
  • API: none. Only .github/workflows/ changes.

Semver impact

  • breaking
  • feature
  • fix (CI only; the crate doesn't change)

Test evidence

Run on dev2 (Ubuntu 24.04) against this branch's tree (master 656f96a plus this diff).

Check Result
actionlint 1.7.12 on the 4 changed workflows clean
cargo deny --all-features check advisories (the scheduled job's exact command line) advisories ok
RUSTFLAGS="-D warnings" cargo bench --no-run pass
release-plz release --help (0.4.2, what release.yml installs) --token falls back to CARGO_REGISTRY_TOKEN; --git-token reads GIT_TOKEN
merge.yml with the toolchain swap this PR's own run

The deny action word-splits its command input (cargo-deny $* in its entrypoint), so command: check advisories works. Its README uses the same form.

release.yml can't run from a PR, because dispatching it publishes. The next release will be its first real run. If the token wiring were wrong, cargo publish would fail before anything reached crates.io.

New dependency

none

ADR

n/a

Mitigation / rollback

Revert the PR. Each commit touches different files and can be reverted alone.

🤖 Generated with Claude Code

@MaidSafe-Hermes MaidSafe-Hermes left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

APPROVE — no blocking workflow defect found in the four changed files.

Both seats agree (two model families): 2/2 reviewed (sol-1 gpt-6.1-sol xhigh; glm-1 z-ai/glm-5.3), at head 13d4124.

Verified: security_audit.yml is schedule/workflow_dispatch only with contents: read; benchmark.yml is workflow_dispatch only; release.yml is workflow_dispatch only, gates publish on build, and passes tokens through quoted env variables; merge.yml preserves stable/nightly toolchain requirements and clippy. gh pr checks returned 15/15 SUCCESS.

Non-blocking: action references remain mutable tags rather than full commit-SHA pins. The dispatch-only release, benchmark, and scheduled audit paths did not run in PR CI. Release-plz 0.4.2 token compatibility and the other test claims are reported in the PR body, not independently rerun here. No merge performed.

Nic-dorman and others added 3 commits October 28, 2026 16:27
The job was guarded by `repository_owner == 'maidsafe'`, so it has never
run since the repo moved to WithAutonomi, and GitHub has since disabled the
workflow for inactivity. It also used the deprecated actions-rs/audit-check.

Run `cargo deny check advisories` instead: the same tool and deny.toml
ignores as merge.yml's PR check, but daily, so new advisories show up
between PRs. Add workflow_dispatch for manual runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
benchmark.yml ran on every pull_request and every push with no branch
filter, so each push to a PR branch ran it twice. Nothing compares or
stores the results, and merge.yml's `clippy --all-targets` already
compiles the benches on every PR.

Also drop the separate build step: its `if:` was a malformed expression
and `cargo bench` builds anyway. Replace actions-rs/toolchain with
dtolnay/rust-toolchain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
release.yml pasted CRATES_IO_TOKEN and SELF_ENCRYPTION_PAT into the
publish script with ${{ }}. Pass them through the step's env instead:
release-plz publishes with CARGO_REGISTRY_TOKEN, so `cargo login` goes,
and the PAT reaches --git-token as "$GIT_TOKEN".

The publish job installed the toolchain twice; keep only
dtolnay/rust-toolchain. Replace the deprecated actions-rs/toolchain in
release.yml and merge.yml with dtolnay/rust-toolchain, and move
actions/checkout from v2 to v4 to match the rest of the repo.

Closes V2-1765

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Nic-dorman
Nic-dorman force-pushed the nic/v2-1765-ci-cleanup branch from 13d4124 to 8ddfd7f Compare October 28, 2026 16:28
@Nic-dorman
Nic-dorman merged commit bb4b987 into master Oct 28, 2026
9 checks passed
@Nic-dorman
Nic-dorman deleted the nic/v2-1765-ci-cleanup branch October 28, 2026 16:36
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