jenkinsci / jenkinsci/gitlab-plugin

Silently failing on "301 Moved Permanently" returned from GitLab on status update

Open
#660 3 comments 1 reaction 0 assignees View on GitHub
bug
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

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.