Skip to content

docs: clarify GitLab API URI must be base URL without /api/v4#237

Open
shubhangamgarg wants to merge 1 commit into
jenkinsci:masterfrom
shubhangamgarg:fix/clarify-gitlab-api-uri-docs
Open

docs: clarify GitLab API URI must be base URL without /api/v4#237
shubhangamgarg wants to merge 1 commit into
jenkinsci:masterfrom
shubhangamgarg:fix/clarify-gitlab-api-uri-docs

Conversation

@shubhangamgarg

@shubhangamgarg shubhangamgarg commented Jun 24, 2026

Copy link
Copy Markdown

Problem

The "GitLab API URI" field label implies users should enter the full
API path (e.g. https://gitlab.example.com/api/v4). However, the plugin
passes this value directly to the GitLabApi constructor (GitLabAuthenticationToken.java:101),
which internally appends /api/v4 via the gitlab4j library.

This results in a doubled path (/api/v4/api/v4/user) → silent 404
→ infinite OAuth redirect loop. The error is hard to diagnose because
Jenkins shows no clear message, just a redirect loop.

Changes

  • docs/README.md: replace stale api/v3 example with explicit
    correct/incorrect examples and warning
  • src/main/webapp/help/realm/gitlab-api-uri-help.html: new help
    tooltip file (the field had no ? help text previously)

Tested

Verified on self-hosted GitLab CE with gitlab-oauth-plugin 1.30
and gitlab4j-api 6.3.0.

Testing done

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

The 'GitLab API URI' field expects a base server URL only.
The plugin passes this value to the GitLabApi constructor in
GitLabAuthenticationToken.java, which internally appends /api/v4
via the gitlab4j library.

Entering the full API path (e.g. https://gitlab.example.com/api/v4)
results in a doubled path (/api/v4/api/v4/user), causing a silent
404 error and an infinite OAuth redirect loop during login.

Changes:
- Add help/realm/gitlab-api-uri-help.html with explicit warning
- Update docs/README.md to remove stale api/v3 reference and
  clarify correct vs incorrect input
@shubhangamgarg shubhangamgarg requested a review from a team as a code owner June 24, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant