-
Notifications
You must be signed in to change notification settings - Fork 2k
feat: allow specifying concurrency in config / environment #10236
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
feat: allow specifying concurrency in config / environment #10236
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@kade-robertson is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
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.
Thank you so much for the contribution. Everything looks good aside from the removing of the inputs.execution_args
reference in opts
.
If you could rebase, I'll work on getting this merged and released in the next canary. Thank you for the contribution! |
4296e89
to
447b0e8
Compare
Should be good to go! |
Description
This adds a couple new ways to configure task run concurrency:
TURBO_CONCURRENCY
environment variableconcurrency
configuration value inturbo.json
These options should follow the same precedence rules for other options which are made available in multiple locations. I think the environment variable is the most valuable to me (IMO), as this would make it a lot easier to turn off or drastically reduce concurrency in CI scenarios with restricted performance, where running multiple test suites at the same time could cause flaky results due to timeouts, or too much resource contention in general scenarios. Being able to specify this in the configuration file is maybe less valuable, but there are situations where it might be desirable.
The
--concurrency
option is obviously already available and certainly usable in combination with other changes (enforcing the use of an alias, or setting up differentpackage.json
scripts for CI and local development), but enabling this to be enforced via the config or an environment variable makes it a lot easier to turn off concurrency in CI, for example.There is some active desire for this feature to exist:
Notably, this does not enable configuring concurrency per task, which was part of one of the discussions here. That seemed like a much larger lift vs. just adding an environment variable and config option that behaved exactly like the CLI argument already does. There is still some demand for this "simple" option.
Testing Instructions
turbo
turbo.json
, with the same behaviour as the CLI argument.TURBO_CONCURRENCY
environment variable, with the same behaviour as the CLI argument.I've done this checks (with some print debugging) on repos where I use
turbo
and it seems to work as expected. I've added some unit and integration tests where it seemed to make the most sense, but there were some spots where it was unclear if I should add something. If I've missed a spot or need some additional checks, let me know!