jenkinsci / jenkinsci/gitlab-plugin

Cannot update commit-status of project which is in a group (without subgroup)

Open
#1,083 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
1.4k
Forks
615
Avg merge
4h 32m
Merged PRs (30d)
10

Description

## Issue: commit-status update fails if the project is located in a group (without subgroup)
### Context
- **Gitlab plugin version**: 1.5.13
- **Gitlab version**: 12.10.3
- **Jenkins version**: 2.249.1
- **Job type**: multibranch pipeline

### Logs & Traces

```
Oct 07, 2020 2:33:43 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder
Call GitLab:
HTTP method: GET
URL: https://company.gitlab.com/api/v4/projects/group%2Fproject-repo/repository/commits/043be45dc058b20797996167e679ad494fbdd74f
Request headers: [
Accept = [application/json],
PRIVATE-TOKEN = [****FILTERED****]
]
Oct 07, 2020 2:33:43 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder
Got response from GitLab:
URL: https://company.gitlab.com/api/v4/projects/group%2Fproject-repo/repository/commits/043be45dc058b20797996167e679ad494fbdd74f
Status: 404 Not Found
Response headers: [
Cache-Control = [no-cache],
Connection = [Keep-Alive],
Content-Length = [35],
Content-Type = [application/json],
Date = [Wed, 07 Oct 2020 12:33:43 GMT],
Keep-Alive = [timeout=5, max=99],
Server = [Apache],
Strict-Transport-Security = [max-age=15768000;includeSubdomains],
Vary = [Origin],
X-Content-Type-Options = [nosniff],
X-Frame-Options = [SAMEORIGIN],
X-Request-Id = [ipkiFbMntS1],
X-Runtime = [0.024896]
]
Response body: {
"message" : "404 Project Not Found"
}
Oct 07, 2020 2:33:43 PM FINE com.dabsquared.gitlabjenkins.util.CommitStatusUpdater
Project (group/project-repo) and commit (043be45dc058b20797996167e679ad494fbdd74f) combination not found
```

### Problem description

I'm having a very similar issue as this one from 2017: https://github.com/jenkinsci/gitlab-plugin/issues/538
However, I'm using the latest plugin version (**1.5.13**)

The repository is directly under a group (no subgroup) and the plugin calls the endpoint incorrectly:

`company.gitlab.com/api/v4/projects/subgroup%2Fproject-repo/repository/commits/043be45dc058b20797996167e679ad494fbdd74f`

The commit can be visited in the browser through this link:
`company.gitlab.com/group/project-repo/-/commit/043be45dc058b20797996167e679ad494fbdd74f`

Should be there an extra dash for the missing subgroup?

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.