Skip to content

Commit edc16d5

Browse files
authored
docs: Add Git history requirements to turbo query affected docs (#12426)
## Summary - `turbo query affected` has the same shallow-checkout pitfall as `--affected` but the docs didn't mention it. Without sufficient Git history, all packages are silently treated as changed — a confusing failure mode in CI. - Adds the same `<Callout type="warn">` (with the `--filter=blob:none --depth=0` recommendation) to the `turbo query affected` reference and the skipping tasks guide, and strengthens the existing mention in the constructing CI guide.
1 parent 01c56cc commit edc16d5

3 files changed

Lines changed: 21 additions & 1 deletion

File tree

apps/docs/content/docs/crafting-your-repository/constructing-ci.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ As your codebase and CI grow, you may start to look for more ways to get even fa
9393
<Step>
9494
### Checkout the repository
9595

96-
Start by cloning your repository. A clone with sufficient history is necessary for comparisons. By default, `turbo query affected` compares against the merge-base with your default branch.
96+
Start by cloning your repository. A clone with sufficient history is necessary for comparisons — if the checkout is too shallow, all packages will be considered changed. For example, cloning with `--filter=blob:none --depth=0` will ensure the right history is available.
97+
98+
By default, `turbo query affected` compares against the merge-base with your default branch.
9799

98100
</Step>
99101
<Step>

apps/docs/content/docs/guides/skipping-tasks.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ Ideally, you would do a quick check to see if any of that work needs to happen i
2121

2222
## Using `turbo query affected`
2323

24+
<Callout type="warn">
25+
The comparison requires everything between base and head to exist in the
26+
checkout. If the checkout is too shallow, then all packages will be considered
27+
changed.
28+
29+
For example, setting up Git to check out with `--filter=blob:none --depth=0` will ensure `turbo query affected` has the right history to work correctly.
30+
31+
</Callout>
32+
2433
After you've checked out the repo, but **before** any other work, you can take a few seconds to check if your `web` workspace is affected by the changes in your branch:
2534

2635
```bash title="Terminal"

apps/docs/content/docs/reference/query.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,15 @@ Check which packages or tasks are affected by changes between two git refs.
109109
turbo query affected [flags]
110110
```
111111

112+
<Callout type="warn">
113+
The comparison requires everything between base and head to exist in the
114+
checkout. If the checkout is too shallow, then all packages will be considered
115+
changed.
116+
117+
For example, setting up Git to check out with `--filter=blob:none --depth=0` will ensure `turbo query affected` has the right history to work correctly.
118+
119+
</Callout>
120+
112121
With no flags, returns all affected tasks:
113122

114123
```bash title="Terminal"

0 commit comments

Comments
 (0)