Scope capacities for build-tool scopes, patterns and serial queues
Give a capacity to the scopes Bazel, Pants or Turborepo report, cap every scope a pattern such as `@acme/*` matches, and use scope capacities in a serial queue.
scopes.capacities only accepted letters, digits, - and _ in its keys, so the scope names Bazel (//lib/core), Pants (lib/util) and Turborepo (@acme/web) report could not be given a capacity. A capacity key now accepts any scope name you send through the scopes API.
A key can also be a glob pattern, such as //lib/** or @acme/*. Every scope it matches gets its own capacity, so a whole family of lanes can be capped without listing each one. A key naming the scope exactly wins over a pattern, the lowest capacity applies when several patterns match, and default_capacity still covers every scope no key matches.
Scope capacities also work in a serial queue, the default mode, which used to refuse them. A serial queue still runs up to max_parallel_checks speculative checks, so you can keep an expensive scope, such as an end-to-end suite, to one check at a time while the rest of the queue uses the other slots. A pull request whose scope is full waits for a slot there while later pull requests that fit go ahead, and it is still tested on top of everything that merges before it.
Was this page helpful?
Thanks for your feedback!