gitlab-plugin icon indicating copy to clipboard operation
gitlab-plugin copied to clipboard

gitlabMergeRequestAssignee is null

Open Minipada opened this issue 5 years ago • 12 comments

Before submitting an issue I have first:

  • [X] read the documentation on the homepage
  • [X] searched for similar already existing issue
  • [X] confirmed that my GitLab webhook is using the http://JENKINS_URL/project endpoint and not the http://JENKINS_URL/job endpoint

(if you have performed all the above, remove the paragraph and continue describing the issue with template below)

Issue

Context

  • Gitlab plugin version: 1.5.13
  • Gitlab version: latest (gitlab.com)
  • Jenkins version: 2.169
  • Job type: Pipeline

Problem description

I'm trying to get the variable gitlabMergeRequestAssignee in my pipeline but it is equal to null. Right now, other variables are accessible but not this one. Is it deprecated? Thanks

Minipada avatar Nov 12 '19 17:11 Minipada

I am also having this issue, and getting an error saying the variable is not available

  • GitLab Plugin: 1.5.13
  • Jenkins: 2.222.1
  • GitVersion (local): 2.24.1.windows.2
  • GitLab local Server: 12.9.2 (ac5568eb5d8)

I have attempted to echo out the ${gitlabMergeRequestAssignee} and i get the following failure output in Jenkins:

image

All other parts being used are working:

  1. gitlabSourceBranch
  2. gitlabUserName
  3. gitlabSourceBranch
  4. gitlabTargetBranch
  5. gitlabMergeRequestIid

gavinc-git avatar Apr 15 '20 09:04 gavinc-git

I run into the same issue here. I can get any other vars but not the gitlabMergeRequestAssignee.

danqiao avatar Jul 03 '20 02:07 danqiao

I also encountered same issue, I roughly read the codes of gitlab plugin and I guess it is because latest gitlab support multiple assignees so the hook request data field is assignees and it is a list, but seems this plugin still process the assignee as a User model. Should same as inner field assignee_ids.

flymonkey00 avatar Jul 13 '20 20:07 flymonkey00

Hello, I also have the same issue, is there a fix in progress ?

ghost avatar Oct 08 '20 06:10 ghost

Hello everyone, I also have the same issue, is there a solution ?

zhangliangnbu avatar Apr 27 '23 01:04 zhangliangnbu

Hello, I also have the same issue, is there a fix in progress ?

+1

zhangliangnbu avatar Apr 27 '23 01:04 zhangliangnbu

Hello everyone, I also have the same issue, is there a solution ?

No, a fix is not in progress as far as I can tell. Pull requests are welcomed.

MarkEWaite avatar Apr 27 '23 12:04 MarkEWaite

FYI, the problem (at least now) is that the webhook format for Assignees has changed to match the multiple-assignees functionality that was added to GitLab.

As the GitLab documentation states at the end of the "Merge Request event" section, the assignee_id field is deprecated. MRs no longer have a single Assignee, they have a list of Assignees. There webhok now has an array field, assignee_ids, that needs to be parsed instead.

While they list in the latest on-prem 16.0 documentation that it's still set to the first assignee_ids, it sounds like the GitLab.com version (which is ahead of on-prem) has removed it entirely.

mtalexan avatar May 18 '23 19:05 mtalexan

Hi @mtalexan We are currently planning to modernise this GitLab plugin so will be using API version 4 instead of the current version 3 (See https://docs.gitlab.com/ee/api/rest/) plus migrating from RESTEasy to gitlab4j-api as a part of the Jenkins Google Summer of Code (GSoC) 2023 program. Maybe we could also look into this issue this summer.

c.c. @MarkEWaite @harsh-ps-2003

krisstern avatar May 18 '23 19:05 krisstern

Hi @mtalexan https://github.com/mtalexan We are currently planning to modernise this GitLab plugin so will be using API version 4 instead of the current version 3 (See https://docs.gitlab.com/ee/api/rest/) plus migrating from RESTEasy https://resteasy.dev/ to gitlab4j-api https://github.com/gitlab4j/gitlab4j-api as a part of the Jenkins Google Summer of Code (GSoC) 2023 program. Maybe we could also look into this issue this summer.

Sounds excellent. I was merely pointing out the source of the issue. Maybe it would be worth creating Milestone that curated Issues can be added to for the GSoC?

There are a handful of other nice-to-have issues that would probably be excellent for GSoC.

mtalexan avatar May 18 '23 21:05 mtalexan

Hi @mtalexan Yup, creating some milestones with curated issues would be a good idea for GSoC given if we will have time to handle these as well. Do you have any suggested nice-to-have issues that would be nice to use for GSoC 2023?

krisstern avatar May 20 '23 03:05 krisstern

Hi @mtalexan Yup, creating some milestones with curated issues would be a good idea for GSoC given if we will have time to handle these as well. Do you have any suggested nice-to-have issues that would be nice to use for GSoC 2023?

I hadn't created Issues for them yet, but I can.

mtalexan avatar May 22 '23 22:05 mtalexan