Display shared runner cost factor(s) and remaining shared runner duration in repo's CI -> Pipelines page

As part of #337245 (closed) the shared runner CI cost factor has been changed for public projects. Previously users could run almost unlimited CI pipelines, but now they are understandably subject to limits. The Usage quotas page gives a decent summary of usage per month for both groups and user accounts, however, this information is post-consumption, and it only reports the overall CI minute consumption and shared runner runtime. The cost factor cannot be directly understood from this page, because each repository may be consuming minutes with a different cost factor depending on its precise circumstance.

https://docs.gitlab.com/ee/ci/pipelines/cicd_minutes.html#cost-factor

To quote the important paragraph in that link

  • 1 for internal and private projects.
  • 0.5 for public projects in the GitLab for Open Source program.
  • 0.008 for public forks of public projects in the GitLab for Open Source program. For every 125 minutes of job execution time, you use 1 CI/CD minute.
  • 1 for other public projects, after October 1, 2022 (previously 0.04). For every 1 minute of job execution time, you use 1 CI/CD minute.
  • Calculated differently for community contributions to GitLab projects.

The problem I see is that most contributors using gitlab.com aren't even aware of the concept of CI cost factors, and even fewer have likely found the above document explaining what the cost factors are currently set to. This makes it challenging for them to anticipate how expensive pipelines will be for each of them projects.

The influence of the GitLab Open Source program makes this even more important. It is hard for users to see if the project they have forked is part of the OSS Program. By implication it is thus hard for users to know if the CI pipeline will use of a cost fact or 1 or 0.008, which is a massively important difference. Users also do not have any visibility into whether the upstream project's membership of the GitLab Open Source Program has expired since they last contributed, thus returning their fork to a cost factor of 1.

With the /qemu-project/qemu repository, we've also already hit the problem where one contributor did not realize that their repository was NOT a fork of the upstream repository, because its creation pre-dated the original upstream. Thus they were charged at the cost factor == 1, instead of the 0.008 cost factor they expected. As a result their consumed their entire monthly CI quota in 1 day. This illustrates the importance of exposing cost factor information to users.

I would like to recommend that the CI/CD -> Pipelines page should expose this information directly. I am NOT suggesting the Settings -> CI page, as I feel it is important to expose information about CI cost every time you look at the repository's pipelines page, so users get a reinforced view about the current cost factor that applies.

My suggestion is that the Pipelines page should display the current project's cost factor, along with a contextual reason for why this cost factor appliess. eg display something like one of these sentences:

  • "Cost factor: 0.008 - this repository is a fork of which is covered by the GitLab Open Source Program"
  • "Cost factor: 0.5 - this repository's namespace is covered by the GitLab Open Source Program"
  • "Cost factor: 1 - This repository is a public project"
  • "Cost factor: 1 - This repository is a private project"
  • "Cost factor: ... - This repository is a fork of a GitLab community project"

I would further like to request that following this statement, it then explains directly how much shared runner time is available, given the user/groups' current remaining quota. ie, follow the above sentence with something like:

  • "The namespace containing this repository has 11,290 CI minutes remaining this month, allowing up to 22,580 minutes of execution time on shared runner at this cost factor".
Edited by 🤖 GitLab Bot 🤖