Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering by label never matches anything #647

Closed
jakub-bochenski opened this issue Oct 26, 2017 · 33 comments · Fixed by #732
Closed

Filtering by label never matches anything #647

jakub-bochenski opened this issue Oct 26, 2017 · 33 comments · Fixed by #732
Assignees
Labels
bug For changelog: Minor bug. Will be listed after features

Comments

@jakub-bochenski
Copy link
Contributor

Issue

Context

  • Gitlab plugin version: 1.4.9 and 1.5.1
  • Gitlab version: 10.0.4
  • Jenkins version: Jenkins ver. 2.73.2
  • Job type: Freestyle

Problem description

After enabling "filter by label" Merge Requests would never trigger.
When I remove the condition the builds trigger as expected.

I've checked that labels in MergeRequestObjectAttributes are always empty.

I've checked that Merge Request Hook events contain the labels in JSON payload and Notes events don't.
Still neither of them works.
Job config:
screenshot_20171026_154318
Web hook config:
screenshot_20171026_154806

@omehegan
Copy link
Member

omehegan commented Nov 9, 2017

Can you look at the User Support section of the README and follow the directions for capturing logs from the plugin? Then add them here, so I can see what happens when the plugin gets this request from GitLab. Thanks!

@jakub-bochenski
Copy link
Contributor Author

jakub-bochenski commented Nov 14, 2017

@omehegan here you go
EDIT: noticed the job had triggerOpenMergeRequestOnPush: "never", but after changing the setting to "both" the builds are still not triggering

Nov 14, 2017 12:32:10 PM INFO com.dabsquared.gitlabjenkins.webhook.GitLabWebHook getDynamic

WebHook called with url: /project/gitla-labels-test

Nov 14, 2017 12:32:10 PM FINE com.dabsquared.gitlabjenkins.webhook.build.PushBuildAction 

Push: {
  "object_kind" : "push",
  "event_name" : "push",
  "before" : "a6eea2035bec03212ccc8a67b07d4f4e3405f969",
  "after" : "604d15164e8c291bdf57acbdca1d20a14b821c95",
  "ref" : "refs/heads/CFS-30206",
  "checkout_sha" : "604d15164e8c291bdf57acbdca1d20a14b821c95",
  "message" : null,
  "user_id" : 86,
  "user_name" : "Jakub Bochenski",
  "user_username" : "acme",
  "user_email" : "acme@acme.com",
  "user_avatar" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
  "project_id" : 1793,
  "project" : {
    "name" : "acme",
    "description" : "",
    "web_url" : "https://git.acme-internal.com/acme/acme_git",
    "avatar_url" : null,
    "git_ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
    "git_http_url" : "https://git.acme-internal.com/acme/acme_git.git",
    "namespace" : "acme",
    "visibility_level" : 10,
    "path_with_namespace" : "acme/acme_git",
    "default_branch" : "develop",
    "ci_config_path" : null,
    "homepage" : "https://git.acme-internal.com/acme/acme_git",
    "url" : "git@git.acme-internal.com:acme/acme_git.git",
    "ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
    "http_url" : "https://git.acme-internal.com/acme/acme_git.git"
  },
  "commits" : [ {
    "id" : "604d15164e8c291bdf57acbdca1d20a14b821c95",
    "message" : "Update CFS-30206.feature",
    "timestamp" : "2017-11-14T12:31:54+00:00",
    "url" : "https://git.acme-internal.com/acme/acme_git/commit/604d15164e8c291bdf57acbdca1d20a14b821c95",
    "author" : {
      "name" : "Jakub Bochenski",
      "email" : "acme@acme.com"
    },
    "added" : [ ],
    "modified" : [ "CFS-30206.feature" ],
    "removed" : [ ]
  } ],
  "total_commits_count" : 1,
  "repository" : {
    "name" : "acme",
    "url" : "git@git.acme-internal.com:acme/acme_git.git",
    "description" : "",
    "homepage" : "https://git.acme-internal.com/acme/acme_git",
    "git_http_url" : "https://git.acme-internal.com/acme/acme_git.git",
    "git_ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
    "visibility_level" : 10
  }
}

Nov 14, 2017 12:32:10 PM INFO com.dabsquared.gitlabjenkins.webhook.GitLabWebHook getDynamic

WebHook called with url: /project/gitla-labels-test

Nov 14, 2017 12:32:10 PM FINE com.dabsquared.gitlabjenkins.webhook.build.MergeRequestBuildAction 

MergeRequest: {
  "object_kind" : "merge_request",
  "user" : {
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon"
  },
  "project" : {
    "name" : "acme",
    "description" : "",
    "web_url" : "https://git.acme-internal.com/acme/acme_git",
    "avatar_url" : null,
    "git_ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
    "git_http_url" : "https://git.acme-internal.com/acme/acme_git.git",
    "namespace" : "acme",
    "visibility_level" : 10,
    "path_with_namespace" : "acme/acme_git",
    "default_branch" : "develop",
    "ci_config_path" : null,
    "homepage" : "https://git.acme-internal.com/acme/acme_git",
    "url" : "git@git.acme-internal.com:acme/acme_git.git",
    "ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
    "http_url" : "https://git.acme-internal.com/acme/acme_git.git"
  },
  "object_attributes" : {
    "id" : 28564,
    "target_branch" : "develop",
    "source_branch" : "CFS-30206",
    "source_project_id" : 1793,
    "author_id" : 86,
    "assignee_id" : null,
    "title" : "Resolve External Issue",
    "created_at" : "2017-10-26 13:22:25 UTC",
    "updated_at" : "2017-11-14 12:31:55 UTC",
    "milestone_id" : null,
    "state" : "opened",
    "merge_status" : "unchecked",
    "target_project_id" : 1793,
    "iid" : 14,
    "description" : "",
    "updated_by_id" : null,
    "merge_error" : null,
    "merge_params" : {
      "force_remove_source_branch" : "0"
    },
    "merge_when_pipeline_succeeds" : false,
    "merge_user_id" : null,
    "merge_commit_sha" : null,
    "deleted_at" : null,
    "approvals_before_merge" : null,
    "rebase_commit_sha" : null,
    "in_progress_merge_commit_sha" : null,
    "lock_version" : null,
    "time_estimate" : 0,
    "squash" : false,
    "last_edited_at" : null,
    "last_edited_by_id" : null,
    "head_pipeline_id" : null,
    "ref_fetched" : true,
    "merge_jid" : null,
    "discussion_locked" : null,
    "source" : {
      "name" : "acme",
      "description" : "",
      "web_url" : "https://git.acme-internal.com/acme/acme_git",
      "avatar_url" : null,
      "git_ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
      "git_http_url" : "https://git.acme-internal.com/acme/acme_git.git",
      "namespace" : "acme",
      "visibility_level" : 10,
      "path_with_namespace" : "acme/acme_git",
      "default_branch" : "develop",
      "ci_config_path" : null,
      "homepage" : "https://git.acme-internal.com/acme/acme_git",
      "url" : "git@git.acme-internal.com:acme/acme_git.git",
      "ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
      "http_url" : "https://git.acme-internal.com/acme/acme_git.git"
    },
    "target" : {
      "name" : "acme",
      "description" : "",
      "web_url" : "https://git.acme-internal.com/acme/acme_git",
      "avatar_url" : null,
      "git_ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
      "git_http_url" : "https://git.acme-internal.com/acme/acme_git.git",
      "namespace" : "acme",
      "visibility_level" : 10,
      "path_with_namespace" : "acme/acme_git",
      "default_branch" : "develop",
      "ci_config_path" : null,
      "homepage" : "https://git.acme-internal.com/acme/acme_git",
      "url" : "git@git.acme-internal.com:acme/acme_git.git",
      "ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
      "http_url" : "https://git.acme-internal.com/acme/acme_git.git"
    },
    "last_commit" : {
      "id" : "604d15164e8c291bdf57acbdca1d20a14b821c95",
      "message" : "Update CFS-30206.feature",
      "timestamp" : "2017-11-14T12:31:54+00:00",
      "url" : "https://git.acme-internal.com/acme/acme_git/commit/604d15164e8c291bdf57acbdca1d20a14b821c95",
      "author" : {
        "name" : "Jakub Bochenski",
        "email" : "acme@acme.com"
      }
    },
    "work_in_progress" : false,
    "total_time_spent" : 0,
    "human_total_time_spent" : null,
    "human_time_estimate" : null,
    "url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/14",
    "action" : "update",
    "oldrev" : "a6eea2035bec03212ccc8a67b07d4f4e3405f969"
  },
  "labels" : [ {
    "id" : 128,
    "title" : "ui-only",
    "color" : "#5CB85C",
    "project_id" : 1793,
    "created_at" : "2017-10-26 12:31:45 UTC",
    "updated_at" : "2017-10-26 12:31:45 UTC",
    "template" : false,
    "description" : null,
    "type" : "ProjectLabel",
    "group_id" : null
  } ],
  "repository" : {
    "name" : "acme",
    "url" : "git@git.acme-internal.com:acme/acme_git.git",
    "description" : "",
    "homepage" : "https://git.acme-internal.com/acme/acme_git"
  }
}

Updated trigger config:

<com.dabsquared.gitlabjenkins.GitLabPushTrigger plugin="gitlab-plugin@1.5.1-SNAPSHOT"><spec/><triggerOnPush>true</triggerOnPush><triggerOnMergeRequest>true</triggerOnMergeRequest><triggerOnPipelineEvent>false</triggerOnPipelineEvent><triggerOnAcceptedMergeRequest>false</triggerOnAcceptedMergeRequest><triggerOnClosedMergeRequest>false</triggerOnClosedMergeRequest><triggerOpenMergeRequestOnPush>both</triggerOpenMergeRequestOnPush><triggerOnNoteRequest>true</triggerOnNoteRequest><noteRegex>Jenkins please retry a build</noteRegex><ciSkip>true</ciSkip><skipWorkInProgressMergeRequest>true</skipWorkInProgressMergeRequest><setBuildDescription>true</setBuildDescription><branchFilterType>All</branchFilterType><includeBranchesSpec/><excludeBranchesSpec/><targetBranchRegex/><mergeRequestLabelFilterConfig><include>ui-only</include><exclude/></mergeRequestLabelFilterConfig><secretToken>REDACTED</secretToken></com.dabsquared.gitlabjenkins.GitLabPushTrigger>

@jakub-bochenski
Copy link
Contributor Author

re. comment #664 (comment)
I've checked this again.

Builds trigger properly if there is no label filter.
Builds do not trigger if there is any label filter.

Any chance this will be investigated soon?

@jakub-bochenski
Copy link
Contributor Author

Here is the full log from:

  • trigger build (w/o label filter)
  • add label filter
  • hook is received but no build is triggered
Nov 21, 2017 1:54:23 PM INFO com.dabsquared.gitlabjenkins.webhook.GitLabWebHook getDynamic

WebHook called with url: /project/gitla-labels-test

Nov 21, 2017 1:54:23 PM FINE com.dabsquared.gitlabjenkins.webhook.build.MergeRequestBuildAction 

MergeRequest: {
  "object_kind" : "merge_request",
  "user" : {
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon"
  },
  "project" : {
    "name" : "acme",
    "description" : "",
    "web_url" : "https://git.acme-internal.com/acme/acme_git",
    "avatar_url" : null,
    "git_ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
    "git_http_url" : "https://git.acme-internal.com/acme/acme_git.git",
    "namespace" : "acme",
    "visibility_level" : 10,
    "path_with_namespace" : "acme/acme_git",
    "default_branch" : "develop",
    "ci_config_path" : null,
    "homepage" : "https://git.acme-internal.com/acme/acme_git",
    "url" : "git@git.acme-internal.com:acme/acme_git.git",
    "ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
    "http_url" : "https://git.acme-internal.com/acme/acme_git.git"
  },
  "object_attributes" : {
    "id" : 28564,
    "target_branch" : "develop",
    "source_branch" : "CFS-30206",
    "source_project_id" : 1793,
    "author_id" : 86,
    "assignee_id" : null,
    "title" : "Resolve External Issue",
    "created_at" : "2017-10-26 13:22:25 UTC",
    "updated_at" : "2017-11-21 13:54:10 UTC",
    "milestone_id" : null,
    "state" : "opened",
    "merge_status" : "unchecked",
    "target_project_id" : 1793,
    "iid" : 14,
    "description" : "",
    "updated_by_id" : 86,
    "merge_error" : null,
    "merge_params" : {
      "force_remove_source_branch" : "0"
    },
    "merge_when_pipeline_succeeds" : false,
    "merge_user_id" : null,
    "merge_commit_sha" : null,
    "deleted_at" : null,
    "approvals_before_merge" : null,
    "rebase_commit_sha" : null,
    "in_progress_merge_commit_sha" : null,
    "lock_version" : null,
    "time_estimate" : 0,
    "squash" : false,
    "last_edited_at" : null,
    "last_edited_by_id" : null,
    "head_pipeline_id" : null,
    "ref_fetched" : true,
    "merge_jid" : null,
    "discussion_locked" : null,
    "source" : {
      "name" : "acme",
      "description" : "",
      "web_url" : "https://git.acme-internal.com/acme/acme_git",
      "avatar_url" : null,
      "git_ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
      "git_http_url" : "https://git.acme-internal.com/acme/acme_git.git",
      "namespace" : "acme",
      "visibility_level" : 10,
      "path_with_namespace" : "acme/acme_git",
      "default_branch" : "develop",
      "ci_config_path" : null,
      "homepage" : "https://git.acme-internal.com/acme/acme_git",
      "url" : "git@git.acme-internal.com:acme/acme_git.git",
      "ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
      "http_url" : "https://git.acme-internal.com/acme/acme_git.git"
    },
    "target" : {
      "name" : "acme",
      "description" : "",
      "web_url" : "https://git.acme-internal.com/acme/acme_git",
      "avatar_url" : null,
      "git_ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
      "git_http_url" : "https://git.acme-internal.com/acme/acme_git.git",
      "namespace" : "acme",
      "visibility_level" : 10,
      "path_with_namespace" : "acme/acme_git",
      "default_branch" : "develop",
      "ci_config_path" : null,
      "homepage" : "https://git.acme-internal.com/acme/acme_git",
      "url" : "git@git.acme-internal.com:acme/acme_git.git",
      "ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
      "http_url" : "https://git.acme-internal.com/acme/acme_git.git"
    },
    "last_commit" : {
      "id" : "ed38d4989d4dc53492dfa1828051a14d17f720bc",
      "message" : "Update CFS-30206.feature",
      "timestamp" : "2017-11-21T13:54:09+00:00",
      "url" : "https://git.acme-internal.com/acme/acme_git/commit/ed38d4989d4dc53492dfa1828051a14d17f720bc",
      "author" : {
        "name" : "Jakub Bochenski",
        "email" : "acme@acme.com"
      }
    },
    "work_in_progress" : false,
    "total_time_spent" : 0,
    "human_total_time_spent" : null,
    "human_time_estimate" : null,
    "url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/14",
    "action" : "update",
    "oldrev" : "64ea994b8217c8fd5b5872433481975308127e35"
  },
  "labels" : [ {
    "id" : 128,
    "title" : "ui-only",
    "color" : "#5CB85C",
    "project_id" : 1793,
    "created_at" : "2017-10-26 12:31:45 UTC",
    "updated_at" : "2017-10-26 12:31:45 UTC",
    "template" : false,
    "description" : null,
    "type" : "ProjectLabel",
    "group_id" : null
  } ],
  "repository" : {
    "name" : "acme",
    "url" : "git@git.acme-internal.com:acme/acme_git.git",
    "description" : "",
    "homepage" : "https://git.acme-internal.com/acme/acme_git"
  }
}

Nov 21, 2017 1:54:23 PM INFO com.dabsquared.gitlabjenkins.trigger.handler.AbstractWebHookTriggerHandler handle

gitla-labels-test triggered for merge request.

Nov 21, 2017 1:54:23 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder$LoggingFilter filter

Got response from GitLab:
URL: https://git.acme-internal.com/api/v4/projects/1793/merge_requests?state=opened&page=1&per_page=100
Status: 200 OK
Response headers: [
Cache-Control = [max-age=0, private, must-revalidate],
Connection = [keep-alive],
Content-Length = [12410],
Content-Type = [application/json],
Date = [Tue, 21 Nov 2017 13:54:11 GMT],
Etag = [W/"768845b70c2593c343c8ae9237b55404"],
Link = [<https://git.acme-internal.com/api/v4/projects/1793/merge_requests?id=1793&order_by=created_at&page=1&per_page=100&sort=desc&state=opened>; rel="first", <https://git.acme-internal.com/api/v4/projects/1793/merge_requests?id=1793&order_by=created_at&page=1&per_page=100&sort=desc&state=opened>; rel="last"],
Server = [nginx],
Strict-Transport-Security = [max-age=31536000],
Vary = [Origin],
X-Content-Type-Options = [nosniff],
X-Frame-Options = [SAMEORIGIN],
X-Next-Page = [],
X-Page = [1],
X-Per-Page = [100],
X-Prev-Page = [],
X-Request-Id = [7480b423-721d-4f71-aa9f-f7b36a6654b6],
X-Runtime = [0.285583],
X-Total = [11],
X-Total-Pages = [1]
]
Response body: [ {
  "id" : 28575,
  "iid" : 16,
  "project_id" : 1793,
  "title" : "CFS-30206",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-10-26T13:46:31.476Z",
  "updated_at" : "2017-11-15T17:37:13.738Z",
  "target_branch" : "integration",
  "source_branch" : "CFS-30206-2",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ "non-ui", "ui-only" ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "can_be_merged",
  "sha" : "32e4d985363781f9628e84d0d0cf7286e94f6bbd",
  "merge_commit_sha" : null,
  "user_notes_count" : 3,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/16",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 28564,
  "iid" : 14,
  "project_id" : 1793,
  "title" : "Resolve External Issue",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-10-26T13:22:25.045Z",
  "updated_at" : "2017-11-21T13:54:10.685Z",
  "target_branch" : "develop",
  "source_branch" : "CFS-30206",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ "ui-only" ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "unchecked",
  "sha" : "ed38d4989d4dc53492dfa1828051a14d17f720bc",
  "merge_commit_sha" : null,
  "user_notes_count" : 1,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/14",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 28150,
  "iid" : 12,
  "project_id" : 1793,
  "title" : "Update README.md",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-10-19T13:36:05.665Z",
  "updated_at" : "2017-10-19T16:13:21.513Z",
  "target_branch" : "develop",
  "source_branch" : "MR2",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "cannot_be_merged",
  "sha" : "8a821c8c2f0c597fc3796303fce019f812f44cdf",
  "merge_commit_sha" : null,
  "user_notes_count" : 0,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/12",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 27678,
  "iid" : 10,
  "project_id" : 1793,
  "title" : "CFS-30972 test message",
  "description" : "Test message in README",
  "state" : "opened",
  "created_at" : "2017-10-12T07:42:46.325Z",
  "updated_at" : "2017-10-12T10:44:26.983Z",
  "target_branch" : "integration",
  "source_branch" : "dt-CFS-30972",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 329,
    "name" : "Dominik Tarnawczyk",
    "username" : "dtarnawczyk",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/a8b53bdfea82e48aa6a28c0c61d1db42?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/dtarnawczyk"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "can_be_merged",
  "sha" : "4502d2559e6fcfe478204caf7f1a6f2b8a26fc8d",
  "merge_commit_sha" : null,
  "user_notes_count" : 1,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/10",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 26354,
  "iid" : 8,
  "project_id" : 1793,
  "title" : "CFS-29262 two",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-09-19T16:08:36.752Z",
  "updated_at" : "2017-09-19T16:08:36.752Z",
  "target_branch" : "integration",
  "source_branch" : "bj-CFS-29262",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "can_be_merged",
  "sha" : "cd680ec93b9641c77aa3437666d0ae84739ca733",
  "merge_commit_sha" : null,
  "user_notes_count" : 0,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/8",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 26353,
  "iid" : 7,
  "project_id" : 1793,
  "title" : "CFS-29262 one",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-09-19T16:07:14.050Z",
  "updated_at" : "2017-09-19T16:07:14.050Z",
  "target_branch" : "integration",
  "source_branch" : "jb-CFS-29262",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "can_be_merged",
  "sha" : "1cfda54df67ce6eeab250522fd79851c2e87e90f",
  "merge_commit_sha" : null,
  "user_notes_count" : 0,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/7",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 26343,
  "iid" : 6,
  "project_id" : 1793,
  "title" : "IN-4455",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-09-19T14:12:27.565Z",
  "updated_at" : "2017-09-19T14:12:27.565Z",
  "target_branch" : "integration",
  "source_branch" : "jb-IN-4455",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "can_be_merged",
  "sha" : "a823a7135a29df7a4b27ec93adb0dee133f0e376",
  "merge_commit_sha" : null,
  "user_notes_count" : 0,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/6",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 26326,
  "iid" : 5,
  "project_id" : 1793,
  "title" : "CFS-30044",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-09-19T12:58:35.290Z",
  "updated_at" : "2017-09-19T13:12:22.205Z",
  "target_branch" : "integration",
  "source_branch" : "jb-CFS-30044",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "can_be_merged",
  "sha" : "19842a7479ae387a7be4600e95b049ea1ccfa688",
  "merge_commit_sha" : null,
  "user_notes_count" : 0,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/5",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 26075,
  "iid" : 4,
  "project_id" : 1793,
  "title" : "CFS-30210",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-09-13T16:26:33.299Z",
  "updated_at" : "2017-09-13T16:26:33.299Z",
  "target_branch" : "integration",
  "source_branch" : "cherry-pick-78bef449",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "can_be_merged",
  "sha" : "148f2b983e4658f7a113fedf5028481cce6f138b",
  "merge_commit_sha" : null,
  "user_notes_count" : 0,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/4",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 26074,
  "iid" : 3,
  "project_id" : 1793,
  "title" : "CFS-29493",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-09-13T16:24:01.259Z",
  "updated_at" : "2017-09-19T14:05:42.357Z",
  "target_branch" : "develop",
  "source_branch" : "jb-CFS-30210",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "unchecked",
  "sha" : "78bef4495d0787ca0d94bbe0906e59ca168f9a1e",
  "merge_commit_sha" : null,
  "user_notes_count" : 0,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/3",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 25861,
  "iid" : 2,
  "project_id" : 1793,
  "title" : "CFS-30209",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-09-08T15:49:15.479Z",
  "updated_at" : "2017-09-12T11:14:13.186Z",
  "target_branch" : "integration",
  "source_branch" : "CFS-30209",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "cannot_be_merged",
  "sha" : "43ab4e4aa91782dc8fad6f5aa66d209873852dd5",
  "merge_commit_sha" : null,
  "user_notes_count" : 0,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/2",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
} ]

Nov 21, 2017 1:54:23 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder$LoggingFilter filter

Call GitLab:
HTTP method: GET
URL: https://git.acme-internal.com/api/v4/projects/1793/merge_requests?state=opened&page=2&per_page=100
Request headers: [
Accept = [application/json],
PRIVATE-TOKEN = [****FILTERED****]
]

Nov 21, 2017 1:54:23 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder$LoggingFilter filter

Got response from GitLab:
URL: https://git.acme-internal.com/api/v4/projects/1793/merge_requests?state=opened&page=2&per_page=100
Status: 200 OK
Response headers: [
Cache-Control = [max-age=0, private, must-revalidate],
Connection = [keep-alive],
Content-Length = [2],
Content-Type = [application/json],
Date = [Tue, 21 Nov 2017 13:54:11 GMT],
Etag = [W/"d751713988987e9331980363e24189ce"],
Link = [<https://git.acme-internal.com/api/v4/projects/1793/merge_requests?id=1793&order_by=created_at&page=1&per_page=100&sort=desc&state=opened>; rel="first", <https://git.acme-internal.com/api/v4/projects/1793/merge_requests?id=1793&order_by=created_at&page=1&per_page=100&sort=desc&state=opened>; rel="last"],
Server = [nginx],
Strict-Transport-Security = [max-age=31536000],
Vary = [Origin],
X-Content-Type-Options = [nosniff],
X-Frame-Options = [SAMEORIGIN],
X-Next-Page = [],
X-Page = [2],
X-Per-Page = [100],
X-Prev-Page = [],
X-Request-Id = [ddea75e8-876e-49ef-903c-5637192979cd],
X-Runtime = [0.020965],
X-Total = [11],
X-Total-Pages = [1]
]
Response body: [ ]

Nov 21, 2017 1:54:38 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder$LoggingFilter filter

Call GitLab:
HTTP method: GET
URL: https://git.acme-internal.com/api/v4/projects/acme%2Facme_git/labels
Request headers: [
Accept = [application/json],
PRIVATE-TOKEN = [****FILTERED****]
]

Nov 21, 2017 1:54:38 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder$LoggingFilter filter

Got response from GitLab:
URL: https://git.acme-internal.com/api/v4/projects/acme%2Facme_git/labels
Status: 200 OK
Response headers: [
Cache-Control = [max-age=0, private, must-revalidate],
Connection = [keep-alive],
Content-Length = [352],
Content-Type = [application/json],
Date = [Tue, 21 Nov 2017 13:54:26 GMT],
Etag = [W/"fe5dd12bd211e91a0838dac615d98695"],
Link = [<https://git.acme-internal.com/api/v4/projects/acme%2Facme_git/labels?id=acme%2Facme_git&page=1&per_page=20>; rel="first", <https://git.acme-internal.com/api/v4/projects/acme%2Facme_git/labels?id=acme%2Facme_git&page=1&per_page=20>; rel="last"],
Server = [nginx],
Strict-Transport-Security = [max-age=31536000],
Vary = [Origin],
X-Content-Type-Options = [nosniff],
X-Frame-Options = [SAMEORIGIN],
X-Next-Page = [],
X-Page = [1],
X-Per-Page = [20],
X-Prev-Page = [],
X-Request-Id = [b4266c0e-1a27-40c5-96cf-5d31b95319ba],
X-Runtime = [0.082544],
X-Total = [2],
X-Total-Pages = [1]
]
Response body: [ {
  "id" : 129,
  "name" : "non-ui",
  "color" : "#FFECDB",
  "description" : null,
  "open_issues_count" : 0,
  "closed_issues_count" : 0,
  "open_merge_requests_count" : 1,
  "priority" : null,
  "subscribed" : false
}, {
  "id" : 128,
  "name" : "ui-only",
  "color" : "#5CB85C",
  "description" : null,
  "open_issues_count" : 0,
  "closed_issues_count" : 0,
  "open_merge_requests_count" : 2,
  "priority" : null,
  "subscribed" : false
} ]

Nov 21, 2017 1:54:38 PM FINEST com.dabsquared.gitlabjenkins.service.GitLabProjectLabelsService$LabelNamesLoader call

found these labels for repo git@git.acme-internal.com:acme/acme_git.git : [non-ui, ui-only]

Nov 21, 2017 1:54:55 PM INFO com.dabsquared.gitlabjenkins.webhook.GitLabWebHook getDynamic

WebHook called with url: /project/gitla-labels-test

Nov 21, 2017 1:54:55 PM FINE com.dabsquared.gitlabjenkins.webhook.build.PushBuildAction 

Push: {
  "object_kind" : "push",
  "event_name" : "push",
  "before" : "ed38d4989d4dc53492dfa1828051a14d17f720bc",
  "after" : "7fd6489d96e4dffbd12bd27b14ca392038c81016",
  "ref" : "refs/heads/CFS-30206",
  "checkout_sha" : "7fd6489d96e4dffbd12bd27b14ca392038c81016",
  "message" : null,
  "user_id" : 86,
  "user_name" : "Jakub Bochenski",
  "user_username" : "acme",
  "user_email" : "acme@acme.com",
  "user_avatar" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
  "project_id" : 1793,
  "project" : {
    "name" : "acme",
    "description" : "",
    "web_url" : "https://git.acme-internal.com/acme/acme_git",
    "avatar_url" : null,
    "git_ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
    "git_http_url" : "https://git.acme-internal.com/acme/acme_git.git",
    "namespace" : "acme",
    "visibility_level" : 10,
    "path_with_namespace" : "acme/acme_git",
    "default_branch" : "develop",
    "ci_config_path" : null,
    "homepage" : "https://git.acme-internal.com/acme/acme_git",
    "url" : "git@git.acme-internal.com:acme/acme_git.git",
    "ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
    "http_url" : "https://git.acme-internal.com/acme/acme_git.git"
  },
  "commits" : [ {
    "id" : "7fd6489d96e4dffbd12bd27b14ca392038c81016",
    "message" : "Update CFS-30206.feature",
    "timestamp" : "2017-11-21T13:54:42+00:00",
    "url" : "https://git.acme-internal.com/acme/acme_git/commit/7fd6489d96e4dffbd12bd27b14ca392038c81016",
    "author" : {
      "name" : "Jakub Bochenski",
      "email" : "acme@acme.com"
    },
    "added" : [ ],
    "modified" : [ "CFS-30206.feature" ],
    "removed" : [ ]
  } ],
  "total_commits_count" : 1,
  "repository" : {
    "name" : "acme",
    "url" : "git@git.acme-internal.com:acme/acme_git.git",
    "description" : "",
    "homepage" : "https://git.acme-internal.com/acme/acme_git",
    "git_http_url" : "https://git.acme-internal.com/acme/acme_git.git",
    "git_ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
    "visibility_level" : 10
  }
}

Nov 21, 2017 1:54:55 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder$LoggingFilter filter

Call GitLab:
HTTP method: GET
URL: https://git.acme-internal.com/api/v4/projects/1793/merge_requests?state=opened&page=1&per_page=100
Request headers: [
Accept = [application/json],
PRIVATE-TOKEN = [****FILTERED****]
]

Nov 21, 2017 1:54:55 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder$LoggingFilter filter

Got response from GitLab:
URL: https://git.acme-internal.com/api/v4/projects/1793/merge_requests?state=opened&page=1&per_page=100
Status: 200 OK
Response headers: [
Cache-Control = [max-age=0, private, must-revalidate],
Connection = [keep-alive],
Content-Length = [12414],
Content-Type = [application/json],
Date = [Tue, 21 Nov 2017 13:54:42 GMT],
Etag = [W/"ac60dcd3cb777e10eead3ec044689f3d"],
Link = [<https://git.acme-internal.com/api/v4/projects/1793/merge_requests?id=1793&order_by=created_at&page=1&per_page=100&sort=desc&state=opened>; rel="first", <https://git.acme-internal.com/api/v4/projects/1793/merge_requests?id=1793&order_by=created_at&page=1&per_page=100&sort=desc&state=opened>; rel="last"],
Server = [nginx],
Strict-Transport-Security = [max-age=31536000],
Vary = [Origin],
X-Content-Type-Options = [nosniff],
X-Frame-Options = [SAMEORIGIN],
X-Next-Page = [],
X-Page = [1],
X-Per-Page = [100],
X-Prev-Page = [],
X-Request-Id = [d02acc25-7f5b-4604-b4b7-1fda56c33f0a],
X-Runtime = [0.293644],
X-Total = [11],
X-Total-Pages = [1]
]
Response body: [ {
  "id" : 28575,
  "iid" : 16,
  "project_id" : 1793,
  "title" : "CFS-30206",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-10-26T13:46:31.476Z",
  "updated_at" : "2017-11-15T17:37:13.738Z",
  "target_branch" : "integration",
  "source_branch" : "CFS-30206-2",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ "non-ui", "ui-only" ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "can_be_merged",
  "sha" : "32e4d985363781f9628e84d0d0cf7286e94f6bbd",
  "merge_commit_sha" : null,
  "user_notes_count" : 3,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/16",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 28564,
  "iid" : 14,
  "project_id" : 1793,
  "title" : "Resolve External Issue",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-10-26T13:22:25.045Z",
  "updated_at" : "2017-11-21T13:54:10.685Z",
  "target_branch" : "develop",
  "source_branch" : "CFS-30206",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ "ui-only" ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "can_be_merged",
  "sha" : "7fd6489d96e4dffbd12bd27b14ca392038c81016",
  "merge_commit_sha" : null,
  "user_notes_count" : 1,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/14",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 28150,
  "iid" : 12,
  "project_id" : 1793,
  "title" : "Update README.md",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-10-19T13:36:05.665Z",
  "updated_at" : "2017-10-19T16:13:21.513Z",
  "target_branch" : "develop",
  "source_branch" : "MR2",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "cannot_be_merged",
  "sha" : "8a821c8c2f0c597fc3796303fce019f812f44cdf",
  "merge_commit_sha" : null,
  "user_notes_count" : 0,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/12",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 27678,
  "iid" : 10,
  "project_id" : 1793,
  "title" : "CFS-30972 test message",
  "description" : "Test message in README",
  "state" : "opened",
  "created_at" : "2017-10-12T07:42:46.325Z",
  "updated_at" : "2017-10-12T10:44:26.983Z",
  "target_branch" : "integration",
  "source_branch" : "dt-CFS-30972",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 329,
    "name" : "Dominik Tarnawczyk",
    "username" : "dtarnawczyk",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/a8b53bdfea82e48aa6a28c0c61d1db42?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/dtarnawczyk"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "can_be_merged",
  "sha" : "4502d2559e6fcfe478204caf7f1a6f2b8a26fc8d",
  "merge_commit_sha" : null,
  "user_notes_count" : 1,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/10",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 26354,
  "iid" : 8,
  "project_id" : 1793,
  "title" : "CFS-29262 two",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-09-19T16:08:36.752Z",
  "updated_at" : "2017-09-19T16:08:36.752Z",
  "target_branch" : "integration",
  "source_branch" : "bj-CFS-29262",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "can_be_merged",
  "sha" : "cd680ec93b9641c77aa3437666d0ae84739ca733",
  "merge_commit_sha" : null,
  "user_notes_count" : 0,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/8",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 26353,
  "iid" : 7,
  "project_id" : 1793,
  "title" : "CFS-29262 one",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-09-19T16:07:14.050Z",
  "updated_at" : "2017-09-19T16:07:14.050Z",
  "target_branch" : "integration",
  "source_branch" : "jb-CFS-29262",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "can_be_merged",
  "sha" : "1cfda54df67ce6eeab250522fd79851c2e87e90f",
  "merge_commit_sha" : null,
  "user_notes_count" : 0,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/7",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 26343,
  "iid" : 6,
  "project_id" : 1793,
  "title" : "IN-4455",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-09-19T14:12:27.565Z",
  "updated_at" : "2017-09-19T14:12:27.565Z",
  "target_branch" : "integration",
  "source_branch" : "jb-IN-4455",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "can_be_merged",
  "sha" : "a823a7135a29df7a4b27ec93adb0dee133f0e376",
  "merge_commit_sha" : null,
  "user_notes_count" : 0,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/6",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 26326,
  "iid" : 5,
  "project_id" : 1793,
  "title" : "CFS-30044",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-09-19T12:58:35.290Z",
  "updated_at" : "2017-09-19T13:12:22.205Z",
  "target_branch" : "integration",
  "source_branch" : "jb-CFS-30044",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "can_be_merged",
  "sha" : "19842a7479ae387a7be4600e95b049ea1ccfa688",
  "merge_commit_sha" : null,
  "user_notes_count" : 0,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/5",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 26075,
  "iid" : 4,
  "project_id" : 1793,
  "title" : "CFS-30210",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-09-13T16:26:33.299Z",
  "updated_at" : "2017-09-13T16:26:33.299Z",
  "target_branch" : "integration",
  "source_branch" : "cherry-pick-78bef449",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "can_be_merged",
  "sha" : "148f2b983e4658f7a113fedf5028481cce6f138b",
  "merge_commit_sha" : null,
  "user_notes_count" : 0,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/4",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 26074,
  "iid" : 3,
  "project_id" : 1793,
  "title" : "CFS-29493",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-09-13T16:24:01.259Z",
  "updated_at" : "2017-09-19T14:05:42.357Z",
  "target_branch" : "develop",
  "source_branch" : "jb-CFS-30210",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "unchecked",
  "sha" : "78bef4495d0787ca0d94bbe0906e59ca168f9a1e",
  "merge_commit_sha" : null,
  "user_notes_count" : 0,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/3",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
}, {
  "id" : 25861,
  "iid" : 2,
  "project_id" : 1793,
  "title" : "CFS-30209",
  "description" : "",
  "state" : "opened",
  "created_at" : "2017-09-08T15:49:15.479Z",
  "updated_at" : "2017-09-12T11:14:13.186Z",
  "target_branch" : "integration",
  "source_branch" : "CFS-30209",
  "upvotes" : 0,
  "downvotes" : 0,
  "author" : {
    "id" : 86,
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon",
    "web_url" : "https://git.acme-internal.com/acme"
  },
  "assignee" : null,
  "source_project_id" : 1793,
  "target_project_id" : 1793,
  "labels" : [ ],
  "work_in_progress" : false,
  "milestone" : null,
  "merge_when_pipeline_succeeds" : false,
  "merge_status" : "cannot_be_merged",
  "sha" : "43ab4e4aa91782dc8fad6f5aa66d209873852dd5",
  "merge_commit_sha" : null,
  "user_notes_count" : 0,
  "approvals_before_merge" : null,
  "discussion_locked" : null,
  "should_remove_source_branch" : null,
  "force_remove_source_branch" : false,
  "squash" : false,
  "web_url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/2",
  "time_stats" : {
    "time_estimate" : 0,
    "total_time_spent" : 0,
    "human_time_estimate" : null,
    "human_total_time_spent" : null
  }
} ]

Nov 21, 2017 1:54:55 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder$LoggingFilter filter

Call GitLab:
HTTP method: GET
URL: https://git.acme-internal.com/api/v4/projects/1793/merge_requests?state=opened&page=2&per_page=100
Request headers: [
Accept = [application/json],
PRIVATE-TOKEN = [****FILTERED****]
]

Nov 21, 2017 1:54:55 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder$LoggingFilter filter

Got response from GitLab:
URL: https://git.acme-internal.com/api/v4/projects/1793/merge_requests?state=opened&page=2&per_page=100
Status: 200 OK
Response headers: [
Cache-Control = [max-age=0, private, must-revalidate],
Connection = [keep-alive],
Content-Length = [2],
Content-Type = [application/json],
Date = [Tue, 21 Nov 2017 13:54:43 GMT],
Etag = [W/"d751713988987e9331980363e24189ce"],
Link = [<https://git.acme-internal.com/api/v4/projects/1793/merge_requests?id=1793&order_by=created_at&page=1&per_page=100&sort=desc&state=opened>; rel="first", <https://git.acme-internal.com/api/v4/projects/1793/merge_requests?id=1793&order_by=created_at&page=1&per_page=100&sort=desc&state=opened>; rel="last"],
Server = [nginx],
Strict-Transport-Security = [max-age=31536000],
Vary = [Origin],
X-Content-Type-Options = [nosniff],
X-Frame-Options = [SAMEORIGIN],
X-Next-Page = [],
X-Page = [2],
X-Per-Page = [100],
X-Prev-Page = [],
X-Request-Id = [3def10f8-2627-4503-bced-ab86410d2c0b],
X-Runtime = [0.021814],
X-Total = [11],
X-Total-Pages = [1]
]
Response body: [ ]

Nov 21, 2017 1:54:55 PM INFO com.dabsquared.gitlabjenkins.webhook.GitLabWebHook getDynamic

WebHook called with url: /project/gitla-labels-test

Nov 21, 2017 1:54:55 PM FINE com.dabsquared.gitlabjenkins.webhook.build.MergeRequestBuildAction 

MergeRequest: {
  "object_kind" : "merge_request",
  "user" : {
    "name" : "Jakub Bochenski",
    "username" : "acme",
    "avatar_url" : "https://secure.gravatar.com/avatar/6edf39d50401f0ae151f734ccb1f0986?s=80&d=identicon"
  },
  "project" : {
    "name" : "acme",
    "description" : "",
    "web_url" : "https://git.acme-internal.com/acme/acme_git",
    "avatar_url" : null,
    "git_ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
    "git_http_url" : "https://git.acme-internal.com/acme/acme_git.git",
    "namespace" : "acme",
    "visibility_level" : 10,
    "path_with_namespace" : "acme/acme_git",
    "default_branch" : "develop",
    "ci_config_path" : null,
    "homepage" : "https://git.acme-internal.com/acme/acme_git",
    "url" : "git@git.acme-internal.com:acme/acme_git.git",
    "ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
    "http_url" : "https://git.acme-internal.com/acme/acme_git.git"
  },
  "object_attributes" : {
    "id" : 28564,
    "target_branch" : "develop",
    "source_branch" : "CFS-30206",
    "source_project_id" : 1793,
    "author_id" : 86,
    "assignee_id" : null,
    "title" : "Resolve External Issue",
    "created_at" : "2017-10-26 13:22:25 UTC",
    "updated_at" : "2017-11-21 13:54:42 UTC",
    "milestone_id" : null,
    "state" : "opened",
    "merge_status" : "unchecked",
    "target_project_id" : 1793,
    "iid" : 14,
    "description" : "",
    "updated_by_id" : 86,
    "merge_error" : null,
    "merge_params" : {
      "force_remove_source_branch" : "0"
    },
    "merge_when_pipeline_succeeds" : false,
    "merge_user_id" : null,
    "merge_commit_sha" : null,
    "deleted_at" : null,
    "approvals_before_merge" : null,
    "rebase_commit_sha" : null,
    "in_progress_merge_commit_sha" : null,
    "lock_version" : null,
    "time_estimate" : 0,
    "squash" : false,
    "last_edited_at" : null,
    "last_edited_by_id" : null,
    "head_pipeline_id" : null,
    "ref_fetched" : true,
    "merge_jid" : null,
    "discussion_locked" : null,
    "source" : {
      "name" : "acme",
      "description" : "",
      "web_url" : "https://git.acme-internal.com/acme/acme_git",
      "avatar_url" : null,
      "git_ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
      "git_http_url" : "https://git.acme-internal.com/acme/acme_git.git",
      "namespace" : "acme",
      "visibility_level" : 10,
      "path_with_namespace" : "acme/acme_git",
      "default_branch" : "develop",
      "ci_config_path" : null,
      "homepage" : "https://git.acme-internal.com/acme/acme_git",
      "url" : "git@git.acme-internal.com:acme/acme_git.git",
      "ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
      "http_url" : "https://git.acme-internal.com/acme/acme_git.git"
    },
    "target" : {
      "name" : "acme",
      "description" : "",
      "web_url" : "https://git.acme-internal.com/acme/acme_git",
      "avatar_url" : null,
      "git_ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
      "git_http_url" : "https://git.acme-internal.com/acme/acme_git.git",
      "namespace" : "acme",
      "visibility_level" : 10,
      "path_with_namespace" : "acme/acme_git",
      "default_branch" : "develop",
      "ci_config_path" : null,
      "homepage" : "https://git.acme-internal.com/acme/acme_git",
      "url" : "git@git.acme-internal.com:acme/acme_git.git",
      "ssh_url" : "git@git.acme-internal.com:acme/acme_git.git",
      "http_url" : "https://git.acme-internal.com/acme/acme_git.git"
    },
    "last_commit" : {
      "id" : "7fd6489d96e4dffbd12bd27b14ca392038c81016",
      "message" : "Update CFS-30206.feature",
      "timestamp" : "2017-11-21T13:54:42+00:00",
      "url" : "https://git.acme-internal.com/acme/acme_git/commit/7fd6489d96e4dffbd12bd27b14ca392038c81016",
      "author" : {
        "name" : "Jakub Bochenski",
        "email" : "acme@acme.com"
      }
    },
    "work_in_progress" : false,
    "total_time_spent" : 0,
    "human_total_time_spent" : null,
    "human_time_estimate" : null,
    "url" : "https://git.acme-internal.com/acme/acme_git/merge_requests/14",
    "action" : "update",
    "oldrev" : "ed38d4989d4dc53492dfa1828051a14d17f720bc"
  },
  "labels" : [ {
    "id" : 128,
    "title" : "ui-only",
    "color" : "#5CB85C",
    "project_id" : 1793,
    "created_at" : "2017-10-26 12:31:45 UTC",
    "updated_at" : "2017-10-26 12:31:45 UTC",
    "template" : false,
    "description" : null,
    "type" : "ProjectLabel",
    "group_id" : null
  } ],
  "repository" : {
    "name" : "acme",
    "url" : "git@git.acme-internal.com:acme/acme_git.git",
    "description" : "",
    "homepage" : "https://git.acme-internal.com/acme/acme_git"
  }
}

@enutrofff
Copy link

Any updates?

@djdevin
Copy link

djdevin commented Jan 4, 2018

I can confirm this too. Just does not work.

Removing the label filter, everything is fine.

@omehegan
Copy link
Member

@jakub-bochenski thanks. If other people are seeing this, it sounds like a bug. The code for this has not been changed since 2016, perhaps something changed on the GitLab side. I did notice that in one of your logs the plugin said, gitla-labels-test triggered for merge request. It should have started the build at that point I think.

@Argelbargel or @mreichel would you be able to look at this one? Maybe the label data structure has changed and the plugin is not seeing it?

@omehegan omehegan added the bug For changelog: Minor bug. Will be listed after features label Jan 16, 2018
@jakub-bochenski
Copy link
Contributor Author

@omehegan yes, but that was first bullet of:

- trigger build (w/o label filter)
- add label filter
- hook is received but no build is triggered

just mean to verify builds trigger at all.

@valVk
Copy link

valVk commented Jan 16, 2018

So, it has to be confirmed by community to get status bug?
Than it has happened to me as well.

@mreichel mreichel self-assigned this Jan 16, 2018
@mreichel
Copy link
Contributor

I take a look at it.

@omehegan
Copy link
Member

@valVk about half of the issues people open are "how do I do this" or they missed something in the docs (which need to be improved, it's on my list). So either a few people report the same problem or, if I/we have time, I try to reproduce the issue to confirm.

@valVk
Copy link

valVk commented Jan 17, 2018

@omehegan that's ok. I'm just "watching" this issue something about a month or month and half, and there weren't any actions, until djdevin confirmed that he has this issue also. So I decided that there is something like in ubuntu community if several users confirmed the same issue, than it will labeled as issue or bug etc.

For me this is a big blocker, because I cant launch a build job on a different servers from one repository, and do that job using labels.

@jakub-bochenski
Copy link
Contributor Author

If I can make a suggestion: some projects use the thumbsup count on the issue for this purpose. It has the benefit of not spamming every watcher with "+1" comments.

@mreichel
Copy link
Contributor

Unfortunately, the gitlab documentation is very unclear. I have a fix that solves the problem. BUT, the gitlab API states you get a list of labels back. It is unclear where it is a list of labels and where it is a list of Strings (the labels' names).
Also, in your response (an in my tests) the labels have a title instead of a name while the documentation states it has a name.
So I would rather not merge, but maybe you could use the fix for now. What do you think @Argelbargel and @omehegan

@omehegan
Copy link
Member

omehegan commented Feb 2, 2018

@AYFan or @dblessing can you comment on #647 (comment) from your side?

@benjarobin
Copy link
Contributor

benjarobin commented Feb 11, 2018

@mreichel The documentation indicates "title" and not "name" : https://docs.gitlab.com/ce/user/project/integrations/webhooks.html#merge-request-events Could you point me where the documentation say the opposite ?
They may have changed that...
Anyway the current implementation does not reflect the gitlab documentation, nor what we get in the Webhook. So this is perfectly normal that filtering by label is not working.

@benjarobin
Copy link
Contributor

benjarobin commented Feb 11, 2018

After some digging the fix proposed by @mreichel is mostly wrong.

api/model/Label.java format did not changed, this object is returned by the following request https://docs.gitlab.com/ce/api/labels.html The label name is still in the field "name".

And api/model/MergeRequest.java format did not changed either (https://docs.gitlab.com/ce/api/merge_requests.html), this object in the key "labels" returns an array of String containing the label names. The array does not contain api/model/Label.java object

So the current implementation of the gilabl plugin is valid for these points.

But when implementing filtering by label (a48a098) the labels were retrieved from the object_attributes object.

This is no longer the case, the labels associated with a Merge Request are put in a array (key "labels") at the same level that "object_attributes". Warning: the labels object are not in the same format that api/model/Label.java: The information/fields are not the same.

This implies that a new model class needs to be created in gitlab/hook/model/MergeRequestLabel.java

@omehegan
Copy link
Member

@benjarobin would you be able to submit a PR for this?

@benjarobin
Copy link
Contributor

Well, maybe I can, but it's been 7 years since I have not touched Java.
And I need to find documentation and time about how to setup the development environment.
But I can write a draft pretty quickly (maybe after work...), but it may (certainly ?) not compile...

@omehegan
Copy link
Member

@benjarobin thanks at least for clarifying what the problem might be.

@ayufan @dblessing do you know if anything changed in how GitLab returns labels from API requests? See #647 (comment)

@benjarobin
Copy link
Contributor

@omehegan Ok, it was pretty easy to setup the development environment, I will try to create a pull request this week-end

benjarobin added a commit to benjarobin/gitlab-plugin that referenced this issue Mar 24, 2018
benjarobin added a commit to benjarobin/gitlab-plugin that referenced this issue Mar 25, 2018
@ValeriyDP
Copy link

@omehegan I've just tried this patch, and seemed that It does not work for me.

selection_20180328_3aa7d51
selection_20180328_ca1ccb6
selection_20180328_bf69394
selection_20180328_2d24443

@benjarobin
Copy link
Contributor

benjarobin commented Mar 28, 2018

@omehegan I was able to setup the docker, and indeed the patch that I did write is not working with the following build : gitlab-plugin-1.5.5-20180326.003435-2.hpi. Since the patch was not tested I am not really surprised (sorry about that)... And thank you to point me how to debug / test it with the docker.

@benjarobin
Copy link
Contributor

benjarobin commented Mar 28, 2018

@omehegan I did build my branch, update the plugin using the jenkins Web page, and my build is working fine, I am confused... I am going to double check, but maybe the plugin that you provide is not the right one ?

Edit: The gitlab-plugin-1.5.5-20180326.003435-2.hpi "archive" does not contain the gitlab.hook.MergeRequestLabel.class nor the old name of this new class gitlab.hook.MergeRequestObjectLabel.class (I did rename it in the second push), so this plugin was not built from the branch of the MR #732

@benjarobin
Copy link
Contributor

benjarobin commented Mar 28, 2018

The plugin built here https://ci.jenkins.io/job/Plugins/job/gitlab-plugin/job/PR-732/1/artifact/target/gitlab-plugin-1.5.5-SNAPSHOT.hpi is working fine : The filtering is working

@omehegan
Copy link
Member

@benjarobin yeah you're right, I apologize, I built the master branch of your fork rather than your PR branch. Sorry about that! @valeriy-dp please test the copy that @benjarobin linked just above this.

@Zava2012
Copy link

Zava2012 commented Mar 31, 2018

@omehegan, I confirm that in this snapshot (https://ci.jenkins.io/job/Plugins/job/gitlab-plugin/job/PR-732/1/artifact/target/gitlab-plugin-1.5.5-SNAPSHOT.hpi) the filtering by label works. You can close the Issue #527. Thank You!
GitLab 9.4.5 and GitLab 10.6.2.
But there is still a small bug with the visibility of labels. Plugin sees only the first page of labels on GitLab. The second and subsequent pages of labels are not visible to the plugin.

Also, it would be useful to parse the label as an environment variable. This feature can be found many uses.

@omehegan
Copy link
Member

omehegan commented Apr 4, 2018

@Zava2012 thanks for testing. Can you please open two separate issues for the incomplete list of labels, and the desire to have labels as env vars?

omehegan added a commit that referenced this issue Apr 4, 2018
Fix filtering by label never matches anything. Fixes #647.
@valVk
Copy link

valVk commented Apr 4, 2018

@Zava2012
Could you please provide how to setup this plugin?
I/m not able to start it working (

@Zava2012
Copy link

Zava2012 commented Apr 4, 2018

@valVk, no problem.

  1. Create project on your own GitLab or on GitLab.com.
  2. Add user (for example, user with name jenkins) to GitLab project.
  3. Create credential of your user (for example, jenkins) in Jenkins for GitLab API.
  4. Configure GitLab in system configurations and test connection.
  5. Create credential of your user (for example, jenkins) in Jenkins for GitLab user.
  6. Create webhook in your project to Jenkins job (the reference to job is in settings of job) with Merge Requests Events.
  7. Create merge request in your project.
  8. Configure the job as on the picture below (it will be example):

Notes: i'm only use Opened Merge Request Events feature.
Now i'm tested Accepted Merge Request Events and Closed Merge Request Events features and they don't work.
1
2

@valVk
Copy link

valVk commented Apr 4, 2018

Yes, this is what I got in result too.
Push and Open MR events are working, but the other ones are not working (

@Zava2012
Copy link

Zava2012 commented Apr 5, 2018

@valVk, i create the issue about this problems #740.

@valVk
Copy link

valVk commented Apr 5, 2018

Great, thanks.

exceed-alae pushed a commit to exceed-alae/gitlab-plugin that referenced this issue May 20, 2022
Avoid posting a comment for empty comment files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For changelog: Minor bug. Will be listed after features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants