jenkinsci / jenkinsci/gitlab-plugin
Using "skipped" as commit status returns HTTP 400 Bad Request
- Dominant language
- Java
- Stars
- 1.4k
- Forks
- 615
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 10
Description
### Jenkins and plugins versions report
Environment
Jenkins: 2.375.1
OS: Linux - 5.15.0-60-generic
Java: 17.0.5 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
[...]
git:5.0.0
git-client:4.1.0
git-server:99.va_0826a_b_cdfa_d
github:1.36.1
github-api:1.303-400.v35c2d8258028
github-branch-source:1701.v00cc8184df93
gitlab-plugin:1.7.6
### What Operating System are you using (both controller, and any agents involved in the problem)?
Ubuntu 20.04
### Reproduction steps
1. Setup GitLab Plugin like [this. ](https://about.gitlab.com/handbook/customer-success/demo-systems/tutorials/integrations/create-jenkins-pipeline/)
2. Use `updateGitlabCommitStatus name: 'Pipeline Entering - 6', state: 'Skipped'`
Following stage was used:
```groovy
stage('Pipeline Entering - Echo') {
steps {
echo('PIPELINE RUNNING - Frontend');
updateGitlabCommitStatus name: 'Pipeline Entering - 1', state: 'pending'
updateGitlabCommitStatus name: 'Pipeline Entering - 2', state: 'running'
updateGitlabCommitStatus name: 'Pipeline Entering - 3', state: 'canceled'
updateGitlabCommitStatus name: 'Pipeline Entering - 4', state: 'success'
updateGitlabCommitStatus name: 'Pipeline Entering - 5', state: 'failed'
updateGitlabCommitStatus name: 'Pipeline Entering - 6', state: 'skipped'
}
}
```
3. Have a HTTP 400: Bad Request error in build log.
### Expected Results
I expected that GitLab correctly shows that this CommitStatus was skipped.
### Actual Results
The CommitStatus doesn't show up at all and an error shows up in the build log of Jenkins.

```
[console output]
[...]
[Pipeline] { (Pipeline Entering - Echo)
[Pipeline] echo
PIPELINE RUNNING - Frontend
[Pipeline] updateGitlabCommitStatus
[Pipeline] updateGitlabCommitStatus
[Pipeline] updateGitlabCommitStatus
[Pipeline] updateGitlabCommitStatus
[Pipeline] updateGitlabCommitStatus
[Pipeline] updateGitlabCommitStatus
Failed to update Gitlab commit status for project '28': HTTP 400 Bad Request'
[...]
```
### Anything else?
If anything else is needed, please let me know.
Contributor guide
Assessment
This issue has not been assessed yet.