Skip to content

Commit

Permalink
added a new section in Using Pants in CI on partial clones (#20028)
Browse files Browse the repository at this point in the history
Adds documentation to resolve #20026.

I opted for a standalone quote section and gave a nod to
the #20027 workaround.
  • Loading branch information
andreaimprovised authored and WorkerPants committed Oct 13, 2023
1 parent 2bddd2b commit d1bf03b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/markdown/Using Pants/using-pants-in-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,21 @@ See [Advanced target selection](doc:advanced-target-selection) for more informat
>
> The `git branch` commands are only included to print out all available branches before and after fetching `origin/main`.
> 📘 Using partial clones in CI
>
> Shallow clones are fast, but have the disadvantage of breaking `--changed-since` if an insufficient amount of depth is fetched from remote. This is particularly acute for feature branches that are very out-of-date or have a large number of commits.
>
> [Partial clones](https://git-scm.com/docs/partial-clone) are still quite fast, have the advantage of not breaking `--changed-since`, and don't require any depth setting. Unlike shallow clones, Git will fetch trees and blobs on-demand as it needs them without failing.
>
> If your CI does not support partial clones directly, you can define your own custom checkout strategy:
>
> * Treeless: `git clone --filter=tree:0 <repository>`
> * Blobless: `git clone --filter=blob:none <repository>`
>
> As a workaround to [#20027](https://github.com/pantsbuild/pants/issues/20027) permission errors, you might need to run this after the cloning the repo:
>
> `git config core.sshCommand "env SSH_AUTH_SOCK=$SSH_AUTH_SOCK ssh"`
### Approach #2: run over everything
Alternatively, you can simply run over all your code. Pants's caching means that you will not need to rerun on changed files.
Expand Down

0 comments on commit d1bf03b

Please sign in to comment.