diff --git a/crates/turborepo-lib/src/run/scope/filter.rs b/crates/turborepo-lib/src/run/scope/filter.rs index 7bb31423f9382..b16924d430ab1 100644 --- a/crates/turborepo-lib/src/run/scope/filter.rs +++ b/crates/turborepo-lib/src/run/scope/filter.rs @@ -201,6 +201,7 @@ impl<'a, T: GitChangeDetector> FilterResolver<'a, T> { include_uncommitted: true, allow_unknown_objects: true, }), + include_dependents: true, ..Default::default() }); } diff --git a/turborepo-tests/integration/tests/affected-rdeps.t b/turborepo-tests/integration/tests/affected-rdeps.t new file mode 100644 index 0000000000000..44b8e8762761f --- /dev/null +++ b/turborepo-tests/integration/tests/affected-rdeps.t @@ -0,0 +1,19 @@ +Setup + $ . ${TESTDIR}/../../helpers/setup_integration_test.sh + +Create a new branch + $ git checkout -b my-branch + Switched to a new branch 'my-branch' + +Edit a file that affects `util` package + $ echo "foo" >> packages/util/index.js +Commit the change + $ git add . + $ git commit -m "add foo" --quiet + +Validate that we run `util#build` and all rdeps + $ ${TURBO} run build --affected --dry=json | jq '.tasks | map(select(.command != "")) | map(.taskId)| sort' + [ + "my-app#build", + "util#build" + ]