Add a filter parameter for larger repositories#142
Conversation
This will generally always be `tree:0` in order to create a treeless clone and sparse checkout of only the input directory. This improves performance of breaking change checks significantly for larger repositories.
|
Hey @CGA1123 thanks for putting this together! We do have a version restriction here, which could then be used to fix the default case. Although very unlikely, we should enforce upgrading of buf to 1.50.1 for security reasons too: https://github.com/bufbuild/buf/releases/tag/v1.50.1 . So this version restriction would serve two purposes, and remove the need for the explicit |
|
Sounds great. So to confirm, bump the required version to |
When using `filter` `buf` will fail to run `git checkout` as the credentials aren't passed to `git`. This results in failures such as: ``` Failure: could not clone https://github.com/foo/bar.git: exit status 128 fatal: could not read Username for 'https://github.com': No such device or address fatal: could not fetch <SHA> from promisor remote ``` I noticed this while testing bufbuild/buf-action#142 which relies on overriding `credential.helper` for authentication in GitHub Actions.
|
Relatedly, I think in order to make this transition smooth, something like bufbuild/buf#3707 will need to be merged in. Currently, using |
|
Thanks for getting bufbuild/buf#3707 fixed! We talked through adding the version limit internally and decided that might be too big a restriction for users. The approach we are looking for is to add a check to see if |
|
That makes sense 👍 I've created #147 to help track this. Thanks for your time 🙇 |
This will generally always be
tree:0in order to create a treeless clone and sparse checkout of only the input directory.This improves performance of breaking change checks significantly for larger repositories.
This option was added in
v1.50.0which was released only a couple of months ago.I think it could be nice to automatically add this filter by default or perhaps just to set the default value to
tree:0?This would break for anyone using an older version of the CLI.
Not sure of a way that this could be introduced in a backwards compatible manner, maybe we can just run
buf --versionand parse that? Or haveinstaller.tspass through the installed version number?