jenkinsci / jenkinsci/gitlab-plugin

Close merge request build are not triggered in version 1.5.10 and 1.5.11

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

Description

## Issue

### Context

- Gitlab plugin version: 1.5.11 and 1.5.10
- Gitlab version: 10.8.6-ce
- Jenkins version: 2.150.2
- Job type: Pipeline

I have a CI system with jenkins and Gitlab. Three months ago, my boss upgade gitlab plugin from 1.5.9 to 1.5.10. A day later, i close a merge request and see that close merge request event are not trigger any build, although I still see merge request hook still received and handled by Gitlab plugin.

Then i go to my PC and setup a demo environment with gitlab v10 and v11, with Jenkins Gitlab plugin version is 1.5.9, and merge request build work again. Therefore, i think that we has some problem with Jenkins Gitlab plugin version 1.5.10 and 1.5.11.

Can you help me resolve this problem ? Thank you very much.

Below is logs in Jenkins log from my test when i click "close merge request" button in gitlab.

### Logs & Traces

#### With v1.5.10 and v1.5.11

```log
Feb 03, 2019 10:23:32 AM INFO com.dabsquared.gitlabjenkins.webhook.GitLabWebHook getDynamic

WebHook called with url: /project/spring_test_close_mr

Feb 03, 2019 10:23:32 AM FINE com.dabsquared.gitlabjenkins.webhook.build.MergeRequestBuildAction

MergeRequest: {
"object_kind" : "merge_request",
"event_type" : "merge_request",
"user" : {
"name" : "cicd_bot",
"username" : "cicd_bot",
"avatar_url" : "https://www.gravatar.com/avatar/4544bb20d88b39400e2b1a8262b9d875?s=80&d=identicon"
},
"project" : {
"id" : 1,
"name" : "spring_test",
"description" : "",
"web_url" : "http://gitlab:8180/cicd_bot/spring_test",
"avatar_url" : null,
"git_ssh_url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"git_http_url" : "http://gitlab:8180/cicd_bot/spring_test.git",
"namespace" : "cicd_bot",
"visibility_level" : 20,
"path_with_namespace" : "cicd_bot/spring_test",
"default_branch" : "master",
"ci_config_path" : null,
"homepage" : "http://gitlab:8180/cicd_bot/spring_test",
"url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"ssh_url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"http_url" : "http://gitlab:8180/cicd_bot/spring_test.git"
},
"object_attributes" : {
"assignee_id" : null,
"author_id" : 2,
"created_at" : "2019-02-03 10:21:59 UTC",
"description" : "",
"head_pipeline_id" : null,
"id" : 5,
"iid" : 5,
"last_edited_at" : null,
"last_edited_by_id" : null,
"merge_commit_sha" : null,
"merge_error" : null,
"merge_params" : {
"force_remove_source_branch" : "0"
},
"merge_status" : "can_be_merged",
"merge_user_id" : null,
"merge_when_pipeline_succeeds" : false,
"milestone_id" : null,
"source_branch" : "test-mr",
"source_project_id" : 1,
"state" : "closed",
"target_branch" : "master",
"target_project_id" : 1,
"time_estimate" : 0,
"title" : "Test mr",
"updated_at" : "2019-02-03 10:23:32 UTC",
"updated_by_id" : null,
"url" : "http://gitlab:8180/cicd_bot/spring_test/merge_requests/5",
"source" : {
"id" : 1,
"name" : "spring_test",
"description" : "",
"web_url" : "http://gitlab:8180/cicd_bot/spring_test",
"avatar_url" : null,
"git_ssh_url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"git_http_url" : "http://gitlab:8180/cicd_bot/spring_test.git",
"namespace" : "cicd_bot",
"visibility_level" : 20,
"path_with_namespace" : "cicd_bot/spring_test",
"default_branch" : "master",
"ci_config_path" : null,
"homepage" : "http://gitlab:8180/cicd_bot/spring_test",
"url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"ssh_url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"http_url" : "http://gitlab:8180/cicd_bot/spring_test.git"
},
"target" : {
"id" : 1,
"name" : "spring_test",
"description" : "",
"web_url" : "http://gitlab:8180/cicd_bot/spring_test",
"avatar_url" : null,
"git_ssh_url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"git_http_url" : "http://gitlab:8180/cicd_bot/spring_test.git",
"namespace" : "cicd_bot",
"visibility_level" : 20,
"path_with_namespace" : "cicd_bot/spring_test",
"default_branch" : "master",
"ci_config_path" : null,
"homepage" : "http://gitlab:8180/cicd_bot/spring_test",
"url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"ssh_url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"http_url" : "http://gitlab:8180/cicd_bot/spring_test.git"
},
"last_commit" : {
"id" : "dfc260d71bafb33bbdf04033b13199bf254c6c88",
"message" : "test again\n",
"timestamp" : "2019-01-30T22:39:26+07:00",
"url" : "http://gitlab:8180/cicd_bot/spring_test/commit/dfc260d71bafb33bbdf04033b13199bf254c6c88",
"author" : {
"name" : "cicd_bot",
"email" : "conghm96@gmail.com"
}
},
"work_in_progress" : false,
"total_time_spent" : 0,
"human_total_time_spent" : null,
"human_time_estimate" : null,
"action" : "close"
},
"labels" : [ ],
"changes" : {
"state" : {
"previous" : "opened",
"current" : "closed"
},
"updated_at" : {
"previous" : "2019-02-03 10:21:59 UTC",
"current" : "2019-02-03 10:23:32 UTC"
},
"total_time_spent" : {
"previous" : null,
"current" : 0
}
},
"repository" : {
"name" : "spring_test",
"url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"description" : "",
"homepage" : "http://gitlab:8180/cicd_bot/spring_test"
}
}
// end of log.
```

#### With v1.5.9

```log
WebHook called with url: /project/spring_test_close_mr

Feb 03, 2019 11:43:30 AM FINE com.dabsquared.gitlabjenkins.webhook.build.MergeRequestBuildAction

MergeRequest: {
"object_kind" : "merge_request",
"event_type" : "merge_request",
"user" : {
"name" : "cicd_bot",
"username" : "cicd_bot",
"avatar_url" : "https://www.gravatar.com/avatar/4544bb20d88b39400e2b1a8262b9d875?s=80&d=identicon"
},
"project" : {
"id" : 1,
"name" : "spring_test",
"description" : "",
"web_url" : "http://gitlab:8180/cicd_bot/spring_test",
"avatar_url" : null,
"git_ssh_url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"git_http_url" : "http://gitlab:8180/cicd_bot/spring_test.git",
"namespace" : "cicd_bot",
"visibility_level" : 20,
"path_with_namespace" : "cicd_bot/spring_test",
"default_branch" : "master",
"ci_config_path" : null,
"homepage" : "http://gitlab:8180/cicd_bot/spring_test",
"url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"ssh_url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"http_url" : "http://gitlab:8180/cicd_bot/spring_test.git"
},
"object_attributes" : {
"assignee_id" : null,
"author_id" : 2,
"created_at" : "2019-02-03 11:43:27 UTC",
"description" : "",
"head_pipeline_id" : null,
"id" : 7,
"iid" : 7,
"last_edited_at" : null,
"last_edited_by_id" : null,
"merge_commit_sha" : null,
"merge_error" : null,
"merge_params" : {
"force_remove_source_branch" : "0"
},
"merge_status" : "can_be_merged",
"merge_user_id" : null,
"merge_when_pipeline_succeeds" : false,
"milestone_id" : null,
"source_branch" : "test-mr",
"source_project_id" : 1,
"state" : "closed",
"target_branch" : "master",
"target_project_id" : 1,
"time_estimate" : 0,
"title" : "Test mr",
"updated_at" : "2019-02-03 11:43:30 UTC",
"updated_by_id" : null,
"url" : "http://gitlab:8180/cicd_bot/spring_test/merge_requests/7",
"source" : {
"id" : 1,
"name" : "spring_test",
"description" : "",
"web_url" : "http://gitlab:8180/cicd_bot/spring_test",
"avatar_url" : null,
"git_ssh_url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"git_http_url" : "http://gitlab:8180/cicd_bot/spring_test.git",
"namespace" : "cicd_bot",
"visibility_level" : 20,
"path_with_namespace" : "cicd_bot/spring_test",
"default_branch" : "master",
"ci_config_path" : null,
"homepage" : "http://gitlab:8180/cicd_bot/spring_test",
"url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"ssh_url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"http_url" : "http://gitlab:8180/cicd_bot/spring_test.git"
},
"target" : {
"id" : 1,
"name" : "spring_test",
"description" : "",
"web_url" : "http://gitlab:8180/cicd_bot/spring_test",
"avatar_url" : null,
"git_ssh_url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"git_http_url" : "http://gitlab:8180/cicd_bot/spring_test.git",
"namespace" : "cicd_bot",
"visibility_level" : 20,
"path_with_namespace" : "cicd_bot/spring_test",
"default_branch" : "master",
"ci_config_path" : null,
"homepage" : "http://gitlab:8180/cicd_bot/spring_test",
"url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"ssh_url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"http_url" : "http://gitlab:8180/cicd_bot/spring_test.git"
},
"last_commit" : {
"id" : "dfc260d71bafb33bbdf04033b13199bf254c6c88",
"message" : "test again\n",
"timestamp" : "2019-01-30T22:39:26+07:00",
"url" : "http://gitlab:8180/cicd_bot/spring_test/commit/dfc260d71bafb33bbdf04033b13199bf254c6c88",
"author" : {
"name" : "cicd_bot",
"email" : "conghm96@gmail.com"
}
},
"work_in_progress" : false,
"total_time_spent" : 0,
"human_total_time_spent" : null,
"human_time_estimate" : null,
"action" : "close"
},
"labels" : [ ],
"changes" : {
"state" : {
"previous" : "opened",
"current" : "closed"
},
"updated_at" : {
"previous" : "2019-02-03 11:43:27 UTC",
"current" : "2019-02-03 11:43:30 UTC"
},
"total_time_spent" : {
"previous" : null,
"current" : 0
}
},
"repository" : {
"name" : "spring_test",
"url" : "ssh://git@gitlab:8122/cicd_bot/spring_test.git",
"description" : "",
"homepage" : "http://gitlab:8180/cicd_bot/spring_test"
}
}

Feb 03, 2019 11:43:30 AM INFO com.dabsquared.gitlabjenkins.trigger.handler.AbstractWebHookTriggerHandler handle

spring_test_close_mr triggered for merge request.
// end of log
```

Here is my jenkins job configuration:

```bash-4.4# cat /var/jenkins_home/jobs/spring_test_close_mr/config.xml ```

```xml



false


gitlab_local





false
false
false
false
true
false
both
false
Jenkins please retry a build
false
false
true
All



{AQAAABAAAAAwb8+Lwmf9nkmswf4/mE6lEctG+9DN1Mq4K67QabxGnnPBNjl+abI6N0vW4xVh5Am9E5Wll2HbfUZ5gZUrcmkDMg==}

false





echo "connected"
true


false

```

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.