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

support nested repositories (GitLab) #648

Closed
2 tasks
jdoubleu opened this issue Dec 31, 2021 · 5 comments · Fixed by #656, #1078 or #1691
Closed
2 tasks

support nested repositories (GitLab) #648

jdoubleu opened this issue Dec 31, 2021 · 5 comments · Fixed by #656, #1078 or #1691
Labels
feature add new functionality forge/gitlab gitlab forge related good first issue Likely to be an easy fix
Milestone

Comments

@jdoubleu
Copy link
Contributor

jdoubleu commented Dec 31, 2021

Component: server

Describe the bug

It looks like Woodpecker does not properly handle nested repositories from GitLab. Nested repositories or subgroups are a GitLab feature where a repository might exist inside a 2 level or greater hierarchy (e.g. my-org-group/team-group/category-group/actual-repository.git), as opposed to the 2 level hierarchy that is well established by SCMs (e.g. vendor/project.git).

When I try to sync my repositories in the Woodpecker UI, nothing happens. Looking that the debug error logs I get the following message:

{"level":"debug","time":"2021-12-31T17:45:34+01:00","message":"sync error: my-user: could not fetch permission of repo 'rootgroup/subgroup/my-repository': GET https://gitlab-instance.com/api/v4/projects/rootgroup/subgroup: 404 {message: 404 Project Not Found}"}

As you can see, Woodpecker is querying the wrong API endpoint:

- https://gitlab-instance.com/api/v4/projects/rootgroup/subgroup
+ https://gitlab-instance.com/api/v4/projects/rootgroup/subgroup/my-repository

I think there are two issues here, which can be resolved independently:

  1. The complete repository sync fails/stops when only one repository fails to sync. I think Woodpecker should continue syncing the repositories and just skip the failed ones. It would be useful to display an error message to the user in that case.
  2. Properly handle nested repositories. This might be harder to accomplish because they might need to be mapped to the tradition 2 level hierarchy as that's used internally?

References

@6543 pointed out, they had replaced the GitLab API client with github.com/xanzy/go-gitlab in recent master.

System Info

next-d11b2bb8
built from master@d11b2bb8e5bea6f29f82a20815ef7bf3fa96a0a2
@6543 6543 added bug Something isn't working and removed pending:bug labels Dec 31, 2021
@anbraten anbraten changed the title repository sync failes if there are nested repositories in GitLab support nested repositories (GitLab) Jan 2, 2022
@6543 6543 added feature add new functionality forge/gitlab gitlab forge related and removed bug Something isn't working labels Jan 3, 2022
@6543 6543 added this to the 0.16.0 milestone Jan 3, 2022
@6543 6543 closed this as completed in #656 Jan 3, 2022
6543 pushed a commit that referenced this issue Jan 3, 2022
@6543 6543 reopened this Jan 3, 2022
dsanader added a commit to dsanader/woodpecker that referenced this issue Aug 12, 2022
@6543 6543 closed this as completed in #1078 Sep 5, 2022
@6543 6543 closed this as completed in 52d3652 Sep 5, 2022
@qwerty287
Copy link
Contributor

I'm not sure if we should close this. The corresponding PR #1078 didn't target it and I didn't test it.

@qwerty287 qwerty287 reopened this Sep 5, 2022
@6543 6543 added the good first issue Likely to be an easy fix label Sep 11, 2022
@bck01215
Copy link
Contributor

Still experiencing errors with nested repositories on latest docker build

@anbraten
Copy link
Member

@bck01215 Cloud you give next a try. Latest is our latest stable release which does not include those unreleased changes from master.

@bck01215
Copy link
Contributor

I'm still getting the following debug message in the next repo

Skipping nested repository nested-repo for user username, because they are not supported, yet (see #648)."}

@anbraten
Copy link
Member

I guess we have to introduce #1295 somehow to solve it.

@anbraten anbraten mentioned this issue Apr 3, 2023
16 tasks
@6543 6543 closed this as completed in ff01a9f Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature add new functionality forge/gitlab gitlab forge related good first issue Likely to be an easy fix
Projects
None yet
5 participants