mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-01 11:02:14 +00:00
790bdc0e63
* ci: stop running expensive jobs that cannot inform the result Three independent fixes that all avoid burning self-hosted runners on work whose outcome is already determined. None of them changes what is tested. - ci-docs-only: add a "Quick Checks" companion job. It is a prerequisite for gating ci.yml's expensive jobs behind quick-checks (rustfs/backlog#1599): once "Quick Checks" is a required check, a docs-only PR would otherwise wait on it forever. The steps are a byte-identical copy of ci.yml's quick-checks rather than an `echo`, so that on a mixed PR the two same-named check runs execute the same commands against the same merge ref and cannot disagree — GitHub has no written contract for how it picks between same-named required check runs, and the real job only takes 45-51s, leaving no timing margin to rely on. - ci: guard uring-integration with the same `closed` check every other job already has. The pull_request trigger includes `closed` only so the concurrency group cancels in-flight runs; this job had no guard and no `needs`, so every closed or merged PR ran the full io_uring suite (4m17s, 7m19s and 7m31s on runs 30678272341, 30678117601 and 30662728539). - ci: gate s3-lifecycle-behavior-tests on e2e-tests, matching s3-implemented-tests. Both lanes only download the prebuilt debug binary, and s3-implemented-tests already finishes later, so a green PR's wall clock is unchanged; a red one stops holding a sm-standard-4 for up to 30 minutes. Refs: rustfs/backlog#1598, rustfs/backlog#1599 * ci: gate the seven expensive jobs on Quick Checks Every expensive job started in parallel with quick-checks, so a formatting or architecture-guard failure still paid for the full pipeline. On run 30673292690 Quick Checks failed after 0.8 minutes and the run went on to burn 424.5 runner-minutes — 99.8% of it after the gate had already failed. The self-hosted pool is 15-21 ARC runners and one full PR run needs about seven sm-standard-4 concurrently, so those minutes come straight out of other PRs' queue time (six runs measured 72-488 minutes queued). quick-checks itself is compile-free and takes 45-51s, so a passing PR pays about a minute of extra critical path. REQUIRES the branch ruleset to list "Quick Checks" as a required check BEFORE this merges. Adding `needs` gives these jobs a `skipped` conclusion for the first time, and GitHub treats a skipped required check as satisfied — with required_approving_review_count=0, a failing quick-checks would otherwise let a broken PR merge. Ordering is tracked in rustfs/backlog#1599. Refs: rustfs/backlog#1598, rustfs/backlog#1599 * ci: stop a PR run once Test and Lint has failed (#5530) On run 30674613104 the e2e, ILM and sftp lanes had all failed while Test and Lint and the rio-v2 variant kept running past 70 minutes. The run's verdict was settled; the remaining lanes were spending sm-standard-4 time on a result nobody could act on, and with one full PR run needing about seven of those runners, that time comes out of other PRs' queue time. Two mechanisms, both scoped to pull_request so main pushes, the merge queue and the weekly schedule keep the full failure signal: - test-and-lint-protocols: fail-fast on PRs, so one failing protocol leg stops its sibling. This is the only part that also covers fork PRs, since it needs no token. - test-and-lint: on failure, cancel the run through the REST API. Only test-and-lint may cancel. The lanes that are not required checks (protocols, ILM, e2e, s3-tests) must never hold that power: a flake in one of them would turn the required "Test and Lint" into `cancelled`, which blocks the merge. A maintainer can merge today with sftp red, and that has to stay true. The cancel step uses curl, not `gh`: every existing `gh` call in this repo runs on ubuntu-latest, and the sm-standard-* images are custom and trimmed, so `gh` is not known to exist there. Fork PRs are excluded by an explicit condition rather than left to fail, since their GITHUB_TOKEN is forced read-only and job-level permissions cannot raise it. Job-level permissions must list contents: read alongside actions: write — job-level permissions replace the workflow block instead of merging with it, and dropping contents would break this job's checkout and the repo-token the setup action passes to setup-protoc. Because that token can now cancel runs and delete Actions caches, the checkout also sets persist-credentials: false so a PR's own build.rs or proc-macro cannot read it back out of .git/config. Refs: rustfs/backlog#1598, rustfs/backlog#1599 * ci: correct the companion-workflow comments Addresses review feedback on #5528, which merged before these fixes were pushed. The ci-docs-only header claimed the ruleset already requires "Quick Checks". It does not — that ruleset change is a separate step, and this file's whole purpose is to land first so that change does not strand docs-only PRs. Say what is true today. Also move the byte-identical requirement onto ci.yml's quick-checks job, which is the more likely edit site, instead of pointing at a comment that was not there.