Skip to content
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: --only now applies to package dependencies #8163

Merged

Conversation

chris-olszewski
Copy link
Member

Description

Change --only so it behaves in a more sensible way. It still shouldn't be widely used, but now it at least does what it says it does.

Previously --only would still follow package dependencies resulting additional tasks getting run that weren't expected.
e.g. for task definition "test": {"dependsOn": ["build", "^test"]} and package a depending on b, then turbo test --filter=a --only would result in both a#test and b#test being run. With this PR now only a#test will be run.

I changed the --only logic so now it will limit tasks in the graph to exactly those that are in the product of the packages implied by --filter and the tasks specified in the run args. This should make --only a far more sensible flag.

Testing Instructions

Added unit tests for testing the trimming of package dependencies and task id style dependencies e.g. "dependsOn": ["a#test"]

Copy link

vercel bot commented May 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 16, 2024 8:44pm
rust-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 16, 2024 8:44pm
8 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) May 16, 2024 8:44pm
examples-designsystem-docs ⬜️ Ignored (Inspect) May 16, 2024 8:44pm
examples-gatsby-web ⬜️ Ignored (Inspect) May 16, 2024 8:44pm
examples-kitchensink-blog ⬜️ Ignored (Inspect) May 16, 2024 8:44pm
examples-native-web ⬜️ Ignored (Inspect) May 16, 2024 8:44pm
examples-svelte-web ⬜️ Ignored (Inspect) May 16, 2024 8:44pm
examples-tailwind-web ⬜️ Ignored (Inspect) May 16, 2024 8:44pm
examples-vite-web ⬜️ Ignored (Inspect) May 16, 2024 8:44pm

@chris-olszewski chris-olszewski marked this pull request as ready for review May 16, 2024 20:45
@chris-olszewski chris-olszewski requested a review from a team as a code owner May 16, 2024 20:45
Copy link
Contributor

🟢 Turbopack Benchmark CI successful 🟢

Thanks

Copy link
Contributor

github-actions bot commented May 16, 2024

🟢 CI successful 🟢

Thanks

Copy link
Contributor

@mehulkar mehulkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not blocking, but it would be nice to have a prysk test for top level flags and their happy path behaviors.

.collect(),
)
} else {
None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this none? shouldn't it be all?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never mind, I saw the rest of the code and saw how allowed_tasks is used. the name of the method just threw me off

@chris-olszewski chris-olszewski merged commit 74fcf2d into turborepo_2 May 17, 2024
55 checks passed
@chris-olszewski chris-olszewski deleted the chrisolszewski/turbo-2705-change-only-behavior branch May 17, 2024 16:38
chris-olszewski added a commit that referenced this pull request May 20, 2024
### Description

Change `--only` so it behaves in a more sensible way. It still shouldn't
be widely used, but now it at least does what it says it does.

Previously `--only` would still follow package dependencies resulting
additional tasks getting run that weren't expected.
e.g. for task definition `"test": {"dependsOn": ["build", "^test"]}` and
package `a` depending on `b`, then `turbo test --filter=a --only` would
result in both `a#test` and `b#test` being run. With this PR now only
`a#test` will be run.

I changed the `--only` logic so now it will limit tasks in the graph to
exactly those that are in the product of the packages implied by
`--filter` and the tasks specified in the run args. This should make
`--only` a far more sensible flag.


### Testing Instructions

Added unit tests for testing the trimming of package dependencies and
task id style dependencies e.g. `"dependsOn": ["a#test"]`
chris-olszewski added a commit that referenced this pull request May 22, 2024
### Description

Change `--only` so it behaves in a more sensible way. It still shouldn't
be widely used, but now it at least does what it says it does.

Previously `--only` would still follow package dependencies resulting
additional tasks getting run that weren't expected.
e.g. for task definition `"test": {"dependsOn": ["build", "^test"]}` and
package `a` depending on `b`, then `turbo test --filter=a --only` would
result in both `a#test` and `b#test` being run. With this PR now only
`a#test` will be run.

I changed the `--only` logic so now it will limit tasks in the graph to
exactly those that are in the product of the packages implied by
`--filter` and the tasks specified in the run args. This should make
`--only` a far more sensible flag.


### Testing Instructions

Added unit tests for testing the trimming of package dependencies and
task id style dependencies e.g. `"dependsOn": ["a#test"]`
chris-olszewski added a commit that referenced this pull request May 28, 2024
### Description

Change `--only` so it behaves in a more sensible way. It still shouldn't
be widely used, but now it at least does what it says it does.

Previously `--only` would still follow package dependencies resulting
additional tasks getting run that weren't expected.
e.g. for task definition `"test": {"dependsOn": ["build", "^test"]}` and
package `a` depending on `b`, then `turbo test --filter=a --only` would
result in both `a#test` and `b#test` being run. With this PR now only
`a#test` will be run.

I changed the `--only` logic so now it will limit tasks in the graph to
exactly those that are in the product of the packages implied by
`--filter` and the tasks specified in the run args. This should make
`--only` a far more sensible flag.


### Testing Instructions

Added unit tests for testing the trimming of package dependencies and
task id style dependencies e.g. `"dependsOn": ["a#test"]`
chris-olszewski added a commit that referenced this pull request May 29, 2024
### Description

Change `--only` so it behaves in a more sensible way. It still shouldn't
be widely used, but now it at least does what it says it does.

Previously `--only` would still follow package dependencies resulting
additional tasks getting run that weren't expected.
e.g. for task definition `"test": {"dependsOn": ["build", "^test"]}` and
package `a` depending on `b`, then `turbo test --filter=a --only` would
result in both `a#test` and `b#test` being run. With this PR now only
`a#test` will be run.

I changed the `--only` logic so now it will limit tasks in the graph to
exactly those that are in the product of the packages implied by
`--filter` and the tasks specified in the run args. This should make
`--only` a far more sensible flag.


### Testing Instructions

Added unit tests for testing the trimming of package dependencies and
task id style dependencies e.g. `"dependsOn": ["a#test"]`
chris-olszewski added a commit that referenced this pull request May 31, 2024
### Description

Change `--only` so it behaves in a more sensible way. It still shouldn't
be widely used, but now it at least does what it says it does.

Previously `--only` would still follow package dependencies resulting
additional tasks getting run that weren't expected.
e.g. for task definition `"test": {"dependsOn": ["build", "^test"]}` and
package `a` depending on `b`, then `turbo test --filter=a --only` would
result in both `a#test` and `b#test` being run. With this PR now only
`a#test` will be run.

I changed the `--only` logic so now it will limit tasks in the graph to
exactly those that are in the product of the packages implied by
`--filter` and the tasks specified in the run args. This should make
`--only` a far more sensible flag.


### Testing Instructions

Added unit tests for testing the trimming of package dependencies and
task id style dependencies e.g. `"dependsOn": ["a#test"]`
chris-olszewski added a commit that referenced this pull request Jun 4, 2024
### Description

Change `--only` so it behaves in a more sensible way. It still shouldn't
be widely used, but now it at least does what it says it does.

Previously `--only` would still follow package dependencies resulting
additional tasks getting run that weren't expected.
e.g. for task definition `"test": {"dependsOn": ["build", "^test"]}` and
package `a` depending on `b`, then `turbo test --filter=a --only` would
result in both `a#test` and `b#test` being run. With this PR now only
`a#test` will be run.

I changed the `--only` logic so now it will limit tasks in the graph to
exactly those that are in the product of the packages implied by
`--filter` and the tasks specified in the run args. This should make
`--only` a far more sensible flag.


### Testing Instructions

Added unit tests for testing the trimming of package dependencies and
task id style dependencies e.g. `"dependsOn": ["a#test"]`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants