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

docs: Update wording for using --affected filter #9591

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion crates/turborepo-lib/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ pub struct ExecutionArgs {
#[clap(short = 'F', long, group = "scope-filter-group")]
pub filter: Vec<String>,

/// 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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]`
Expand Down
2 changes: 1 addition & 1 deletion turborepo-tests/integration/tests/no-args.t
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Make sure exit code is 2 when no args are passed
-F, --filter <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 <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 <LOG_ORDER>
Expand Down
4 changes: 2 additions & 2 deletions turborepo-tests/integration/tests/turbo-help.t
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Test help flag
-F, --filter <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 <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 <LOG_ORDER>
Expand Down Expand Up @@ -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 <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)
Expand Down
Loading