Skip to content

Commit fec483f

Browse files
committed
CI: skip e2e binary upload on lean pushes
A push to main that reuses the merge-queue result still bundled, compressed and uploaded the ~94 MB ubuntu e2e binaries, only so the full tier could download them. The full tier no longer runs on such a push unless CI_SCOPE is full, so ship the binaries only then. Also correct the comments, the reuse log line and the yarn-berry doc that still said a push to main runs the full tier. Refs #1414 Assisted-by: Claude Code:claude-opus-5-5
1 parent 84c1d53 commit fec483f

4 files changed

Lines changed: 24 additions & 14 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,14 +1014,16 @@ jobs:
10141014
cargo test --locked -p socket-patch-cli --all-features --tests --no-run --message-format=json-render-diagnostics > target-build.json
10151015
10161016
- name: Bundle the binaries the legs run
1017-
if: needs.clippy.outputs.reuse != 'true' || matrix.os == 'ubuntu-latest'
1017+
# A reused push runs no leg, except e2e-full and cargo-vex-matrix-full
1018+
# on ubuntu when CI_SCOPE is `full`.
1019+
if: needs.clippy.outputs.reuse != 'true' || (matrix.os == 'ubuntu-latest' && vars.CI_SCOPE == 'full')
10181020
shell: bash
10191021
env:
10201022
BUNDLE_OS: ${{ matrix.os }}
10211023
run: python3 scripts/ci-e2e-bundle.py --os "$BUNDLE_OS" --cargo-json target-build.json --dest target/e2e-bin
10221024

10231025
- name: Compress the e2e binaries
1024-
if: needs.clippy.outputs.reuse != 'true' || matrix.os == 'ubuntu-latest'
1026+
if: needs.clippy.outputs.reuse != 'true' || (matrix.os == 'ubuntu-latest' && vars.CI_SCOPE == 'full')
10251027
# Compress the bundle as one stream so identical Rust code across
10261028
# test binaries shares a dictionary. Zstd is on every runner image.
10271029
# The 128 MiB window cuts the Linux artifact from ~200 MB to ~94 MB;
@@ -1032,7 +1034,7 @@ jobs:
10321034
tar -C target/e2e-bin -cf - . | zstd -q -f -10 --long=27 -o target/e2e-bin.tar.zst
10331035
10341036
- uses: ./.github/actions/upload-artifact
1035-
if: needs.clippy.outputs.reuse != 'true' || matrix.os == 'ubuntu-latest'
1037+
if: needs.clippy.outputs.reuse != 'true' || (matrix.os == 'ubuntu-latest' && vars.CI_SCOPE == 'full')
10361038
with:
10371039
name: e2e-bin-${{ matrix.os }}
10381040
path: target/e2e-bin.tar.zst
@@ -1807,10 +1809,10 @@ jobs:
18071809
18081810
# The PM-version legs with no boundary of their own: the middle uv lines,
18091811
# Pipenv releases and .NET SDK majors, and bundler 2.7. Skipped
1810-
# on pull_request (the `e2e` rows keep every named boundary, the oldest
1811-
# and newest release of each tool and every vlt era there); main pushes,
1812-
# v5 landings, the nightly schedule and dispatch run them with the `e2e`
1813-
# steps.
1812+
# on pull_request, merge_group and main pushes (the `e2e` rows keep every
1813+
# named boundary, the oldest and newest release of each tool and every vlt
1814+
# era there); v5 landings, the nightly schedule and dispatch run them with
1815+
# the `e2e` steps, and so do main pushes when CI_SCOPE is `full`.
18141816

18151817
# Each OS consumes only its own build. A queued macOS runner must not
18161818
# delay Linux or Windows, and a Windows compile must not delay Gradle.
@@ -2262,7 +2264,7 @@ jobs:
22622264
YARN_BERRY_RELEASE: ${{ matrix.yarn }}
22632265
run: scripts/yarn-berry-vex-matrix.sh "$YARN_BERRY_RELEASE"
22642266

2265-
# Skipped on pull_request (except v5 landings), like e2e-full.
2267+
# Nightly, on dispatch and on v5 landings only, like e2e-full.
22662268

22672269
# The macOS rows of `yarn-berry-e2e`: they run on main, the merge queue and
22682270
# nightly, not on every PR push, so PRs stop queueing on the small
@@ -2304,7 +2306,7 @@ jobs:
23042306
# plus macOS and Windows; 1.93.1 with its own lock (on every OS) is the
23052307
# pinned rust-toolchain.toml cell `cargo test` used to give
23062308
# e2e_safety_cargo_build. cargo-vex-matrix-full runs the rest of the
2307-
# toolchain x lock cross off pull_request. Each leg also runs
2309+
# toolchain x lock cross nightly and on dispatch. Each leg also runs
23082310
# e2e_safety_cargo_build (its headline test honours the knobs).
23092311
cargo-vex-matrix:
23102312
if: needs.e2e-build.outputs.reuse != 'true'

‎docs/testing/yarn-berry-compatibility.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ The `yarn-berry-e2e` job in `.github/workflows/ci.yml` runs
9191
| macos-latest | 4.12.0 |
9292
| windows-latest | 4.12.0 |
9393

94-
Pull requests skip ubuntu 4.6.0 and 4.12.0 (the `yarn-berry-full` job, which
95-
runs nightly and on dispatch, and on main pushes only when `CI_SCOPE` is
96-
`full`).
94+
Pull requests, the merge queue and main pushes skip ubuntu 4.6.0 and 4.12.0
95+
(the `yarn-berry-full` job, which runs nightly, on dispatch and on the v5
96+
integration PR, and on main pushes only when `CI_SCOPE` is `full`).
9797

9898
Each release drives four real-yarn suites — `e2e_redirect_yarn_berry_build`,
9999
`e2e_vendor_yarn_berry_build`, `e2e_yarn4_pnpm_linker_build` and

‎scripts/ci-reuse-merge-group.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def main():
4747
with Path(os.environ["GITHUB_OUTPUT"]).open("a", encoding="utf-8") as output:
4848
output.write(f"reuse={'true' if reuse else 'false'}\n")
4949
if reuse:
50-
print(f"Merge-queue CI run {run} passed this SHA; retaining cache builds and the full tier.")
50+
print(f"Merge-queue CI run {run} passed this SHA; retaining cache builds only.")
5151
else:
5252
print("No verified merge-queue CI result for this push; running all checks.")
5353

‎scripts/tests/test_ci_scheduling.py‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,21 @@ def test_lean_queue_type_checks_windows_and_full_scope_builds_it(self):
111111

112112
def test_reused_push_keeps_cache_writers_and_unqueued_jobs(self):
113113
# A push whose SHA passed the merge queue still compiles (main is the
114-
# only cache writer) and still runs what the queue never ran.
114+
# only cache writer) and still runs what the queue never ran. The
115+
# full tier runs on a push only when CI_SCOPE is full, so only then
116+
# does e2e-build still ship the ubuntu binaries it downloads.
115117
for job in ("clippy", "node-addon", "test", "test-release", "coverage", "e2e-build",
116118
"e2e-build-windows", "e2e-build-macos", "cargo-old-toolchains",
117119
"e2e-full", "cargo-vex-matrix-full", "yarn-berry-full", "hosted-e2e"):
118120
with self.subTest(job=job):
119121
condition = next((line for line in JOBS[job] if line.startswith(" if:")), "")
120122
self.assertNotIn("outputs.reuse", condition)
123+
ship = [body for name, body in reader.steps(JOBS["e2e-build"])
124+
if name.startswith(("Bundle ", "Compress ")) or "upload-artifact" in body]
125+
self.assertEqual(len(ship), 3)
126+
for body in ship:
127+
self.assertIn("if: needs.clippy.outputs.reuse != 'true'"
128+
" || (matrix.os == 'ubuntu-latest' && vars.CI_SCOPE == 'full')", body)
121129
for job in ("docker-base", "yarn-classic-matrix", "yarn-berry-e2e", "yarn-berry-e2e-macos"):
122130
with self.subTest(job=job):
123131
condition = next(line for line in JOBS[job] if line.startswith(" if:"))

0 commit comments

Comments
 (0)