jenkinsci / jenkinsci/gitlab-plugin

updateGitLabCommitStatus Bug in parallel directive

Open
#835 7 comments 0 reactions 0 assignees View on GitHub
awaiting feedback
Dominant language
Java
Stars
1.4k
Forks
615
Avg merge
4h 32m
Merged PRs (30d)
10

Description

## Issue
Function updateGitLabCommitStatus returns wrong status when used in several stages within a parallel directive

### Context
- **Gitlab plugin version**: 1.5.9
- **Gitlab version**: 11.0.3 CE
- **Jenkins version**: 2.121.2
- **Job type**: Pipeline

### Logs & Traces
![unbenannt](https://user-images.githubusercontent.com/43293808/45585799-0c6b8b00-b8eb-11e8-8882-6ada42106d2b.PNG)

### Problem description
In my project I implemented a parallel stage('JenkinsPipeline'), whereby each stage within the parallel directive (('Unix Build') / ('Win Build') / ('Test Deployment')) verifies the build status using the updateGitLabCommitStatus. This function really works perfectly for sequential stages, however when one stage fails within the parallel stage, all stages within the parallel directive are shown as failed in the GitLab UI. However the sequential one ('Debian Package Deployment') after the parallel directive returns the right status.

```
stage('JenkinsPipeline') {
parallel {
stage('Unix build') {... updateGitLabCommitStatus ...}
stage('Win Build') {... updateGitLabCommitStatus ...}
stage('Test Deployment') {... updateGitLabCommitStatus ...}
}
}
stage('Debian Package Deployment') {... updateGitLabCommitStatus ...}
```

So for example: If stage('Unix Build') fails and the others succeed, stage('Win Build') and stage('Test Deployment') will still be shown as failed and stage('Debian Package Deployment') as succeeded in the GitLabUI. The JenkinsUI displays the right results in the Pipeline view though.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.