Skip to content

Fix shared runners duration on project list

Sheldon Led requested to merge led/370020-fix-shared-runner-project-list into master

What does this MR do and why?

After validating #370020 (closed) it was noticed a discrepancy in the shared runners numbers. Details:

This MR fixes this issue and finishes the implementation of #370020 (closed)

Screenshots or screen recordings

Before After
shared_runner_before shared_runner_after

How to set up and validate locally

  1. Make sure to enable: ::Gitlab::CurrentSettings.update(check_namespace_plan: true)
  2. Make sure you're simulating SaaS
  3. Enable the FF: Feature.enable(:usage_quotas_pipelines_vue)
  4. Add some data:
    project = Project.find(108)
    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, shared_runners_duration: 100)
    
    project_usage = Ci::Minutes::ProjectMonthlyUsage.find_or_create_current(project_id: project)
    Ci::Minutes::ProjectMonthlyUsage.update_counters(project_usage, shared_runners_duration: 100)
  5. Go to your group's usage quotas page
  6. Check the project list, note the shared runners number
  7. Turn off FF: Feature.disable(:usage_quotas_pipelines_vue)
  8. Compare the shared runners number

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 Sheldon Led

Merge request reports

Loading