From dd419bb278b0060b8b28e8f7af0ffa7d131b8138 Mon Sep 17 00:00:00 2001 From: Taesung Hwang <44419552+taesungh@users.noreply.github.com> Date: Sat, 7 Dec 2024 19:32:02 -0800 Subject: [PATCH] Update wording for using `--affected` filter - Filtering happens for packages with changes across git commits - Filtering does not consider inputs to tasks in those packages --- crates/turborepo-lib/src/cli/mod.rs | 2 +- docs/repo-docs/crafting-your-repository/constructing-ci.mdx | 2 +- docs/repo-docs/crafting-your-repository/running-tasks.mdx | 2 +- turborepo-tests/integration/tests/no-args.t | 2 +- turborepo-tests/integration/tests/turbo-help.t | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/turborepo-lib/src/cli/mod.rs b/crates/turborepo-lib/src/cli/mod.rs index 4082a63a6fceb..c03b4ac2a74bb 100644 --- a/crates/turborepo-lib/src/cli/mod.rs +++ b/crates/turborepo-lib/src/cli/mod.rs @@ -822,7 +822,7 @@ pub struct ExecutionArgs { #[clap(short = 'F', long, group = "scope-filter-group")] pub filter: Vec, - /// Run only tasks that are affected by changes between + /// Filter to only packages that are affected by changes between /// the current branch and `main` #[clap(long, group = "scope-filter-group", conflicts_with = "filter")] pub affected: bool, diff --git a/docs/repo-docs/crafting-your-repository/constructing-ci.mdx b/docs/repo-docs/crafting-your-repository/constructing-ci.mdx index 2640ada4eb145..07f6a0c6b9b3f 100644 --- a/docs/repo-docs/crafting-your-repository/constructing-ci.mdx +++ b/docs/repo-docs/crafting-your-repository/constructing-ci.mdx @@ -76,7 +76,7 @@ You'll want to use this flag in situations like: CI/CD pipelines are a perfect place to use `--affected`. With `--affected`, Turborepo can automatically detect that you're running in GitHub Actions by inspecting environment variables set by GitHub, like `GITHUB_BASE_REF`. -In the context of a PR, this means that Turborepo can determine which packages have changed between the PR's base branch and the PR's head branch. This allows you to run only the tasks that are affected by the changes in the PR. +In the context of a PR, this means that Turborepo can determine which packages have changed between the PR's base branch and the PR's head branch. This allows you to run tasks only for the packages that are affected by the changes in the PR. While `GITHUB_BASE_REF` works well in `pull_request` and `pull_request_target` events, it is not available during regular push events. In those cases, we use `GITHUB_EVENT_PATH` to determine the base branch to compare your commit to. In force pushes and pushing branch with no additionals commits, we compare to the parent of the first commit on the branch. diff --git a/docs/repo-docs/crafting-your-repository/running-tasks.mdx b/docs/repo-docs/crafting-your-repository/running-tasks.mdx index 72a35c56810be..d1e0e00ba0a40 100644 --- a/docs/repo-docs/crafting-your-repository/running-tasks.mdx +++ b/docs/repo-docs/crafting-your-repository/running-tasks.mdx @@ -159,7 +159,7 @@ turbo build --filter=...ui ### Filtering by source control changes -Using filters to run tasks based on changes in source control is a great way to run only the tasks for packages that are affected by your changes. **Source control filters must be wrapped in `[]`**. +Using filters to run tasks based on changes in source control is a great way to run tasks only for the packages that are affected by your changes. **Source control filters must be wrapped in `[]`**. - **Comparing to the previous commit**: `turbo build --filter=[HEAD^1]` - **Comparing to the main branch**: `turbo build --filter=[main...my-feature]` diff --git a/turborepo-tests/integration/tests/no-args.t b/turborepo-tests/integration/tests/no-args.t index e64f56b790bae..1d0c327af9ac0 100644 --- a/turborepo-tests/integration/tests/no-args.t +++ b/turborepo-tests/integration/tests/no-args.t @@ -111,7 +111,7 @@ Make sure exit code is 2 when no args are passed -F, --filter Use the given selector to specify package(s) to act as entry points. The syntax mirrors pnpm's syntax, and additional documentation and examples can be found in turbo's documentation https://turbo.build/repo/docs/reference/command-line-reference/run#--filter --affected - Run only tasks that are affected by changes between the current branch and `main` + Filter to only packages that are affected by changes between the current branch and `main` --output-logs Set type of process output logging. Use "full" to show all output. Use "hash-only" to show only turbo-computed task hashes. Use "new-only" to show only new output with only hashes for cached tasks. Use "none" to hide process output. (default full) [possible values: full, none, hash-only, new-only, errors-only] --log-order diff --git a/turborepo-tests/integration/tests/turbo-help.t b/turborepo-tests/integration/tests/turbo-help.t index c484db0230c7a..1104e5afa9d3e 100644 --- a/turborepo-tests/integration/tests/turbo-help.t +++ b/turborepo-tests/integration/tests/turbo-help.t @@ -111,7 +111,7 @@ Test help flag -F, --filter Use the given selector to specify package(s) to act as entry points. The syntax mirrors pnpm's syntax, and additional documentation and examples can be found in turbo's documentation https://turbo.build/repo/docs/reference/command-line-reference/run#--filter --affected - Run only tasks that are affected by changes between the current branch and `main` + Filter to only packages that are affected by changes between the current branch and `main` --output-logs Set type of process output logging. Use "full" to show all output. Use "hash-only" to show only turbo-computed task hashes. Use "new-only" to show only new output with only hashes for cached tasks. Use "none" to hide process output. (default full) [possible values: full, none, hash-only, new-only, errors-only] --log-order @@ -297,7 +297,7 @@ Test help flag Use the given selector to specify package(s) to act as entry points. The syntax mirrors pnpm's syntax, and additional documentation and examples can be found in turbo's documentation https://turbo.build/repo/docs/reference/command-line-reference/run#--filter --affected - Run only tasks that are affected by changes between the current branch and `main` + Filter to only packages that are affected by changes between the current branch and `main` --output-logs Set type of process output logging. Use "full" to show all output. Use "hash-only" to show only turbo-computed task hashes. Use "new-only" to show only new output with only hashes for cached tasks. Use "none" to hide process output. (default full)