Files
orca/config/scripts/bun-profile-qualification.mjs
T
Neil f8f656ca19 perf(ci): spend fewer concurrency slots per pull request (#23810)
A concurrency slot is charged per job, not per core, and the account's cap is
the scarce resource: standard runner minutes are free and unlimited on a public
repository. Two paths spent slots that bought nothing.

The unit matrix ran eight fixed shards averaging 6.5 minutes each, 3384
job-slots a day and 68% of all slot demand, while the arm pool queued 10.5
minutes at p95 — the queue was the oversharding. Five shards run the same work
in ~10.5 minutes each for three fewer slots per run.

Bun profile persistence escalated to all six platforms on `config/`,
`resources/` and `.github/` wholesale, which took 36.5% of the last 1100
commits through the full matrix where a platform-flavoured predicate takes 19%.
A pull request now qualifies one platform unless the change is platform-
flavoured, and the push to main re-qualifies all six, so an unescalated miss
surfaces minutes after merge rather than at the next cron. Missing changed-file
evidence and an unavailable dependency graph still fail closed to all six.
2026-09-29 00:13:33 -07:00

44 lines
1.5 KiB
JavaScript

export const BUN_PERSISTENCE_RUNNERS = [
'ubuntu-22.04',
'ubuntu-24.04-arm',
'macos-14',
'macos-15-intel',
'windows-2022',
'windows-11-arm'
]
// Only surfaces whose behaviour actually differs per platform. Escalating on `config/`,
// `resources/` and `.github/` wholesale took 36.5% of the last 1100 commits through all six
// platforms where a platform-flavoured predicate takes 19%.
const PLATFORM_PREFIXES = [
'native/',
'config/patches/',
'.github/actions/install-node-dependencies/',
'src/main/persistence/',
'src/main/sqlite/',
'src/main/orcad/',
'src/main/providers/',
'src/main/daemon/',
'src/main/ssh/',
'src/main/wsl/',
'src/relay/',
'src/shared/child-process/'
]
export function bunProfileQualification(changedFiles, scope) {
const platformSpecific = changedFiles.some(
(file) =>
// A root manifest can move a native dependency on every platform at once.
!file.includes('/') ||
PLATFORM_PREFIXES.some((prefix) => file.startsWith(prefix)) ||
/(?:^|[/.-])(?:windows|win32|wsl|macos|darwin|linux|posix|bun)(?:[/.-]|$)/i.test(file)
)
// A pull request qualifies one platform unless the change is platform-flavoured; the push to
// main re-qualifies all six, so an unescalated miss surfaces minutes after merge, not a day.
const full = changedFiles.length === 0 || scope.graphUnavailable === true || platformSpecific
return {
qualification: full,
runners: full ? BUN_PERSISTENCE_RUNNERS : ['ubuntu-22.04']
}
}