[Proposal] [API] When forking fails due to existing forked project, return the forked project
Right now, when forking a project A to project B via API fails due to B already exists, GitLab returns a HTTP 409 Conflict error. When it makes sense, this leaves the API user helpless, because there's no way to actually get that project B:
-
GET projects/Adoesn't return the forked project(s), only aforks_countattribute. Not to mention that this requires access to A. -
GET projects/:searchisn't that advanced - you can only search name, namespace and the likes, not something likesearch={forked_from_project.id:A} - You can actually
GET projects/ownedand traverse down the list to see if there's a{forked_from_project.id:A}somewhere. This is very cumblesome however, and even impractical if the current authenticated user has hundreds of thousands of projects – for example, if he's a CI user.
So I'd propose GitLab, while still returning 409, to include the forked project B as the reponse's body.
Would be happy if there's actually a way to approach the desired result, and that I'm just being silly here.