From 85bc0d3ce215f02c125e7b05a59a48134d6c2e29 Mon Sep 17 00:00:00 2001 From: Zhengchao An Date: Sat, 1 Aug 2026 20:19:38 +0800 Subject: [PATCH] ci: let the CARGO_BUILD_JOBS experiment collect samples on demand (#5572) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gate 2 in rustfs/backlog#1601 needs ten terminal Test and Lint samples at 3. Push alone cannot supply them: this workflow cancels superseded runs on main, and only 4 of the last 20 push-triggered Test and Lint jobs reached a terminal state — 15 were cancelled. At that rate ten samples take roughly fifty merges, so the experiment would sit open for days while the branch it measures keeps moving. The concurrency group is scoped by event_name, so a dispatched run has its own group and is not cancelled by merge traffic. Including workflow_dispatch in the raised value makes the sample collectable deliberately rather than by waiting for pushes to survive. PRs still get 2. The merge path is untouched. Refs: rustfs/backlog#1598, rustfs/backlog#1601 --- .github/workflows/ci.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4358ff5a8..4fa68b682 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -226,8 +226,18 @@ jobs: # the label name "sm-standard-4" had led everyone, including the # original mitigation, to assume 4 cores. # - # Raised to 3 on main pushes only; PRs keep 2 so the merge path is - # untouched while the experiment runs. Baseline over 17 samples at 2: + # Raised to 3 on main pushes and manual dispatches; PRs keep 2 so the + # merge path is untouched while the experiment runs. + # + # Dispatch is included because push alone cannot supply the samples: + # this workflow cancels superseded runs on main, and only 4 of the last + # 20 push-triggered Test and Lint jobs reached a terminal state — at + # that rate ten samples would take roughly fifty merges. The + # concurrency group is scoped by event_name, so a dispatched run has + # its own group and is not cancelled by merge traffic, which makes the + # sample collectable on demand rather than by waiting. + # + # Baseline over 17 samples at 2: # median nextest/clippy step ratio 1.95, spread 1.85-2.06. The gate-2 # criterion is that ratio dropping at least 10% (below ~1.76) with no # 75m timeout and no run showing three consecutive samples of @@ -238,7 +248,7 @@ jobs: # Must stay step-level: rust-cache hashes CARGO/CC/CFLAGS/CXX/CMAKE/RUST # prefixed variables from process.env into the cache key, so promoting # this to job level would rotate every key on this lane. - CARGO_BUILD_JOBS: ${{ github.event_name == 'push' && '3' || '2' }} + CARGO_BUILD_JOBS: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && '3' || '2' }} run: | mkdir -p artifacts/test-and-lint ./scripts/ci/resource_sampler.sh start nextest