Export additional project statistics through API

Summary

To implement https://gitlab.gnome.org/pwithnall/gitlab-stats/, which shows environmental statistics for a gitlab project and its forks, the developer unfortunately needed to use some requests heavy APIs, such as manually looping over forks to get their statistics.

It would be useful in this particular case to be able to list:

  • job duration,
  • artifacts and containers storage
  • network usage

for one repository and all of its direct forks, for a specific period of time.

This would make it possible to get a rough idea of mesa's footprint in gitlab (725 forks, thousands of CI pipelines).

Current APIs

  1. https://docs.gitlab.com/ee/api/graphql/reference/#cijob
  2. https://docs.gitlab.com/ee/api/graphql/reference/#cijobartifact
  3. https://docs.gitlab.com/ee/api/graphql/reference/#rootstoragestatistics
  4. https://docs.gitlab.com/ee/api/graphql/reference/#projectstatistics

CC @pwithnall

Edited by Donique Smit