gitlab-plugin icon indicating copy to clipboard operation
gitlab-plugin copied to clipboard

How to get a gitlabClient to call e.g. createMergeRequest(...) from Declarative Jenkins Pipeline

Open sebastianzillessen opened this issue 2 years ago • 3 comments

Describe your use-case which is not covered by existing documentation.

We would like to call GitLabClient#createMergeRequest(...) from our Jenkinsfile (Declarative Pipeline).

How can we get a current instance of the GitLabClient? I did not find any documentation on this.

Thanks for helping out.

Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.

https://github.com/jenkinsci/gitlab-plugin/blob/9d32eea43bed3aaf93da9cc3aea6d92c74cd8aa8/src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java#L19

sebastianzillessen avatar Jan 20 '23 11:01 sebastianzillessen

Hi @sebastianzillessen Could you please provide more context such as your use case so we could provide more information?

krisstern avatar Feb 16 '23 11:02 krisstern

Hi @sebastianzillessen, Can you please share a few more details in regard to your issue mentioning the use cases of it so that we can work on the code?

The portion that I have understood after going through the resource pointed out by you (gitlab-plugin/src/main/java/com/dabsquared/gitlabjenkins/gitlab/api /GitLabClient.java) is that the code provided in there only defines the GitLabClient interface and its methods. In order to get a current instance of the GitLabClient we can go ahead and implement this to a class separately along with it.

sumitNITS avatar Mar 01 '23 20:03 sumitNITS

is createMergeRequest in jenkins Pipeline?

walnut-tom avatar May 06 '23 11:05 walnut-tom