jenkinsci / jenkinsci/gitlab-plugin

`gitlabBuilds` not sending pending status to GitLab

Open
#1,029 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.4k
Forks
615
Avg merge
4h 32m
Merged PRs (30d)
10

Description

### Context
- **Gitlab plugin version**: 1.5.13
- **Gitlab version**: 12.6.3
- **Jenkins version**: 2.204.2
- **Job type**: Multibranch pipeline

### Jenkinsfile
```
#!groovy

properties([
disableConcurrentBuilds(),
gitLabConnection('xxxxxx'),
buildDiscarder(logRotator(artifactNumToKeepStr: '1'))
])

gitlabBuilds(builds: ['Configure', 'Test', 'Package', 'Deploy', 'Report']) {
node('xxxxxx') {
catchError {
stage('Configure') {
gitlabCommitStatus('Configure') {
...
}
}

stage('Test') {
gitlabCommitStatus('Test') {
...
}
}

stage('Package') {
gitlabCommitStatus('Package') {
...
}
}

stage('Deploy') {
gitlabCommitStatus('Deploy') {
...
}
}

stage('Report') {
gitlabCommitStatus('Report') {
...
}
}
}

step([
$class: 'Mailer',
notifyEveryUnstableBuild: true,
recipients: emailextrecipients([[$class: 'CulpritsRecipientProvider']])
])
}
}
```

### Problem description

Using the `gitlabBuilds` property does not set the state of the stages on GitLab to pending as per this [section in the README](https://github.com/jenkinsci/gitlab-plugin/blob/gitlab-plugin-1.5.13/README.md#L352-L372).

The first time GitLab gets informed of the build is the first ` gitlabCommitStatus` (the 'Configure' stage in the Jenkinsfile above).

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.