GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||
GeezerVison is showing github.com — feat: add opt-in singleBranch option to speed up git scm checkout by kuisathaverat · Pull Request #9590 · updatecli/updatecli Conversation
Contributor
ProblemUpdatecli pipelines targeting repositories with a very large number of branches, tags, and other refs (hundreds of branches/tags, 350k+ commits) can spend a very long time (measured up to ~19 minutes) just checking out the git scm, even when Two issues were found in the shared native git implementation used by every git-based scm (
For a repository with hundreds of branches/tags and a long history, this second point in particular is extremely expensive and explains slow checkouts even with SolutionThis PR adds a new opt-in When
When the option is left unset (default), behavior is 100% unchanged — this is purely opt-in. Trade-offSkipping the full ref reconciliation fetch means Updatecli may, in some edge cases, fail to detect an already-published working branch and create a duplicate pull request. This is documented on the new option and is an acceptable trade-off compared to multi-minute checkouts on very large repositories. Examplescms: default: kind: github spec: owner: updatecli repository: updatecli branch: main token: '{{ requiredEnv "GITHUB_TOKEN" }}' depth: 1 singleBranch: true ImpactMeasured on a repository with hundreds of branches/tags and ~350k commits, enabling Validation
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Repositories with a very large number of branches, tags, and other refs
(e.g. hundreds of branches/tags and hundreds of thousands of commits) can
make Updatecli's git scm checkout very slow, even when a shallow `depth`
is configured. There are two contributing factors in
`pkg/plugins/utils/gitgeneric` (GoGit, shared by the github, gitlab,
gitea, bitbucket, stash, azuredevops and git scms):
- The initial `git.PlainClone` fetches every branch on the remote by
default (go-git's default clone refspec is
`+refs/heads/*:refs/remotes/<remote>/*`), regardless of `depth`.
- Right after cloning, an unconditional fetch is issued with
`RefSpecs: []config.RefSpec{"refs/*:refs/*"}`, which mirrors every ref
on the remote (branches, tags, pull request refs, notes, etc.) on every
single Updatecli execution.
This change adds a new opt-in `singleBranch` spec field. When enabled:
- the clone only fetches the configured branch
(`SingleBranch`+`ReferenceName` on `git.CloneOptions`), and
- the post-clone `refs/*:refs/*` reconciliation fetch is skipped
entirely.
Default behavior (flag unset) is unchanged. As a documented trade-off,
enabling `singleBranch` skips the full ref reconciliation, which in some
edge cases can make Updatecli miss an already published working branch
and create a duplicate pull request.
Co-authored-by: Copilot App <[email protected]>
olblak
previously approved these changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for the great pull request, covering all scm provider plus the documentation.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. The typos CI check fails on main (e.g. PR updatecli#9565) due to a pre-existing spelling typo unrelated to the singleBranch scm change. Fixing it here so this PR's CI can pass cleanly. Co-authored-by: Copilot App <[email protected]>
kuisathaverat
commented
Uh oh!
There was an error while loading. Please reload this page.
kuisathaverat
commented
Uh oh!
There was an error while loading. Please reload this page. This reverts commit 6183807.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
olblak
approved these changes
Uh oh!
There was an error while loading. Please reload this page.
olblak
added a commit
to updatecli/website
that referenced
this pull request
Adds a new 'Performance on large repositories' subsection to each scm plugin doc (github, gitlab, gitea, bitbucket, stash, azuredevops, git) explaining the new singleBranch option (paired with depth) that lets Updatecli skip fetching every branch, tag, and ref on the remote, along with a runnable example for each plugin. Related to updatecli/updatecli#9590. Co-authored-by: kuisathaverat <[email protected]> Co-authored-by: Copilot App <[email protected]> Co-authored-by: Olblak <[email protected]> Co-authored-by: Olivier Vernin <[email protected]>
3 tasks
1 of 2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
enhancement
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | ||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |