-
Notifications
You must be signed in to change notification settings - Fork 2k
scope or since implies include dependencies and no dependents #844
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
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/vercel/turbo-site/E23SRQgKjGBmUfXXtnnVSMP97DCX |
probably add |
Going through implementation, I think we end up in the following situation:
This means that:
Are there scenarios where we might want |
Sharing some thoughts there on past conversations with @jaredpalmer: Turbo should always run what it needs to accomplish a requested task. A task can be "requested" in three different ways, turbo run test # test for every package is being requested
turbo run test --since main # test for every package that has changed since `main` is being requested
turbo run test --scope=foo # test for the package foo is being requested So in the first case the expectation is that For the second case, the same logic applies, but instead of running For the third case, then If for some reason I want to target a task without including its dependencies, I would reach for And finally, if I did want to include dependent tasks then I would go for Something interesting to note is that the Tools like pnpm use their syntax so model dependencies across packages since it's a package manager. But since Turbo is doing something lower level, dependencies between tasks and other arbitrary inputs (e.g., files in filesystem or env vars), the syntax might need to be about dependencies across tasks, not packages. For people that are used to Lerna or pnpm, this might be a bit of an issue as they search for capabilities or running a specific task (i.e., |
Would it be helpful if we split |
Hmm, it would be nice if there was a single A detailed list of the relevant options and whether they're designed to act on the package graph or the task graph would be super useful! |
@migueloller agreed that there's confusion between task- and package-level dependencies. I think the particular change in this PR is not making that better, so we'll close it. What do you think about |
@gsoltis, so would As far as distinguishing between tasks and packages, here's some thoughts:
Anyhow, that last example is a bit contrived. It's possible that there is no need to handle package dependents. I think that having an example repo where we can explore actual use cases would be a great way to explore what is and isn't needed and what behaviors feel most intuitive. |
@migueloller The idea is that As you say, there would be an entrypoint that defines the task to be run, So, in the case of:
I think the first example would be the equivalent of running a task in one package, as long as that task didn't have any task-dependencies. I'm not sure what the scenario would be to run only a specific task without running its task-dependencies first, but if you have a use case in mind, we can take that into account. I think your last scenario is covered by using package-dependency and task-equality to determine what gets run in the library case. |
Pretty excited about the |
@gsoltis, just went over the RFC. It looks great! I think you're right that there probably isn't a case where you want to run a task but don't want to run its dependencies. I looked around in my repo and the only places that I avoided to use Something interesting about this RFC is that it could be expanded to support filtering the task graph. i.e., |
Note that merge base is #830
Change
--scope
and--since
to each independently imply--include-dependencies
and--no-deps
.Note that I'm not sure how a user could request to build dependents now though.
@jaredpalmer what do you think about changing the flags to support something like
--no-deps=false
to allow users to request that they do want dependents built?