fetch count not working from the project statistics API
Summary
The project statistics API is not working for projects. It reports that count of HTTP fetches is 0, even after I git clone
using the HTTPS URL for a project I have write permissions for.
Steps to reproduce
-
Git clone the repository:
git clone https://gitlab.com/<username>/<project>.git
-
Log into gitlab.com with the
<username>
account which has write access to<project>
. -
Query the API:
https://gitlab.com/api/v4/projects/<project_id>/statistics
-
Look at the JSON response:
{"fetches":{"total":0,"days":[]}}
This is the response even though I have git clone
d multiple times and I query the statistics API multiple days after the cloning actions.
Example Project
I have write permissions to the following project and I have HTTP cloned multiple times over recent weeks:
https://gitlab.com/robstewart57/gitlab-haskell
However:
https://gitlab.com/api/v4/projects/11744514/statistics
returns:
{"fetches":{"total":0,"days":[]}}
What is the current bug behavior?
On 10th November 2021 run:
git clone https://gitlab.com/robstewart57/gitlab-haskell.git
gives:
{"fetches":{"total":0,"days":[]}}
What is the expected correct behavior?
On 10th November 2021 run:
git clone https://gitlab.com/robstewart57/gitlab-haskell.git
then
{
"fetches": {
"total": 1,
"days": [
{
"count": 1,
"date": "2021-11-10"
}
]
}
}
As per: https://docs.gitlab.com/ee/api/project_statistics.html
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
www.gitlab.com as on 11.11.2021, which is version 14.5.0-pre .