feat(gittag): add lsremote parameter to skip git clone#7669
Merged
olblak merged 9 commits intoupdatecli:mainfrom Feb 10, 2026
Merged
feat(gittag): add lsremote parameter to skip git clone#7669olblak merged 9 commits intoupdatecli:mainfrom
olblak merged 9 commits intoupdatecli:mainfrom
Conversation
Signed-off-by: Olblak <me@olblak.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the gittag resource to retrieve tags from a remote repository URL without cloning it locally, addressing performance issues for large repositories (Fix #7667). It introduces a new remote-tag listing path and adjusts tests/docs accordingly.
Changes:
- Added remote URL tag listing via
go-gitremote ref listing (no local clone). - Updated
SourceandConditionto use remote tag listing whenspec.urlis provided, otherwise use localTagRefs. - Extended unit tests and updated
spec.urldocumentation to reflect the new behavior/sorting.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/plugins/resources/gittag/utils.go | Adds helpers to list tags from a remote URL or a local directory. |
| pkg/plugins/resources/gittag/source.go | Switches source behavior to avoid cloning when spec.url is set. |
| pkg/plugins/resources/gittag/condition.go | Switches condition behavior to avoid cloning when spec.url is set. |
| pkg/plugins/resources/gittag/source_test.go | Adds test cases for remote URL fetching and updates mocks to TagRefs. |
| pkg/plugins/resources/gittag/condition_test.go | Updates mocks to TagRefs and adds a remote URL condition test. |
| pkg/plugins/resources/gittag/main.go | Updates spec.url documentation to describe the new behavior/sorting. |
💡 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>
Adding a new parameter lsremote to switch to the new behavior when an URL is specified, to keep backward compatibility Signed-off-by: Olblak <me@olblak.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix #7667
When using the gittag plugin with a
urlvalue andlsremoteset to true, Updatecli now retrieves the tags without cloning the repository locally.For very large repositories, this drastically reduce the time to get tags, but it also comes with a downside.
Tags retrieved this way are not sorted by publish time so to align with the command
git ls-remote --refs --tags https://github.com/updatecli/udash.gitbehavior, Updatecli sorts them lexicographically.It turns out that this PR would introduce a breaking change when using the URL parameter, which I don't want to do. Instead, I should probably use a new parameter to enable/disable the new behaviorTest
To test this pull request, you can run the following commands:
Tested with
updatecli.yaml
Additional Information
Checklist
Tradeoff
I made the decision to have different behavior if scmid is specified, we get the tags from the local directory.The major benefits is that tags retrieved this way are sorted by publish time.
Potential improvement
Mock testing to URL with lsremote integration