jenkinsci / jenkinsci/gitlab-plugin

Feature: Stop Jenkins build if the related Gitlab pipeline has been canceled

Open
#607 9 comments 9 reactions 0 assignees View on GitHub
feature request
Dominant language
Java
Stars
1.4k
Forks
615
Avg merge
4h 32m
Merged PRs (30d)
10

Description

If I cancel pipeline in GitLab
Jenkins get response from Gitlab like this
```
Aug 19, 2017 5:01:27 PM FINEST com.dabsquared.gitlabjenkins.gitlab.GitLabClientBuilder
Got response from GitLab:
URL: https://gitlab.local/api/v3/projects/724/repository/commits/cd3a7656bff11f26dd525f6e9a72e3b8ef4acf2b
Status: 200 OK
Response headers: [
Cache-Control = [max-age=0, private, must-revalidate],
Connection = [keep-alive],
Content-Length = [565],
Content-Type = [application/json],
Date = [Sat, 19 Aug 2017 12:01:27 GMT],
Etag = [W/"048f9623f241e8b4e01feaf9df2f9af4"],
Server = [nginx],
Strict-Transport-Security = [max-age=31536000],
Vary = [Origin],
X-Frame-Options = [SAMEORIGIN],
X-Request-Id = [730a5830-50ed-4d7e-bf0f-05931d46a4e2],
X-Runtime = [0.027535]
]
Response body: {
"id" : "cd3a7656bff11f26dd525f6e9a72e3b8ef4acf2b",
"short_id" : "cd3a7656",
"title" : "Update README.md",
"created_at" : "2017-08-19T17:00:12.000+05:00",
"parent_ids" : [ "46586ec4ea96e1096a24b8929213248080603c6a" ],
"message" : "Update README.md",
"author_name" : "commiter name",
"author_email" : "commiter email",
"authored_date" : "2017-08-19T17:00:12.000+05:00",
"committer_name" : "commiter name",
"committer_email" : "commiter email",
"committed_date" : "2017-08-19T17:00:12.000+05:00",
"stats" : {
"additions" : 3,
"deletions" : 0,
"total" : 3
},
"status" : "canceled"
}
```
I can see **"status" : "canceled"** in this response.
Is it possible to stop Jenkins build if the related Gitlab pipeline has been canceled?
Or remove the build from the Jenkins queue if it is not already running.

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.