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

gitlabCommitStatus does not work with gitlab 16.0.1

Open rlagoue opened this issue 2 years ago • 19 comments

Jenkins and plugins versions report

Any attempt to update the commit status on Gitlab (version 16.0.1) fails with the error code "Failed to retrieve projectId for project <projectNameWithNameSpace>".

After investigation I found out that it is caused by an api change on the gitlab side. The endpoint "/projects/" no more works properly with project name as value, only project id are accepted instead.

The problem occurs on the version [1.7.14] of gitlab-plugin

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

Ubuntu 22.04

Reproduction steps

  1. Install gitlab plugin as recommended in the docs
  2. create jenkins job that update the build status on the gitlab commit
  3. run the job

Expected Results

The jenkins gitlab plugin is able to pass the build status to the gitlab commit

Actual Results

Gitlab responds with a 404 error code when attempting to fetch the project data by "name with namespace"

Anything else?

No response

rlagoue avatar Jun 04 '23 21:06 rlagoue

Also reported in #1496.

Thanks @rlagoue for reporting the issue, we are currently working on modernizing the GitLab Plugin over the summer for GSoC, and have plans to fix this issue as well. Will keep you posted of any updates.

krisstern avatar Jun 05 '23 07:06 krisstern

Any updates?

drakenfly avatar Jul 28 '23 07:07 drakenfly

Hi @drakenfly The GSoC project is still in progress and will not conclude until later in the summer. So there may not be any updates before then.

krisstern avatar Jul 28 '23 08:07 krisstern

This is a pretty big problem to leave un-fixed pending a complete rework for GSoC. Our entire set of project pipelines is dead in the water until this is fixed.

robross0606 avatar Aug 14 '23 10:08 robross0606

My apologies, let me try and get this fixed with a patch this week.

krisstern avatar Aug 14 '23 11:08 krisstern

This might be the root cause: https://docs.gitlab.com/ee/update/deprecations.html?removal_milestone=16.0#legacy-urls-replaced-or-removed

The description says "GitLab APIs are not affected by this change" but that may be incorrect.

robross0606 avatar Aug 14 '23 11:08 robross0606

Looks like this indeed impacted webhooks: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57734.

This was deprecated a while ago, but they removed the automatic redirects in 16.0.

robross0606 avatar Aug 14 '23 12:08 robross0606

Turns out we still need to work out a few testing issues before a new version of GitLab plugin can be released... We are working at it full speed though.

krisstern avatar Aug 20 '23 12:08 krisstern

Six months later. Any progress?

robross0606 avatar Jan 09 '24 19:01 robross0606

Six months later. Any progress?

We've run several tests, but the testing is not complete. Would you like to help with the testing?

MarkEWaite avatar Jan 09 '24 19:01 MarkEWaite

What kind of testing?

robross0606 avatar Jan 09 '24 19:01 robross0606

What kind of testing?

Test the prototype plugin binary in your usual work. Look for places where the new implementation behaves unexpectedly compared to the existing implementation. The automated tests pass, but they are not nearly deep enough to assure that we retain the level of compatibility that users expect.

MarkEWaite avatar Jan 09 '24 19:01 MarkEWaite

Ah, we cannot do that in our current production environment. I would need to stand up a set of completely different servers to do that. Since this bug has been left so long, we've had not choice but to focus our attention on migrating to native GitLab pipelines and we no longer have a set of development/test servers for Jenkins. With this plugin broken for months, we had little choice but to move to something that worked.

robross0606 avatar Jan 09 '24 19:01 robross0606

Since we're dead in the water right now and this is dragging for months and months, is there a beta version of this plugin we could use to test?

robross0606 avatar Apr 09 '24 15:04 robross0606

We do some branches to be tested by some users. They are:

  1. https://github.com/jenkinsci/gitlab-plugin/pull/1553
  2. https://github.com/jenkinsci/gitlab-plugin/pull/1566
  3. Docs: https://github.com/jenkinsci/gitlab-plugin/pull/1556

We are going to continue working on the modernisation over the next few months. So feel free to test these.

krisstern avatar Apr 09 '24 15:04 krisstern

If we work fast enough we can turn these PR's into a beta version to be released for testing next month or so.

krisstern avatar Apr 09 '24 15:04 krisstern

If we work fast enough we can turn these PR's into a beta version to be released for testing next month or so.

What's the status of this?

jwhitcraft avatar Aug 13 '24 15:08 jwhitcraft

This is still not fixed?

robross0606 avatar Jan 09 '25 20:01 robross0606

Yes, I believe this has not yet been fixed, but any contribution towards that effort is welcome

krisstern avatar Jan 15 '25 15:01 krisstern