Skip to content

Repository API returns zero for additions and deletions

Summary

GitLab offers an API endpoint to access information about a repository, like contributors [1]. However, this endpoint seems to be broken right now on gitlab.com. Whenever I request contributors for a repository on https://gitlab.com, additions/deletions are always zero. All other fields in the API response are correctly set though, so a misuse of the API can be excluded.

[1] https://docs.gitlab.com/ee/api/repositories.html#contributors

Steps to reproduce

To reproduce the bug, have a look at the API response for

https://gitlab.com/api/v4/projects/inkscape%2Finkscape/repository/contributors?order_by=commits&sort=desc

The numbers do not make sense.

Example Project

No code is necessary to reproduce the bug. A simple GET request with the browser to the before-mentioned API is enough to illustrate the problem.

What is the current bug behavior?

When calling the API end point, the reported number of additions/deletions are always zero.

What is the expected correct behavior?

The numbers should reflect contributions in the repository or should (at least) be consistent with the numbers shown on the web.

Relevant logs and/or screenshots

n/a

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

Expand for output related to GitLab environment info
No coding environment necessary to illustrate the bug.

Results of GitLab application Check

Expand for output related to the GitLab application check
No coding environment necessary to illustrate the bug.

Possible fixes

n/a

Proposal

Deprecate these attributes, and remove them from the API in v5. See #233119 (comment 397994156)

Edited by Dan Jensen