jenkinsci / gitlab-plugin

A Jenkins plugin for interfacing with GitLab
https://plugins.jenkins.io/gitlab-plugin/
GNU General Public License v2.0
1.44k stars 619 forks source link

Gitlab with context path /gitlab - Commit url - 404 #1634

Closed m-dinesh-kumar closed 3 months ago

m-dinesh-kumar commented 9 months ago

Jenkins and plugins versions report

We have the gitlab hosted under context path

When the Gitlab hook is triggered to Jenkins, the gitlab-plugin returns the response as below. The commit id url is throwing 404 error, when removing /gitlab its working. I believe the project specific url mapping is not using the plugin Gitlab url. It uses

Plugin Version: 1.8.0 Jenkins Version: 2.426

Call GitLab:
HTTP method: GET
URL: https://[DOMAIN_NAME]/gitlab/api/v4/projects/gitlab%2Fproject-name%2Fjenkins%2Ftest-backend/repository/commits/52c5fea3d5fd40a86e476abef9bae80d1863368b
Request headers: [
Accept = [application/json],
PRIVATE-TOKEN = [****FILTERED****]
]
Feb 23, 2024 1:22:35 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder
Got response from GitLab:
URL: https://[DOMAIN_NAME]/gitlab/api/v4/projects/gitlab%2Fproject-name%2Fjenkins%2Ftest-backend/repository/commits/52c5fea3d5fd40a86e476abef9bae80d1863368b
Status: 404 Not Found
Response headers: [
Access-Control-Allow-Credentials = [true],

Please assist on this

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

Ubuntu OS 20.04 LTS Plugin Version: 1.8.0 Jenkins Version: 2.426

Reproduction steps

Host the gitlab using context path and set that url in the Gitlab plugin as below

https://[DOMAIN_NAME]/gitlab

Expected Results

https://[DOMAIN_NAME]/gitlab/api/v4/projects/project-name%2Fjenkins%2Ftest-backend/repository/commits/52c5fea3d5fd40a86e476ab

Without /gitlab after /api/v4/projects

Actual Results

https://[DOMAIN_NAME]/gitlab/api/v4/projects/gitlab%2Fproject-name%2Fjenkins%2Ftest-backend/repository/commits/52c5fea3d5fd40a86e476ab

Anything else?

No response

Are you interested in contributing a fix?

No response

m-dinesh-kumar commented 7 months ago

Hi

Any update on using the context path

MarkEWaite commented 7 months ago

Any update on using the context path

No update. Pull requests are welcomed.