Skip to content

Add shared runner duration to table

Payton Burdette requested to merge 355666-add-shared-runner-usage-to-table into master

What does this MR do and why?

Adds the shared runner duration to the project table for group/personal namespaces.

Related to: #355666 (closed)

Screenshots or screen recordings

before after
Screen_Shot_2022-05-18_at_3.31.07_PM Screen_Shot_2022-05-18_at_3.21.18_PM

How to set up and validate locally

Seed data

ApplicationSetting.current.update(shared_runners_minutes: 400)
project = Project.find(20)
root_namespace = project.root_namespace

namespace_usage = Ci::Minutes::NamespaceMonthlyUsage.find_or_create_current(namespace_id: root_namespace)
Ci::Minutes::NamespaceMonthlyUsage.update_counters(namespace_usage, amount_used: 100, shared_runners_duration: 100)

project_usage = Ci::Minutes::ProjectMonthlyUsage.find_or_create_current(project_id: project)
Ci::Minutes::ProjectMonthlyUsage.update_counters(project_usage, amount_used: 100, shared_runners_duration: 100)

View changes

  1. Visit Group > Settings > Usage Quotas
  2. View the project table at the bottom of the view

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Payton Burdette

Merge request reports