kpromo: set git clone depth for pr subcommand to prevent downloading the whole repository#1409
Conversation
…the whole repository
xmudrii
left a comment
There was a problem hiding this comment.
I agree, lately running kpromo pr takes way too much time.
/lgtm
/approve
/hold
@cpanato @saschagrunert do you want to take a look as well?
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chrischdi, saschagrunert, xmudrii The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
| // Set a minimal depth to prevent downloading the whole repository. | ||
| Depth: 1, |
There was a problem hiding this comment.
The question is if we break something, but yeah let's give it a try.
There was a problem hiding this comment.
That's why I tagged you and @cpanato. 😅 But given that this PR changes only the pr command, I think we can't break that much. And even if we do break it, we would probably realise it very quickly.
|
Let's give this a try! |
|
We should consider https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/ |
Oh, this is neat! I'll gonna try that and file a PR to change to that :-) |
|
Unfortunately: |
|
Ah, we do clones via exec in prow ... it's kinda nice for debugging but does introduce an external runtime dependency ... (we use a container image with git) ... it does also mean you can use the canonical git implementation ... |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR adds git clone options for cloning the
kubernetes/k8s.iorepository to only clone a depth of 1.The
kubernetes/k8s.iodid grow in the past to a big (1,4GB to download) repository:This change should reduce the downloaded size from 1.27 GiB to currently ~29.29 MiB instead.
So this reduces the amount of data which is downloaded when running
kpromo pr ...and by that also reduce the time for maintainers to run kpromo.Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?