Skip to content

perf(ci): stop runners doing work a PR cannot change - #4665

Merged
thymikee merged 3 commits into
mainfrom
ci/runner-waste
Nov 18, 2026
Merged

thymikee merged 3 commits into
mainfrom
ci/runner-waste

Conversation

@thymikee

@thymikee thymikee commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Baseline across the 12 most recent PRs: mean 36.5 runner-minutes per PR (Android 5.62, Apple
4.45 + 4.23, Integration 2.86, Repo Guards 2.73). Three workflows pay for work a PR cannot change.

  • test-app-build-cache.yml ran on every PR, resolving a fingerprint @expo/fingerprint hashes
    with examples/test-app/ as project root. Across 120 merged PRs it started 117 runs; 12
    had a path that can change what it reads. Each cost 0.62 min, always finding main's binary.
    Added those paths and the concurrency group it never had.
  • docs.yml started a second runner to install the graph the docs lane had just installed: that
    job cost 0.49 min for a 3.2 s gate. One job now declares all five docs gates and costs
    0.68 min, against 1.20 for the two.
  • ci.yml ran layering (62.5 s), affected-selector (24.8 s) and depgraph (18.8 s) in sequence,
    each parsing the same tree. In one parallel group that job costs 2.25 min, against 2.56.

At this head: CI and
Docs.

Rejected on measurement: the pnpm store cache hits its primary key in every job; checkout with full
history is 2–3.5 s, so filter: blob:none buys nothing; selection-guarded device lanes ran 11 of
12 PRs, so job-level skipping gates nothing.

Validation

check:gate-manifest green (60 checks, 24 lanes); node --test scripts/gate/*.test.ts 53/53;
unit-core CI-config tests 6/6; oxfmt and oxlint clean. The #1420 witness now stops the whole docs
lane, which owns every docs gate. Risk: a missed path costs one inline build, not a wrong binary.

🤖 Generated with Claude Code

thymikee and others added 3 commits November 17, 2026 22:57
…ange

The producer ran on every pull request and resolved a fingerprint that @expo/fingerprint
hashes with examples/test-app/ as the project root, so a diff outside that tree cannot
change the artifact name it publishes or the trust rules a consumer applies. Over the last
120 merged PRs it started 117 runs and 12 had a path that can change what that job reads.
Each run cost 0.57 minutes: one checkout, one install, and two artifact lookups that always
found main's binary.

Give the pull_request trigger the paths that job's own steps read, and add the workflow-level
concurrency it never had: a consumer trusts an artifact only from its own exact head or from
a main push, so a producer that finishes for a superseded head is never downloaded. Main
pushes keep a per-sha group so a build that feeds every later PR's cache always finishes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The command-reference gate started its own runner, checked out the tree, and installed the
same dependency graph the docs lane had just installed, to run one Vitest file over the
Markdown the lane's other gates already read. Measured on recent runs, that job spent 23.6
seconds on checkout and install to spend 3.2 seconds on the gate.

Declare it in the docs lane's existing job and drop the second one. The lane now carries all
five docs gates from one install, which is also what the manifest's path reachability reads,
so the witness for #1420 stops the whole lane instead of narrowing one filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The layering, depgraph, and affected-selector gates each parse the whole production source
tree, and the job waited for all three in sequence: 62.5 + 18.8 + 24.8 seconds averaged over
recent runs, against a 2.7-minute job. They read the same tree and write nothing one another
reads, so the order between them carries no meaning.

Run them as one parallel group, the shape the lint, typecheck, and format gates already use
in this workflow, so the job pays the slowest reader instead of the sum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.38 MB 6.38 MB 0 B
Package (unpacked) 6.38 MB 6.38 MB 0 B
Package (download) 1.94 MB 1.94 MB -1 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 37.5 ms 58.6 ms +21.1 ms
CLI --help 69.2 ms 114.8 ms +45.6 ms

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 967f029

No open findings.

Reviewed with this repository's own Sentinel configuration (655ede2796e5).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at 967f029, and I found no blocking issues. All 21 checks pass, and the changed workflows ran themselves: the merged Docs job, Test App Build Cache (the fingerprint step passed) and the Repo Guards parallel group. There are no conflicts, and nothing else needs to happen before merge.

Not blocking, and you can take or leave these: the comment at test-app-build-cache.yml#L36 says the filter lists what the job's own steps read, but the test-app gates run through .github/actions/run-gate/**, which is not listed, so either add it or soften the comment. A PR that touches none of the listed paths gets no producer run, so if main's fingerprint changed in the last ~20 minutes the consumer may build inline after about 90s instead of waiting for main's artifact; this needs no change unless run data shows it. The concurrency group at L50 is another copy of the one used by most workflows, so a later gate that checks every pull_request workflow declares it would be a fair follow-up.

The 117-of-120 run counts and runner-minute figures come from the PR body. The "reuse main's artifact" route for a PR that touches none of the listed paths has not run yet, so it rests on the workflow code.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 17, 2026
@thymikee
thymikee merged commit 7396fa7 into main Nov 18, 2026
21 checks passed
@thymikee
thymikee deleted the ci/runner-waste branch November 18, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant