-
Notifications
You must be signed in to change notification settings - Fork 2k
fix(turbo): sort dependents and dependencies during normalization #7018
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e81d37d
fix(turbo): sort dependents and dependencies during normalization
mehulkar 19ab03e
oops
mehulkar 1848f9b
Update crates/turborepo-lib/src/run/summary/mod.rs
mehulkar 0df187a
bring back task sorting when converting to single package summary
mehulkar 159695b
test
mehulkar fe0ce03
Merge branch 'main' into mehulkar/turbo-2038
mehulkar c257a83
just use another fixture
mehulkar b1fcc29
simple
mehulkar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
turborepo-tests/integration/fixtures/with-pkg-deps/.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/ | ||
.turbo | ||
.npmrc |
10 changes: 10 additions & 0 deletions
10
turborepo-tests/integration/fixtures/with-pkg-deps/apps/my-app/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "my-app", | ||
"scripts": { | ||
"build": "echo building" | ||
}, | ||
"dependencies": { | ||
"another": "*", | ||
"util": "*" | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
turborepo-tests/integration/fixtures/with-pkg-deps/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "monorepo", | ||
"workspaces": [ | ||
"apps/**", | ||
"packages/**" | ||
] | ||
} |
6 changes: 6 additions & 0 deletions
6
turborepo-tests/integration/fixtures/with-pkg-deps/packages/another/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "another", | ||
"scripts": { | ||
"build": "echo building-another" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
turborepo-tests/integration/fixtures/with-pkg-deps/packages/util/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "util", | ||
"scripts": { | ||
"build": "echo building-util" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
turborepo-tests/integration/fixtures/with-pkg-deps/turbo.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"$schema": "https://turbo.build/schema.json", | ||
"pipeline": { | ||
"build": { | ||
"dependsOn": [ | ||
"^build" | ||
] | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
turborepo-tests/integration/tests/run-summary/sorting-deps.t
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh "with-pkg-deps" | ||
$ source "$TESTDIR/../_helpers/run-summary-utils.sh" | ||
|
||
$ rm -rf .turbo/runs | ||
$ git commit --quiet -am "new sha" --allow-empty && ${TURBO} run build --summarize > /dev/null 2>&1 | ||
$ SUMMARY=$(/bin/ls .turbo/runs/*.json | head -n1) | ||
$ getSummaryTaskId $SUMMARY "my-app#build" | jq .dependencies | ||
[ | ||
"another#build", | ||
"util#build" | ||
] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This
from
implementation is used by theinto()
call here: https://github.com/vercel/turbo/blob/1dd2e93e84e08872f67943804a6600f0e91a124a/crates/turborepo-lib/src/run/summary/task.rs#L211it only runs for
SinglePackageTaskSummary
. Since we have moved the sorting to thenormalize()
step, we shouldn't need it here.