ci: skip superseded runs, move fuzz to nightly, trim the android PR trigger #168
Loading…
Reference in a new issue
No description provided.
Delete branch "ci/trim-redundant-runs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Three sources of wasted Pi time, measured over a two-week window (353 workflow runs, 694 job runs): ~78% of CI wall-clock was spent on work that did not need to happen.
1. Nothing was ever cancelled. Every
concurrency:block hadcancel-in-progress: false, and 279 of 353 runs sat in the queue behind a newer commit on the same branch. The comment justifying it (shared the container name onionwire-ci) was stale — that name has been per-run-id for a while — but the real constraint is the shared cargo target volume, which two concurrent writers corrupt. So the flag stays false and superseded runs instead stand down at a new gate: compareGITHUB_SHAagainst the remote branch tip and skip. Seconds, not minutes, and it cannot release the concurrency group into a volume race.Verified against run history: Forgejo PR
GITHUB_SHAis the branch head, never a synthetic merge commit (245/245 recorded PR runs match arefs/pull/*/headtip), so the gate cannot skip a live run. It fails open — an unresolvable ref runs the job. 232 of 477 historical PR runs would have been skipped.2.
fuzzran on almost every push. A job cannot narrow a workflow-level path filter, sofuzz/**sat besidesrc/**: 80 of 84 recorded runs touched nothing infuzz/, each paying a nightly toolchain install andcargo install cargo-fuzzfor 15 seconds of actual fuzzing. Now its own workflow, schedule-only at 03:30 UTC plusworkflow_dispatch. The single-container fix and PATH export from #106/#107 come along unchanged.3. android-ci built a full APK for commits touching no
android/file — 95 of 143 runs at ~11 min each. The PR trigger is nowandroid/**,crates/onionwire-sdk/**,Cargo.toml,Cargo.lock, the build script. The push-to-main trigger keepssrc/**+crates/**, so every merge still runs the in-APK checks (thetarget_max_memorymarker gate, the.solisting, the sha256 round-trip). A Rust-only PR now finds out at merge instead of before it; nothing reaches a release untested.Also drops
fetch-depth: 0from android-ci — nothing in the build reads git history.ci.ymlpush: [main]is unchanged on purpose: it re-tests trees a PR already tested, but branch protection is empty so it is not a merge gate, it is the "CI green on main" signal the release readiness gate reads, and a merge commit has a different sha so statuses do not carry over.No source changes —
cargo test/clippyare unaffected.Three sources of wasted Pi time, measured over a two-week window (353 workflow runs, 694 job runs): ~78% of CI wall-clock was spent on work that did not need to happen. 1. Nothing was ever cancelled. Every `concurrency:` block in the repo had `cancel-in-progress: false`, and 279 of 353 runs sat in the queue behind a newer commit on the same branch. The comment justifying it ("shared the container name `onionwire-ci`") was stale — the name has been per-run-id for a while — but the real constraint is the shared cargo target volume, which two concurrent writers corrupt (`Permission denied (os error 13)` on /target/debug/deps). So the flag stays false and superseded runs instead stand down at a new gate: compare GITHUB_SHA against the remote branch tip and skip. Seconds, not minutes, and it cannot release the concurrency group into a volume race. Added to ci.yml (test, sdk) and android-ci.yml (android). Verified against the run history: Forgejo's pull_request GITHUB_SHA is the branch head, never a synthetic merge commit (245/245 recorded PR runs match a refs/pull/*/head tip), so the gate cannot skip a live run. It fails open — an unresolvable ref runs the job. 232 of 477 historical PR runs would have been skipped. 2. `fuzz` ran on almost every push. A job cannot narrow a workflow-level path filter, so `fuzz/**` sat in ci.yml's list beside `src/**` and `crates/**`: 80 of 84 recorded runs touched nothing in fuzz/, each paying a nightly toolchain install and `cargo install cargo-fuzz` for 15 seconds of actual fuzzing. Moved to its own workflow, schedule-only (03:30 UTC, off the arti-watch slot) plus workflow_dispatch. The build/run single-container fix and the PATH export from #106/#107 come along unchanged. 3. android-ci built a full APK for commits that touched no android/ file — 95 of 143 runs, at ~11 minutes each. The PR trigger now covers android/**, crates/onionwire-sdk/**, Cargo.toml, Cargo.lock and the build script. The push-to-main trigger keeps src/** and crates/**, so every merge still runs the in-APK checks that earn their keep (the target_max_memory marker gate, the .so listing, the sha256 round-trip) — a Rust-only PR now finds out at merge instead of before it, and nothing reaches a release untested. Also drops `fetch-depth: 0` from android-ci: nothing in the build reads git history (PUBLISH_TAG comes from the environment). ci.yml's `push: [main]` trigger is unchanged. It re-tests trees a PR already tested identically (73 job runs in the window), but branch protection is empty, so it is not a merge gate — it is the "CI green on main" signal docs/RELEASING.md's readiness gate reads, and a merge commit has a different sha so statuses do not carry over. The staleness gate already removes most of its cost. docs/RELEASING.md describes all of the above; its android-ci path list and its fuzz-job account were both wrong after this change.