Skip to content
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

Unable to download group gitlab repository files #479

Open
denis256 opened this issue Apr 1, 2024 · 4 comments · May be fixed by #494
Open

Unable to download group gitlab repository files #479

denis256 opened this issue Apr 1, 2024 · 4 comments · May be fixed by #494

Comments

@denis256
Copy link

denis256 commented Apr 1, 2024

Noticed that go-getter fail to download files from gitlab repositories which are located in subgroups:

(go-getter_1.7.3_linux_amd64)

$ go-getter "github.com/denis256/s3.git//module2" /tmp/qwe
2024/04/01 18:01:56 success!

$ go-getter "gitlab.com/denis256/s3.git//module2" /tmp/qwe
2024/04/01 18:10:40 success!

$ go-getter "gitlab.com/denis25-tests/dc/platform/terraform-modules/s3.git//module2" /tmp/qwe
2024/04/01 18:02:19 Error downloading: error downloading 'https://gitlab.com/denis25-tests/dc.git': /usr/bin/git exited with 128: Cloning into '/tmp/getter72444115/temp'...
remote: The project you were looking for could not be found or you don't have permission to view it.
fatal: repository 'https://gitlab.com/denis25-tests/dc.git/' not found

References:
https://github.com/denis256/s3
https://gitlab.com/denis256/s3
https://gitlab.com/denis25-tests/dc/platform/terraform-modules/s3

@gmaghera
Copy link

gmaghera commented Apr 3, 2024

The issue stems from around here:

if len(parts) > 3 {
repoUrl.Path += "//" + strings.Join(parts[3:], "/")
}

And there is a clear indication of the (incorrect) assumption that all gitlab.com projects are personal projects here:

if len(parts) < 3 {
return "", false, fmt.Errorf(
"GitLab URLs should be gitlab.com/username/repo")
}

@gmaghera
Copy link

Here is the related documentation https://docs.gitlab.com/ee/user/group/subgroups/

Subgroups can be "Be nested up to 20 levels."

@tvizor tvizor linked a pull request Jun 3, 2024 that will close this issue
@gmaghera
Copy link

gmaghera commented Jun 3, 2024

Could you associate PR #494 with this issue?

tvizor pushed a commit to tvizor/go-getter that referenced this issue Jun 3, 2024
tvizor added a commit to tvizor/go-getter that referenced this issue Jun 28, 2024
…-subpath-query

fix: hashicorp#479 allow nested repos for gitlab.com
@gmaghera
Copy link

gmaghera commented Aug 5, 2024

bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants