We are going to start calculating shared CI runner build minutes used per user/group; now we need to report build minute usage to users. Perhaps this should be an EE-only feature, but the current MR is in CE.
Proposal
Maybe add a new page into group settings?
Report shared runner build minutes used this month
[Stretch] Show history of build minutes used each month
[Stretch] Show max build minutes used in last X months
[Stretch] Show build minute limit and indication of whether you are under/over
[Stretch] Project estimated build minutes for the rest of the month
[Stretch] Or show current build minute usage relative to prorated monthly limit
[Stretch] Show when user/group is over limit
[Stretch] Know if user/group has purchased Bronze package, show information about it
Design
Pipeline list label:
Pipeline list label tooltip:
Group settings pipeline quote dropdown: (wording should be: Build minute quota)
Group settings pipeline quota screen:
When editing a group as admin at /admin/groups/groupname/edit: (With the help icon leading to an help page explaining build minutes.)
Warning on groups and projects that have CI and shared runners enabled visible to any member:
In that sense it would make sense to report these minutes either in the ci/cd project settings (only visible to masters) or as a separate tab under pipelines (visible to everyone)
However if we do want this per group/user, I suppose we could show this the same way with a pipelines tab on the group page https://gitlab.com/gitlab-org/gitlab-ce/issues/18054, however for now keep it as a tab on its own: "Pipeline Statistics".
We need a way of excempting certain groups (Limit them either yes or no)
Report minute usage on a group in a new view?
Shared runners need a way of saying if they count against the limit yes or no? ( @markpundsack can you elaborate when this is needed exactly..i had this in my notes)
Warning to group admins at 80% and 100% of limit by email and warning banner on related pages.
up sell bronze package?
Warning to all users on related project pages if they use CI and have shared runners enabled with warning banner.
If "Only allow merge requests to be merged if the build succeeds" is turned on and build limit is exceeded, they will/can never be merged.
What happens when a build is not run due to exceeding build minute limits:
Build fails/skips/pending
Build doesn't run again automatically when limit gets updated
The warnings at 80% and 100%, upsell to bronze, and other warnings can probably be considered stretch. The minimum is that pipelines get blocked after 100%, and they will show up as pending with something like an "quota exceed" label, and then after ~24hrs they will fail.
Great aspirational stuff in there. The group settings page can't show a graph though since that data is not available. Just a simple count and limit, if applicable. At most we might be able to show a sorted list of projects using up build minutes.
I'm not sure about the admin interface to setting quotas. @ayufan is that feasible? If so, I think we should have and show a global group limit, and then be able to override for each group or project, but on that override, we should probably show what the default is.
There's no point putting anything about bronze package in the admin side, if that's for GitLab.com and it's controlled by customers.gitlab.com.
Warning on groups and projects that have CI and shared runners enabled visible to any member: Your group has exceeded their build minutes quota. Pipelines will not run anymore.
Same warning for group admins (stretch): Your group has exceeded their build minutes quota. Pipelines will not run anymore. Upgrade to the bronze package.
80% warning for group admins (stretch): Your group has used 80% of their build minutes quota. Pipelines will stop running after your quota is exceeded. Upgrade to the bronze package.
I changed "Don't show again" to "Don't show again this month" because I imagine if someone hides this and then runs out in some future period, they'd want to be notified again... any thoughts on this?
Also I've added the following statuses to the admin group page:
I've also added the following setting to the "Edit Group" page:
should the "over limit" warning be displayed on pages other than the main project homepage? that is currently the only place the warning will get rendered.
@ayufan the "Edit Group" action does not currently do anything with the :shared_runners_minutes_limit value returned by the form... I'll need you to wire up the logic within the controller.
Also the Namespace helper methods will nee to be updated to account for the new setting which would override the global application setting.
Are we also going to let users and group owners put limits on individual projects, or is that something that we're waiting on for the next iteration of the feature?
@ayufan lastly, how can I get the shared_runners_minutes value for an individual project to implement the pipeline quote overview page? are these going to be tracked on a per-project basis or only on a namespace basis for now?