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(filter): no longer infer scope in filters #8137

Conversation

chris-olszewski
Copy link
Member

Description

Previously we would infer scope for name filters if there was exactly one matching package.
e.g. turbo build --filter=ui would run @a/ui#build if there was a @a/ui package in the workspace

This is confusing and can result in accidentally breaking filters when a conflicting package is added e.g. adding @b/ui would cause no tasks to be run along with a zero exit code.

Testing Instructions

Updated unit test to verify inference no longer works and using the explicit package name still works.

Copy link

vercel bot commented May 14, 2024

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

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

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

github-actions bot commented May 14, 2024

🟢 Turbopack Benchmark CI successful 🟢

Thanks

Copy link
Contributor

github-actions bot commented May 14, 2024

🟢 CI successful 🟢

Thanks

@chris-olszewski chris-olszewski merged commit c0ca43b into turborepo_2 May 15, 2024
55 checks passed
@chris-olszewski chris-olszewski deleted the chrisolszewski/turbo-3125-stop-inference-of-package-names-in-scope branch May 15, 2024 00:20
chris-olszewski added a commit that referenced this pull request May 20, 2024
### Description

Previously we would infer scope for name filters if there was exactly
one matching package.
e.g. `turbo build --filter=ui` would run `@a/ui#build` if there was a
`@a/ui` package in the workspace

This is confusing and can result in accidentally breaking filters when a
conflicting package is added e.g. adding `@b/ui` would cause *no* tasks
to be run along with a zero exit code.

### Testing Instructions

Updated unit test to verify inference no longer works and using the
explicit package name still works.
chris-olszewski added a commit that referenced this pull request May 22, 2024
### Description

Previously we would infer scope for name filters if there was exactly
one matching package.
e.g. `turbo build --filter=ui` would run `@a/ui#build` if there was a
`@a/ui` package in the workspace

This is confusing and can result in accidentally breaking filters when a
conflicting package is added e.g. adding `@b/ui` would cause *no* tasks
to be run along with a zero exit code.

### Testing Instructions

Updated unit test to verify inference no longer works and using the
explicit package name still works.
chris-olszewski added a commit that referenced this pull request May 28, 2024
### Description

Previously we would infer scope for name filters if there was exactly
one matching package.
e.g. `turbo build --filter=ui` would run `@a/ui#build` if there was a
`@a/ui` package in the workspace

This is confusing and can result in accidentally breaking filters when a
conflicting package is added e.g. adding `@b/ui` would cause *no* tasks
to be run along with a zero exit code.

### Testing Instructions

Updated unit test to verify inference no longer works and using the
explicit package name still works.
chris-olszewski added a commit that referenced this pull request May 29, 2024
### Description

Previously we would infer scope for name filters if there was exactly
one matching package.
e.g. `turbo build --filter=ui` would run `@a/ui#build` if there was a
`@a/ui` package in the workspace

This is confusing and can result in accidentally breaking filters when a
conflicting package is added e.g. adding `@b/ui` would cause *no* tasks
to be run along with a zero exit code.

### Testing Instructions

Updated unit test to verify inference no longer works and using the
explicit package name still works.
chris-olszewski added a commit that referenced this pull request May 31, 2024
### Description

Previously we would infer scope for name filters if there was exactly
one matching package.
e.g. `turbo build --filter=ui` would run `@a/ui#build` if there was a
`@a/ui` package in the workspace

This is confusing and can result in accidentally breaking filters when a
conflicting package is added e.g. adding `@b/ui` would cause *no* tasks
to be run along with a zero exit code.

### Testing Instructions

Updated unit test to verify inference no longer works and using the
explicit package name still works.
chris-olszewski added a commit that referenced this pull request Jun 4, 2024
### Description

Previously we would infer scope for name filters if there was exactly
one matching package.
e.g. `turbo build --filter=ui` would run `@a/ui#build` if there was a
`@a/ui` package in the workspace

This is confusing and can result in accidentally breaking filters when a
conflicting package is added e.g. adding `@b/ui` would cause *no* tasks
to be run along with a zero exit code.

### Testing Instructions

Updated unit test to verify inference no longer works and using the
explicit package name still works.
@FlorianWendelborn
Copy link

FlorianWendelborn commented Jun 5, 2024

Can this be put behind a flag or something? It's super annoying to have to type the namespace all day. This isn't an issue unless you add the same package name twice, which is a severe skill issue anyway. Why make things unnecessarily hard and annoying to type for the 99.9% of normal users?

Can we at least get an option for a default namespace so we don't have to type it over and over all day if it matches the default NS?

@tiagobento
Copy link

Referring to https://turbo.build/repo/docs/reference/run, I think there's a similar situation that happens to script names.
image

For local development, writing the scope is indeed annoying, but for CI, I can see why writing the full package names is the right call.

Would it be possible to force full package names on CI, and have the old behavior still work for local development?

@mctrafik
Copy link

mctrafik commented Jun 18, 2024

+1. This is a degradation in user experience. On conflict, the command should run on all the matches as the obvious behavior. This would be the expected fix. I.e. if I have 5 apps in the repo, and there are 5 ui packages, one for each app, it's a very convenient feature to test them all with turbo test --filter=ui. Addition thought is that if it's a private github repo, and the company name is long or is composite, it's very annoying to have to type all of this out, now: turbo test --filter=@my-company-my-product-my-app/ui

I started a discussion here: #8524

@anthonyshew
Copy link
Contributor

Answered some concerns here: #8524 (comment)

@mctrafik
Copy link

Elaborated that your answer doesn't address my concerns here: #8524 (comment)

denolfe added a commit to payloadcms/payload that referenced this pull request Aug 28, 2024
Updating all turborepo npm scripts for this rather inconvenient breaking
change: vercel/turborepo#8137
DerMolly added a commit to hedgedoc/hedgedoc that referenced this pull request Aug 31, 2024
turbo now wants you to specify the whole name and not just part of the name.

See: vercel/turborepo#8137
Signed-off-by: Philip Molares <[email protected]>
DerMolly added a commit to hedgedoc/hedgedoc that referenced this pull request Aug 31, 2024
turbo now wants you to specify the whole name and not just part of the name.

See: vercel/turborepo#8137
Signed-off-by: Philip Molares <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants