jenkinsci / jenkinsci/gitlab-plugin

gitlabBuilds don't finish 'jenkins' job

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

Description

### Jenkins and plugins versions report

Environment

```text
Jenkins: 2.354
OS: Linux - 5.10.0-13-amd64
---
ace-editor:1.1
ansicolor:1.0.1
antisamy-markup-formatter:2.7
apache-httpcomponents-client-4-api:4.5.13-1.0
authentication-tokens:1.4
blueocean:1.25.5
blueocean-autofavorite:1.2.5
blueocean-bitbucket-pipeline:1.25.5
blueocean-commons:1.25.5
blueocean-config:1.25.5
blueocean-core-js:1.25.5
blueocean-dashboard:1.25.5
blueocean-display-url:2.4.1
blueocean-events:1.25.5
blueocean-git-pipeline:1.25.5
blueocean-github-pipeline:1.25.5
blueocean-i18n:1.25.5
blueocean-jwt:1.25.5
blueocean-personalization:1.25.5
blueocean-pipeline-api-impl:1.25.5
blueocean-pipeline-editor:1.25.5
blueocean-pipeline-scm-api:1.25.5
blueocean-rest:1.25.5
blueocean-rest-impl:1.25.5
blueocean-web:1.25.5
bootstrap5-api:5.1.3-7
bouncycastle-api:2.26
branch-api:2.1046.v0ca_37783ecc5
caffeine-api:2.9.3-65.v6a_47d0f4d1fe
checks-api:1.7.4
cloudbees-bitbucket-branch-source:773.v4b_9b_005b_562b_
cloudbees-folder:6.729.v2b_9d1a_74d673
command-launcher:84.v4a_97f2027398
credentials:1129.vef26f5df883c
credentials-binding:523.vd859a_4b_122e6
dashboard-view:2.432.va_712ce35862d
dingding-notifications:2.4.6
display-url-api:2.3.6
durable-task:496.va67c6f9eefa7
echarts-api:5.3.2-3
favorite:2.4.1
font-awesome-api:6.1.1-1
git:4.11.3
git-client:3.11.0
github:1.34.3
github-api:1.303-400.v35c2d8258028
github-branch-source:1637.vd833b_7ca_7654
gitlab-plugin:1.5.33
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953
htmlpublisher:1.30
jackson2-api:2.13.3-285.vc03c0256d517
javax-activation-api:1.2.0-3
javax-mail-api:1.6.2-6
jaxb:2.3.6-1
jdk-tool:1.5
jenkins-design-language:1.25.5
jersey2-api:2.35-8
jjwt-api:0.11.5-77.v646c772fddb_0
jquery3-api:3.6.0-4
jsch:0.1.55.2
junit:1119.va_a_5e9068da_d7
kubernetes:3636.v84b_a_1dea_6240
kubernetes-client-api:5.12.2-193.v26a_6078f65a_9
kubernetes-credentials:0.9.0
localization-support:1.1
localization-zh-cn:1.0.24
mailer:414.vcc4c33714601
matrix-project:771.v574584b_39e60
metrics:4.1.6.2
momentjs:1.1.1
okhttp-api:4.9.3-105.vb96869f8ac3a
pipeline-build-step:2.18
pipeline-graph-analysis:195.v5812d95a_a_2f9
pipeline-groovy-lib:593.va_a_fc25d520e9
pipeline-input-step:448.v37cea_9a_10a_70
pipeline-milestone-step:101.vd572fef9d926
pipeline-model-api:2.2086.v12b_420f036e5
pipeline-model-definition:2.2086.v12b_420f036e5
pipeline-model-extensions:2.2086.v12b_420f036e5
pipeline-rest-api:2.24
pipeline-stage-step:293.v200037eefcd5
pipeline-stage-tags-metadata:2.2086.v12b_420f036e5
pipeline-stage-view:2.24
plain-credentials:1.8
plugin-util-api:2.17.0
popper2-api:2.11.5-2
pubsub-light:1.16
role-strategy:488.v0634ce149b_8c
scm-api:608.vfa_f971c5a_a_e9
script-security:1175.v4b_d517d6db_f0
snakeyaml-api:1.30.1
sse-gateway:1.25
ssh-agent:295.v9ca_a_1c7cc3a_a_
ssh-credentials:277.v95c2fec1c047
sshd:3.237.v883d165a_c1d3
structs:318.va_f3ccb_729b_71
timestamper:1.17
token-macro:293.v283932a_0a_b_49
trilead-api:1.57.v6e90e07157e1
variant:1.4
workflow-aggregator:581.v0c46fa_697ffd
workflow-api:1164.v760c223ddb_32
workflow-basic-steps:948.v2c72a_091b_b_68
workflow-cps:2725.v7b_c717eb_12ce
workflow-durable-task-step:1146.v1a_d2e603f929
workflow-job:1186.v8def1a_5f3944
workflow-multibranch:716.vc692a_e52371b_
workflow-scm-step:400.v6b_89a_1317c9a_
workflow-step-api:625.vd896b_f445a_f8
workflow-support:820.vd1a_6cc65ef33

```

### What Operating System are you using (both controller, and any agents involved in the problem)?

Operation System

```text
Linux alpha.rczhiyun.local 5.10.0-13-amd64 #1 SMP Debian 5.10.106-1 (2022-03-17) x86_64 GNU/Linux
```

```text
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
```

```text
Client:
Version: 20.10.5+dfsg1
API version: 1.41
Go version: go1.15.15
Git commit: 55c4c88
Built: Sat Dec 4 10:53:03 2021
OS/Arch: linux/amd64
Context: default
Experimental: true

Server:
Engine:
Version: 20.10.5+dfsg1
API version: 1.41 (minimum version 1.12)
Go version: go1.15.15
Git commit: 363e9a8
Built: Sat Dec 4 10:53:03 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.13~ds1
GitCommit: 1.4.13~ds1-1~deb11u1
runc:
Version: 1.0.0~rc93+ds1
GitCommit: 1.0.0~rc93+ds1-5+b2
docker-init:
Version: 0.19.0
GitCommit:
```

### Reproduction steps

Pre

- Setup jenkins-intergation in gitlab
- Setup gitlab plugins in jenkins

Steps

- Use any of pipeline

```groovy
gitlabBuilds(builds: ['step1', 'step2']) {
node() {
gitlabCommitStatus('step1') {
sh 'sleep 1'
}
gitlabCommitStatus('step2') {
sh 'sleep 1'
}
}
}
```

```groovy
gitlabBuilds(builds: ['step1', 'step2']) {
node() {
stage('step1') {
gitlabCommitStatus('step1') {
sh 'sleep 1'
}
}
stage('step2') {
gitlabCommitStatus('step2') {
sh 'sleep 1'
}
}
}
}
```

```groovy
node() {
gitlabBuilds(builds: ['step1', 'step2']) {
gitlabCommitStatus('step1') {
sh 'sleep 1'
}
gitlabCommitStatus('step2') {
sh 'sleep 1'
}
}
}
```

```groovy
node() {
gitlabBuilds(builds: ['step1', 'step2']) {
stage('step1') {
gitlabCommitStatus('step1') {
sh 'sleep 1'
}
}
stage('step2') {
gitlabCommitStatus('step2') {
sh 'sleep 1'
}
}
}
}
```

### Expected Results

- gitlabBuilds create job called `jenkins` as pending
- gitlabBuilds create job called `step1` and `step2` as pending
- gitlabCommitStatus update `step1` into running
- gitlabCommitStatus update `step1` into success
- gitlabCommitStatus update `step2` into running
- gitlabCommitStatus update `step1` into success
- gitlabBuilds update `jenkins` into success

> I can't make a expected result screenshot, This picture take from other pipeline

![3](https://user-images.githubusercontent.com/8266702/173222482-3fd8259d-2db5-4726-bca6-ddf2c02514ee.jpg)

### Actual Results

> gitlabBuilds update `jenkins` into success

This step failed, Causing job running forever

![1](https://user-images.githubusercontent.com/8266702/173222562-efa36a22-483d-4e64-98aa-eda5de5d5637.jpg)
![2](https://user-images.githubusercontent.com/8266702/173222565-a4d65a42-aa09-42d8-94b4-58731758e4af.jpg)

### Anything else?

_No response_

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.