-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Dry run doesn't output tasks that changed for modified root workspace inputs #8762
Comments
I realize we have an error in our documentation. The filter you want is For all except package negation ( |
While that clarifies the usage, my use case still isn't working even with ➜ workspace git:(master) yarn turbo run build --filter="[HEAD~1]" --dry
Packages in Scope
Name Path
Global Hash Inputs
Global Files = 0
External Dependencies Hash = cab80e071f9bd92a
Global Cache Key = I can’t see ya, but I know you’re here
Global Env Vars =
Global Env Vars Values =
Inferred Global Env Vars Values =
Global Passed Through Env Vars =
Global Passed Through Env Vars Values =
Engines Values =
Tasks to Run
➜ workspace git:(master)
➜ workspace git:(master) yarn turbo run build --filter="[HEAD~2]" --dry
Packages in Scope
Name Path
foo packages/foo
Global Hash Inputs
Global Files = 0
External Dependencies Hash = cab80e071f9bd92a
Global Cache Key = I can’t see ya, but I know you’re here
Global Env Vars =
Global Env Vars Values =
Inferred Global Env Vars Values =
Global Passed Through Env Vars =
Global Passed Through Env Vars Values =
Engines Values =
Tasks to Run
bar#build
Task = build
Package = bar
Hash = 3565ae58cc7f544e
Cached (Local) = false
Cached (Remote) = false
Directory = packages/bar
Command = echo 'build bar'
Outputs =
Log File = packages/bar/.turbo/turbo-build.log
Dependencies =
Dependents = foo#build
Inputs Files Considered = 3
Env Vars =
Env Vars Values =
Inferred Env Vars Values =
Passed Through Env Vars =
Passed Through Env Vars Values =
Resolved Task Definition = {"outputs":[],"cache":true,"dependsOn":["^build"],"inputs":[],"outputLogs":"full","persistent":false,"env":[],"passThroughEnv":null,"interactive":false}
Framework =
foo#build
Task = build
Package = foo
Hash = c4f79d52425be1b6
Cached (Local) = false
Cached (Remote) = false
Directory = packages/foo
Command = echo 'build foo'
Outputs =
Log File = packages/foo/.turbo/turbo-build.log
Dependencies = bar#build
Dependents =
Inputs Files Considered = 4
Env Vars =
Env Vars Values =
Inferred Env Vars Values =
Passed Through Env Vars =
Passed Through Env Vars Values =
Resolved Task Definition = {"outputs":[],"cache":true,"dependsOn":["^build"],"inputs":["$TURBO_DEFAULT$","../../.root/*"],"outputLogs":"full","persistent":false,"env":[],"passThroughEnv":null,"interactive":false}
Framework = However, they don't show same result. I know |
Can you try |
### Description Closes #8762 by updating docs to provide the correct filter for the description. Multiple filters are combined via union so `--filter=./apps/* --filter=[HEAD^1]` is really "all packages that are in `apps/` *or* have changed since `HEAD^1`". ### Testing Instructions Quick verify that my understanding is correct: ``` # Only web was changed in the last commit [0 olszewski@chriss-mbp] /tmp/foobar $ turbo build --filter='[HEAD^1]' --dry=json | jq '.tasks | map(.taskId)' [ "web#build" ] # All of these are run if we filter to all packages in apps/ [0 olszewski@chriss-mbp] /tmp/foobar $ turbo build --filter='./apps/*' --dry=json | jq '.tasks | map(.taskId)' [ "@repo/eslint-config#build", "@repo/typescript-config#build", "@repo/ui#build", "docs#build", "web#build" ] # Union is taken with multiple filters [0 olszewski@chriss-mbp] /tmp/foobar $ turbo build --filter='./apps/*' --filter='[HEAD^1]' --dry=json | jq '.tasks | map(.taskId)' [ "@repo/eslint-config#build", "@repo/typescript-config#build", "@repo/ui#build", "docs#build", "web#build" ] # Intersection is taken with this syntax [0 olszewski@chriss-mbp] /tmp/foobar $ turbo build --filter='{./apps/*}[HEAD^1]' --dry=json | jq '.tasks | map(.taskId)' [ "web#build" ] ```
@mehulkar I ran three runs using ➜ workspace git:(master) yarn turbo run build --dry=json --filter="[HEAD]"
{
"id": "2jeQm18Xk07gBZFkx3eoUVNKTPP",
"version": "1",
"turboVersion": "2.0.7-canary.1",
"monorepo": true,
"globalCacheInputs": {
"rootKey": "I can’t see ya, but I know you’re here",
"files": {},
"hashOfExternalDependencies": "cab80e071f9bd92a",
"hashOfInternalDependencies": "",
"environmentVariables": {
"specified": {
"env": [],
"passThroughEnv": null
},
"configured": [],
"inferred": [],
"passthrough": null
},
"engines": null
},
"packages": [],
"envMode": "strict",
"frameworkInference": true,
"tasks": [],
"user": "",
"scm": {
"type": "git",
"sha": "5c9071ab44e2ec2f1266f81beb80c559dca9fd06",
"branch": "master"
}
} Above output expected, with no changes on HEAD. ➜ workspace git:(master) yarn turbo run build --dry=json --filter="[HEAD~1]"
{
"id": "2jeQn5fEZ21pJul9ko7X65qUFeE",
"version": "1",
"turboVersion": "2.0.7-canary.1",
"monorepo": true,
"globalCacheInputs": {
"rootKey": "I can’t see ya, but I know you’re here",
"files": {},
"hashOfExternalDependencies": "cab80e071f9bd92a",
"hashOfInternalDependencies": "",
"environmentVariables": {
"specified": {
"env": [],
"passThroughEnv": null
},
"configured": [],
"inferred": [],
"passthrough": null
},
"engines": null
},
"packages": [
"//"
],
"envMode": "strict",
"frameworkInference": true,
"tasks": [],
"user": "",
"scm": {
"type": "git",
"sha": "5c9071ab44e2ec2f1266f81beb80c559dca9fd06",
"branch": "master"
}
} Above output not expected, only outputs root package that has changed. But foo package should detect changes from root. ➜ workspace git:(master) yarn turbo run build --dry=json --filter="[HEAD~2]"
{
"id": "2jeQndZbeFl8TAxy8tKxkLFLUuO",
"version": "1",
"turboVersion": "2.0.7-canary.1",
"monorepo": true,
"globalCacheInputs": {
"rootKey": "I can’t see ya, but I know you’re here",
"files": {},
"hashOfExternalDependencies": "cab80e071f9bd92a",
"hashOfInternalDependencies": "",
"environmentVariables": {
"specified": {
"env": [],
"passThroughEnv": null
},
"configured": [],
"inferred": [],
"passthrough": null
},
"engines": null
},
"packages": [
"//",
"foo"
],
"envMode": "strict",
"frameworkInference": true,
"tasks": [
{
"taskId": "bar#build",
"task": "build",
"package": "bar",
"hash": "3565ae58cc7f544e",
"inputs": {
"bar": "6332e25f7949f16f81f6c45edcc296cd78efd9b4",
"package.json": "cf49a1974a1e6505e4d3edfb74cc0c317386464d",
"turbo.json": "95960709b10d9e4fa91f251ffafe0819e1a4e681"
},
"hashOfExternalDependencies": "7d7cdc66c0570bf8",
"cache": {
"local": false,
"remote": false,
"status": "MISS",
"timeSaved": 0
},
"command": "echo 'build bar'",
"cliArguments": [],
"outputs": null,
"excludedOutputs": null,
"logFile": "packages/bar/.turbo/turbo-build.log",
"directory": "packages/bar",
"dependencies": [],
"dependents": [
"foo#build"
],
"resolvedTaskDefinition": {
"outputs": [],
"cache": true,
"dependsOn": [
"^build"
],
"inputs": [],
"outputLogs": "full",
"persistent": false,
"env": [],
"passThroughEnv": null,
"interactive": false
},
"expandedOutputs": [],
"framework": "",
"envMode": "strict",
"environmentVariables": {
"specified": {
"env": [],
"passThroughEnv": null
},
"configured": [],
"inferred": [],
"passthrough": null
}
},
{
"taskId": "foo#build",
"task": "build",
"package": "foo",
"hash": "c4f79d52425be1b6",
"inputs": {
"../../.root/foo": "53ed2f08cfcc441eeae915cdebc5225d64c1ad83",
"package.json": "f9f7da0a9a715a67de735decd64899af44c62f2b",
"test": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
"turbo.json": "293cba7f07f40acf360f85dbe4b38c18b5d614d8"
},
"hashOfExternalDependencies": "7d7cdc66c0570bf8",
"cache": {
"local": false,
"remote": false,
"status": "MISS",
"timeSaved": 0
},
"command": "echo 'build foo'",
"cliArguments": [],
"outputs": null,
"excludedOutputs": null,
"logFile": "packages/foo/.turbo/turbo-build.log",
"directory": "packages/foo",
"dependencies": [
"bar#build"
],
"dependents": [],
"resolvedTaskDefinition": {
"outputs": [],
"cache": true,
"dependsOn": [
"^build"
],
"inputs": [
"$TURBO_DEFAULT$",
"../../.root/*"
],
"outputLogs": "full",
"persistent": false,
"env": [],
"passThroughEnv": null,
"interactive": false
},
"expandedOutputs": [],
"framework": "",
"envMode": "strict",
"environmentVariables": {
"specified": {
"env": [],
"passThroughEnv": null
},
"configured": [],
"inferred": [],
"passthrough": null
}
}
],
"user": "",
"scm": {
"type": "git",
"sha": "5c9071ab44e2ec2f1266f81beb80c559dca9fd06",
"branch": "master"
}
} Above output is expected since I've made a change in foo package's |
Just nothing one work around at the moment is adding |
@psychobolt Apologies for misunderstanding the issue initially. There are two ways to possibly go about working around this shortcoming:
The crux of the issue is that our |
Verify canary release
Link to code that reproduces this issue
https://codesandbox.io/p/devbox/test-turbo-inputs-lwndsy
What package manager are you using / does the bug impact?
Yarn v2/v3/v4 (node_modules linker only)
What operating system are you using?
Mac
Which canary version will you have in your reproduction?
2.0.7-canary.1
Describe the Bug
With the new v2, I'm not sure if dry run will output what packages has changed if workspace is filtered e.g.
workspaces/*...
. It seems to always print the same result.Expected Behavior
Only show tasks for workspaces that changed
To Reproduce
My use case for this sandbox seems to not work e.g.
yarn turbo run build --filter=./packages/\* --filter=\[HEAD\] --dry
andyarn turbo run build --filter=./packages/\* --filter=\[HEAD^1\] --dry
. I have one workspace with the following config:git diff HEAD
shows 0 change.git diff HEAD^1
shows 1 change (root workspace input):Additional context
You will get similar output for HEAD and HEAD^1:
The text was updated successfully, but these errors were encountered: