-
Notifications
You must be signed in to change notification settings - Fork 105
Option to ignore type in build StatusName #307
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
Option to ignore type in build StatusName #307
Conversation
1222fb0 to
9df28c7
Compare
|
Hi @jetersen |
| String statusName = GitLabPipelineStatusNotifier.getStatusName(sourceContext, null, revision, | ||
| new hudson.EnvVars()); | ||
|
|
||
| assertThat(statusName, is(GitLabPipelineStatusNotifier.GITLAB_PIPELINE_STATUS_PREFIX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe instead of referencing constants here, write the actual literal expected value. Changing the value is an API break essentially?
Started external GitLab pipeline can't finish if the plugin is updated in between - jenkins pipelines can "in theory" run across Jenkins restarts...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had a similar issue when changing the project config Discover merge requests from forks:
- old value:
Discover merge requests from forks - new value:
The current merge request revision
That has the side effect to report the job status to be reported as jenkinsci/mr-head on GitLab instead of jenkinsci/mr-merge.
You also end up with tons of pipeline jenkinsci/mr-merge the are "running" forever:
For me you just need to accept that and be prepared to run some curl command to make the pipeline green using the REST API: https://docs.gitlab.com/ee/api/commits.html#set-the-pipeline-status-of-a-commit
curl --location '****gitlab-server****/api/v4/projects/****project-id****/statuses/****commit-sha****' \
--header 'Content-Type: application/json' \
--header 'PRIVATE-TOKEN: ****************' \
--data '{
"state": "success",
"name": "jenkinsci/mr-merge"
}'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is an attempt to resolve such problems by removing the type from the pipeline name... because GitLab is not GitHub and - depending on how you use the branch source - the type may not make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am well aware about what this change is about.
We are interested to have a single name instead of:
jenkinsci/branch and jenkins/mr-head
In order to avoid 2 external pipeline report in Jenkins…
| <f:entry title="${%Overwrite full name}" field="buildStatusNameOverwrite"> | ||
| <f:checkbox default="unchecked"/> | ||
| </f:entry> | ||
| <f:entry title="${%Do not append type in status name}" field="ignoreTypeInStatusName"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid a double negation here?
|
@mifitous I support your proposal to add this! Let me know if I can help… |
|
There are currently conflicts, would you mind resolving them? 😓 |
75e7bb3 to
5cb346c
Compare
…s/GitLabPipelineStatusNotifierTest.java
Hi @jetersen : done |

Implement @cobexer request #176 (comment)
Add a checkbox to allow ignoring type in build StatusName