-
Notifications
You must be signed in to change notification settings - Fork 787
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
fix(versions): Delete and reclone version stream significantly less. #5981
fix(versions): Delete and reclone version stream significantly less. #5981
Conversation
@@ -869,6 +869,11 @@ func (g *GitCLI) FetchTags(dir string) error { | |||
return g.gitCmd(dir, "fetch", "--tags") | |||
} | |||
|
|||
// FetchRemoteTags fetches all the tags from a remote repository | |||
func (g *GitCLI) FetchRemoteTags(dir string, repo string) error { |
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.
Might be better to extend the command above, and check if repo is empty?
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.
Yeah, I think I'm gonna do a dive through git_cli
at some point soon and clean up a bunch of stuff.
if err != nil { | ||
dir, err := deleteAndReClone(wrkDir, versionRepository, versionRef, gitter) | ||
if err != nil { | ||
return "", "", errors.WithStack(err) | ||
} | ||
return dir, versionRef, nil | ||
} | ||
// TODO: It might be good to do the same behavior for any branch - just the checkout approach works for | ||
// tags and commit-ishs, but not branches. I'm not sure how we can tell if it's a branch vs a tag, though. |
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.
The only way I know how to do this is to use the FilterTags method to check if the tag exists or not
/lgtm |
By switching to an approach using our `Gitter` APIs rather than the `go-git` for handling an existing clone, we should drastically decrease the number of delete and reclones. fixes jenkins-x#5976 Signed-off-by: Andrew Bayer <[email protected]>
5b47fa9
to
2a57332
Compare
Signed-off-by: Andrew Bayer <[email protected]>
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pmuir The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test all |
Submitter checklist
Description
By switching to an approach using our
Gitter
APIs rather than thego-git
for handling an existing clone, we should drastically decrease the number of delete and reclones.I verified that with this, I can get rid of the sleep I had to insert in #5977 to get the new test there to pass, and the test still passes.
Special notes for the reviewer(s)
/assign @pmuir
Which issue this PR fixes
fixes #5976