Forking with namespace doesn't work (API)
Summary
Given I have a project in a subgroup of a group (e.g. group/subgroup/project
).
Forking the project with its ID into another namespace with the ID in the other namespace does work without any problem.
http://gitlab.com/api/v4/projects/4813338/fork?namespace=2260847
But if I try to fork with into a namespace with its namespace it fails.
Based on the documentation it is not necessary to use url encoding but
only returns
{
"message": "404 Target Namespace Not Found"
}
Using url encoding doesn't change this problem. The following still doesn't work:
Trying this from the Java API doesn't work either:
Group group = groupApi.getGroup("othergroup/othersubgroub");
projectApi.forkProject(project, group.getFullPath());
Steps to reproduce
In my case I have the following GitLab structure:
fork-api-bug-report-group/sub-group/default.git
fork-api-bug-report-othergroup/othersub-group/
I'm then trying to fork the default.git
into the namespace fork-api-bug-report-othergroup/othersub-group
using the commands like mentioned above and in the documentation.
Example Project
- Project to fork: https://gitlab.com/fork-api-bug-report-group/sub-group/default
- The project ID: 4813338
- Namespace to fork to: https://gitlab.com/fork-api-bug-report-othergroup/othersub-group
- The namespace ID: 2260847
The following doesn't work:
- http://gitlab.com/api/v4/projects/4813338/fork?namespace=fork-api-bug-report-othergroup/othersub-group
- http://gitlab.com/api/v4/projects/4813338/fork?namespace=fork-api-bug-report-othergroup/othersub-group/
- http://gitlab.com/api/v4/projects/4813338/fork?namespace=fork-api-bug-report-othergroup%2Fothersub-group
- http://gitlab.com/api/v4/projects/4813338/fork?namespace=fork-api-bug-report-othergroup%2Fothersub-group%2F
The following does work: