Open jmini opened 1 year ago
Hi @jmini ,
Can you add the plugins versions and Jenkins versions of your instance? Wich types of events do you put in your Gitlab webhook? The full name of the Jenkins build? And which traits do you configure in your Jenkins pipeline?
I also have similar problem (GitLab CI and Jenkins CI pipeline running together) https://github.com/jenkinsci/gitlab-branch-source-plugin/pull/316 helped to get status report in correct Pipeline
We have the same problem. Very interested to know if there will be a fix or if there is already a work around.
Sorry I never did a follow up on that.
Our installation:
But it doesn't really matter, since according to me, this is a big limitation in the features offered by the Set the pipeline status of a commit endpoint:
POST /projects/:id/statuses/:sha
doc: https://docs.gitlab.com/ee/api/commits.html#set-the-pipeline-status-of-a-commit
This is the endpoint that is used by the Jenkins plugin "gitlab-branch-source-plugin".
The plugin has no chance to report that the commit status is for a pipeline-type = "merge-request"
or pipeline-type = "branch"
For me the GitLab issue describing the problem is: https://gitlab.com/gitlab-org/gitlab/-/issues/34378
And those 2 are also interesting:
What feature do you want to see added?
We have a setup with a
Jenkinsfile
and we start to migrate step-by-step to GitLab (by adding a.gitlab-ci.yml
file).In gitlab some of the jobs have the rule:
This creates 2 pipelines in GitLab for a given MR:
1
patch
branch.In Jenkins we also have this notion of branch jobs and merge-request jobs:
But all the Jenkins jobs are reported in the same GitLab pipeline (the branch one and not the MR one), see the external stage in the branch pipeline:
I think the problem is the way this plugin reports the commit status: https://github.com/jenkinsci/gitlab-branch-source-plugin/blob/dc12a4a064349814682eae6b959a784365aec39c/src/main/java/io/jenkins/plugins/gitlabbranchsource/helpers/GitLabPipelineStatusNotifier.java#L325-L339
Upstream changes
I could not find an open issue for it, but I think one limitation is that there is no API to report a commit status for an open merge request:
Set the pipeline status of a commit https://docs.gitlab.com/ee/api/commits.html#set-the-pipeline-status-of-a-commit
There you can not set anything about the MR.