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

fix: Inference with workspace config #3938

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cli/integration_tests/prune/composable-config.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ Setup
$ . ${TESTDIR}/setup.sh $(pwd)

Make sure that the internal util package is part of the prune output
$ ${TURBO} prune --scope=docs
$ ${TURBO} prune --scope=docs --out-dir ../out
Generating pruned monorepo for docs in .*\/out (re)
- Added docs
- Added shared
- Added util
$ cd out && ${TURBO} run new-task
$ cd ../out && ${TURBO} run new-task
WARNING cannot find a .git folder. Falling back to manual file hashing (which may be slower). If you are running this build in a pruned directory, you can ignore this message. Otherwise, please initialize a git repository in the root of your monorepo
\xe2\x80\xa2 Packages in scope: docs, shared, util (esc)
\xe2\x80\xa2 Running new-task in 3 packages (esc)
Expand Down
6 changes: 3 additions & 3 deletions cli/integration_tests/prune/produces_valid_turbo_json.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ Setup
$ . ${TESTDIR}/setup.sh $(pwd)

Make sure that the internal util package is part of the prune output
$ ${TURBO} prune --scope=docs
$ ${TURBO} prune --scope=docs --out-dir ../out
Generating pruned monorepo for docs in .*/out (re)
- Added docs
- Added shared
- Added util

Make sure we prune tasks that reference a pruned workspace
$ cat out/turbo.json | jq
$ cat ../out/turbo.json | jq
{
"pipeline": {
"build": {
Expand All @@ -27,7 +27,7 @@ Make sure we prune tasks that reference a pruned workspace
}

Verify turbo can read the produced turbo.json
$ cd out
$ cd ../out
$ ${TURBO} build --dry=json | jq '.packages'
WARNING cannot find a .git folder. Falling back to manual file hashing (which may be slower). If you are running this build in a pruned directory, you can ignore this message. Otherwise, please initialize a git repository in the root of your monorepo
[
Expand Down
3 changes: 2 additions & 1 deletion crates/turborepo-lib/src/shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ impl RepoState {
// that contains a `turbo.json` file.
let root_path = current_dir
.ancestors()
.find(|p| fs::metadata(p.join(TURBO_JSON)).is_ok());
.filter(|p| fs::metadata(p.join(TURBO_JSON)).is_ok())
.last();

// If that directory exists, then we figure out if there are workspaces defined
// in it NOTE: This may change with multiple `turbo.json` files
Expand Down