-
-
Notifications
You must be signed in to change notification settings - Fork 115
feat: allow to specify depth for git clone option #7668
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
Conversation
Signed-off-by: Olblak <me@olblak.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds the ability to specify git clone depth for SCM configurations and sets a default depth of 1 for the gittag resource to improve performance by reducing clone sizes. The PR description indicates that with this change, the gittag resource clone size is reduced from 8M to 3.3M.
Changes:
- Added a
depthparameter to theGitHandler.Cloneinterface and all implementations - Added
Depth *intfield to all SCM plugin specs (GitHub, GitLab, Gitea, Bitbucket, Stash, and generic Git) - Updated the gittag resource to explicitly set depth=1 when cloning repositories
- Updated all test calls to pass
nilfor the new depth parameter
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/plugins/utils/gitgeneric/main.go | Updates GitHandler interface and Clone implementation to accept depth parameter |
| pkg/plugins/scms/github/main.go | Adds Depth field to GitHub SCM spec with documentation |
| pkg/plugins/scms/github/scm.go | Passes Depth parameter to Clone call |
| pkg/plugins/scms/gitlab/main.go | Adds Depth field to GitLab SCM spec with documentation |
| pkg/plugins/scms/gitlab/scm.go | Passes Depth parameter to Clone call |
| pkg/plugins/scms/gitea/main.go | Adds Depth field to Gitea SCM spec with documentation |
| pkg/plugins/scms/gitea/scm.go | Passes Depth parameter to Clone call |
| pkg/plugins/scms/bitbucket/main.go | Adds Depth field to Bitbucket SCM spec with documentation |
| pkg/plugins/scms/bitbucket/scm.go | Passes Depth parameter to Clone call |
| pkg/plugins/scms/stash/main.go | Adds Depth field to Stash SCM spec with documentation |
| pkg/plugins/scms/stash/scm.go | Passes Depth parameter to Clone call |
| pkg/plugins/scms/git/main.go | Adds Depth field to generic Git SCM spec with documentation |
| pkg/plugins/scms/git/scm.go | Passes Depth parameter to Clone call |
| pkg/plugins/resources/gittag/main.go | Sets depth=1 for gittag resource clones |
| pkg/plugins/utils/gitgeneric/main_test.go | Updates test calls to pass nil for depth parameter |
| pkg/plugins/utils/gitgeneric/branch_test.go | Updates test call to pass nil for depth parameter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Allow scm configuration to specify cloning depths.
Test
Tested manually with the following config
Additional Information
Checklist
Tradeoff
Potential improvement