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

Return project on successful fork #106

Closed
Spenhouet opened this issue Dec 4, 2017 · 5 comments
Closed

Return project on successful fork #106

Spenhouet opened this issue Dec 4, 2017 · 5 comments

Comments

@Spenhouet
Copy link

In the current implementation nothing is returned from the forkProject method.

The GitLab API return the new project (the forked project).
It would be good if the Java API would return a Project instance of the forked project (the returned project by the GitLab API).

@gmessner
Copy link
Collaborator

gmessner commented Dec 4, 2017

Unfortunately, the forking operation for a project is asynchronous and is completed in a background job. The request will return immediately. You'll need to enter a loop and check for the project with:

public Project getProject(String namespace, String project)

Until it returns successfully.

@gmessner gmessner closed this as completed Dec 4, 2017
@Spenhouet
Copy link
Author

Spenhouet commented Dec 4, 2017

@gmessner The API call for fork actually returns the forked project.
The documentation is a little bit misleading in that regard.
That should be enough, or doesn't it?

@gmessner
Copy link
Collaborator

gmessner commented Dec 4, 2017

The docs do not indicate that a Project instance is returned, however, that would be unusual. I have went ahead and added returning the Project, but have not yet added a test case for same. I'll get to this later today and do another release if it works.

@gmessner gmessner reopened this Dec 4, 2017
@Spenhouet
Copy link
Author

As far as I understand the documentation, the git fork operation is done in the background but the GitLab project is created directly. To check if the git fork operation finished the documentation recommends to check the projects import_status.

As I see it, the Project object only contains the project information anyway, so returning a Project instance shouldn't be a problem. If someone wants to know if the actual fork is finished he could still loop to check for the import_status.

Thanks for taking a second look at it 👍 I hope I'm right with my assessment.

@gmessner
Copy link
Collaborator

gmessner commented Dec 5, 2017

Returning the newly forked Project instance has been added and tested. Is available in release 4.7.3.

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

No branches or pull requests

2 participants