jenkinsci / jenkinsci/gitlab-plugin
unstable step inside gitlabCommitStatus marks stage as success in gitlab
- Dominant language
- Java
- Stars
- 1.4k
- Forks
- 615
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 10
Description
## Issue
### Context
- **Gitlab plugin version**: 1.5.3
- **Gitlab version**: GitLab Community Edition 10.4.2
- **Jenkins version**: 2.104
- **Job type**: Pipeline
### Logs & Traces
For reproduction i've made a minimal pipeline script with just one gitlabCommitStatus, and a fixed junit xml with a failure, which marks the build unstable.
```groovy
gitlabBuilds(builds: ['stage2']) {
stage('stage2') {
gitlabCommitStatus(name: 'stage2') {
sh 'touch results/*.xml'
junit 'results/*.xml'
echo "Result: $currentBuild.result"
}
}
}
```
[results_xml.zip](https://github.com/jenkinsci/gitlab-plugin/files/1719303/results_xml.zip)
### Problem description
_Describe your problem in a meaningful way_:
- a merge request triggers a build in Jenkins.
the build has a gitlabCommitStatus block with a junit step which marks the build as unstable in Jenkins.
When printing currentBuild.result inside the gitlabCommitStatus block, this also prints UNSTABLE
- i expected this stage to be marked as failed in gitlab. From #190 i'd expect this is the default behavior.
- the actual result is the pipeline stage is marked as passed in gitlab.
Did the default to mark unstable build as failed change? And how can i set this option?
Contributor guide
Assessment
This issue has not been assessed yet.