Skip to content

Add optional ref parameter to Contributors API endpoint

What does this MR do and why?

Adds an optional ref parameter to the Repository - Contributors API endpoint to match the functionality that is already possible using the Contributor analytics UI page.

Brought up by customer in Zendesk ticket (internal).

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Default With ref
image image

How to set up and validate locally

  1. Import or create a project from an existing repo, such as pages/plain-html
  2. Create a new branch
  3. Commit a change to the new branch
  4. Call the API endpoint without the ref option
    • https://gitlab.example.com/api/v4/projects/:id/repository/contributors
  5. Call the API endpoint with the ref option
    • https://gitlab.example.com/api/v4/projects/:id/repository/contributors?ref=:ref

Related to #207479 (closed)

Edited by Jio Castillo

Merge request reports

Loading