fix(migrations): cancel GitLab version probes (#39023) (#39035)

Backport #39023 by @bircni

Bind the GitLab version probe to the migration context so a cancelled
migration does not remain blocked on a remote response.

Co-authored-by: bircni <bircni@icloud.com>
This commit is contained in:
Giteabot
2026-08-22 01:52:31 -07:00
committed by GitHub
parent 9fe8653e45
commit 3f01f06d3b
2 changed files with 24 additions and 1 deletions
+1 -1
View File
@@ -105,7 +105,7 @@ func NewGitlabDownloader(ctx context.Context, baseURL, repoPath, token string) (
var resp *gitlab.Response
u, _ := url.Parse(baseURL)
for len(pathParts) >= 2 {
_, resp, err = gitlabClient.Version.GetVersion()
_, resp, err = gitlabClient.Version.GetVersion(gitlab.WithContext(ctx))
if err == nil || resp != nil && resp.StatusCode == http.StatusUnauthorized {
err = nil // if no authentication given, this still should work
break