jenkinsci / jenkinsci/gitlab-plugin
Silently failing on "301 Moved Permanently" returned from GitLab on status update
- Dominant language
- Java
- Stars
- 1.4k
- Forks
- 615
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 10
Description
## Issue
### Context
- **Gitlab plugin version**: 1.5.1
- **Gitlab version**: 9.4.4
- **Jenkins version**: 2.60
- **Job type**: Freestyle
### Logs & Traces
Request:
```
Call GitLab:
HTTP method: POST
URL: http://gitlab.example.com/api/v4/projects/1/merge_requests/2/notes
```
Response:
```
Got response from GitLab:
URL: http://gitlab.example.com/api/v4/projects/1/merge_requests/2/notes
Status: 301 Moved Permanently
Response headers: [
(...)
Location = [http://gitlab2.example.com/api/v4/projects/1/merge_requests/2/notes],
]
```
### Problem description
The GitLab plugin doesn't follow `301 Moved Permanently` responses from the server. Usually defining the new URL is enough, but there is no error (warning) in the console (that commit status update failed and why) and only browsing logs gives a clue.
The GitLab plugin should print at least a warning on non 20x responses.
Contributor guide
Assessment
This issue has not been assessed yet.