Repository navigation
ci(tests): heavy jobs on vars.HEAVY_RUNNER (Latchkey medium), fork PRs stay on GitHub #2612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
cbe18a4
ci(tests): heavy jobs run on vars.HEAVY_RUNNER, default ubuntu-latest…
lilyshen0722 5d2f6ab
ci(tests): raise mongo service nofile ulimit (needed on Latchkey)
lilyshen0722 7002755
ci(tests): fork PRs stay on GitHub; runbook for HEAVY_RUNNER and the …
lilyshen0722 6da2ef6
ci(tests): state the HEAVY_RUNNER trust boundary accurately (fork PR …
lilyshen0722 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # CI heavy jobs on Latchkey runners (HEAVY_RUNNER) | ||
|
|
||
| The heavy jobs in `.github/workflows/tests.yml` (the three backend shards, | ||
| frontend tests and the Tier 1 service tests) run on whatever runner label the | ||
| repository variable `HEAVY_RUNNER` names, and on `ubuntu-latest` when it is | ||
| unset. The plan (D54, Sam 2026-10-24) is to set it to `latchkey-medium` once | ||
| the PR adding it merges: Latchkey runners don't count against the org's | ||
| 20-concurrent-job cap on GitHub-hosted runners, which was what made the merge | ||
| queue wait. | ||
|
|
||
| Everything else, including tool-tests, the guards, backend checks and chart | ||
| lint, stays on GitHub. Job names don't change either way, so the required check | ||
| ("Test & Coverage") and merge-queue runs are unaffected. | ||
|
|
||
| ## Trust boundary | ||
|
|
||
| - A fork PR's own `pull_request` run always uses `ubuntu-latest`. Unreviewed | ||
| fork code does not get a Latchkey runner from opening a PR. | ||
| - A `merge_group` run uses `HEAVY_RUNNER`, including a group that holds a | ||
| reviewed fork change. The expression does not inspect where queued PRs came | ||
| from. | ||
| - So queue admission is the trust decision: a maintainer puts a PR in the | ||
| queue only after its gate passed. A green test run, or this expression, does | ||
| not establish that trust. GitHub doesn't enforce the seat review either; the | ||
| ruleset requires only a green merge queue, so the review gate is operating | ||
| process. | ||
| - That is acceptable here because the Tests workflow grants only | ||
| `contents: read`, has no `pull_request_target` trigger, and exposes test | ||
| fixtures, not production secrets. Latchkey documents single-job VMs | ||
| destroyed after each job (vendor-published, not independently attested). | ||
|
|
||
| ## Flip back to GitHub-hosted | ||
|
|
||
| Do this if Latchkey is down, jobs sit queued with no runner, or the free | ||
| minutes run out: | ||
|
|
||
| ```bash | ||
| gh variable delete HEAVY_RUNNER --repo Team-Commonly/commonly | ||
| ``` | ||
|
|
||
| Runs that start after the delete go to `ubuntu-latest`. Runs already queued | ||
| keep the label they were given, so cancel and re-run those. To flip back to | ||
| Latchkey: `gh variable set HEAVY_RUNNER --body latchkey-medium --repo Team-Commonly/commonly`. | ||
|
|
||
| ## Why medium, and the Mongo ulimit | ||
|
|
||
| Measured 2026-10-24 on dispatch-only trial runs: | ||
|
|
||
| - **latchkey-small:** backend shards took 6.0, 12.7 and 16.6 minutes, against | ||
| 2.5 to 2.9 on GitHub. Slower overall, and more weighted minutes per run than | ||
| medium (about 40 against about 26). | ||
| - **latchkey-medium:** backend shards took about 3 minutes. | ||
| - **Mongo on Latchkey:** the `mongo:7` service container died with EMFILE ("Too | ||
| many open files") during index builds, then WT_PANIC, because the runner's | ||
| docker default `nofile` is low. `--ulimit nofile=64000:64000` on the service | ||
| fixes it; with it, the service tests passed 670 of 670 in 5.5 minutes. The | ||
| limit applies on GitHub-hosted runners too (it is not gated on the | ||
| variable); the service tests passed there with it on this PR's CI. | ||
|
|
||
| tool-tests stays on GitHub: its CLI PATH test fails on Latchkey, and its Jest | ||
| process doesn't exit. | ||
|
|
||
| Medium jobs count double against the free budget (14k minutes a month, plus a | ||
| 10k bonus to 2026-11-23). Check usage on the Latchkey dashboard before the | ||
| bonus ends. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔎 Supported by static analysis
Script executed:
Repository: Team-Commonly/commonly
Length of output: 16739
Script executed:
Repository: Team-Commonly/commonly
Length of output: 42263
Keep fork code off heavy runners for merge-group runs.
tests.ymltriggers onmerge_group, and a merge-group commit can contain queued fork-PR changes. For that event,github.event_name != 'pull_request'is true, so the expression selectsvars.HEAVY_RUNNERwhen it is set. This contradicts the workflow and runbook claim that fork code never reaches a third-party runner.Exclude
merge_groupfrom the heavy-runner branch in all three jobs. Add a regression check that evaluates a merge-group context withHEAVY_RUNNERset and expectsubuntu-latest; dispatch-only trials do not cover this path.Suggested fix
Apply the same change at the
frontend-testsandservice-testrunner expressions.Committable suggestion