-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: shallow repo clone in merge checkout strategy #2758
Conversation
When the repository is quite large clones are becoming slower. Previously Atlantis fetched full repository in --checkout-strategy=merge mode. However, that's not required, we only should have enough commits in our clone to perform a merge between base and feature branches, not full history. This implements rough guessing: fetch 50 (user-configurable) commits from each of base and feature branches, and if their merge base is not in these commits, fetch full repo history. This is not ideal solution and could be improved (e.g. increase the number of fetched commits in several attempts before full fetch), but I think it should be good enough in most cases.
@rationalex @ibonder @Radcriminal @nikolaik @jilyaluk You folks all upvoted the previous PR. I tried my best to bring this back to life but I'm not completely sure why the original change by @jilyaluk was only for the non-default checkout strategy of A review would also be helpful by maintainers and anyone else willing to look this over. I'm not so savvy and don't have a huge vested interest in this so I do not plan to make additional changes as I do not use the merge checkout strategy. Edit: it's already enabled for branch strategy atlantis/server/events/working_dir.go Line 275 in d33bd0f
|
Co-authored-by: Nikolai Røed Kristiansen <nikolaik@gmail.com>
Co-authored-by: Ken Kaizu <k.kaizu38@gmail.com>
* Implement shallow repo clone in merge checkout strategy --------- Co-authored-by: Ilya Lukyanov <il@joom.com> Co-authored-by: Nikolai Røed Kristiansen <nikolaik@gmail.com> Co-authored-by: PePe Amengual <jose.amengual@gmail.com> Co-authored-by: Ken Kaizu <k.kaizu38@gmail.com>
* Implement shallow repo clone in merge checkout strategy --------- Co-authored-by: Ilya Lukyanov <il@joom.com> Co-authored-by: Nikolai Røed Kristiansen <nikolaik@gmail.com> Co-authored-by: PePe Amengual <jose.amengual@gmail.com> Co-authored-by: Ken Kaizu <k.kaizu38@gmail.com>
what
merge
checkout strategywhy
merge
strategy. If the checkout cannot do the merge with a shallow clone then the full clone is checked out.branch
strategy already uses shallow cloning by cloning with a depth of 1 (unchanged)atlantis/server/events/working_dir.go
Line 275 in d33bd0f
references