Add runner filter for dedicated hosted runner usage

What does this MR do and why?

This merge request adds a new feature to filter CI/CD runner usage data by a specific runner ID for GitLab Dedicated. It modifies the GraphQL API to include a new optional 'runner_id' argument in the query for dedicated hosted runner usage.

The backend logic is updated to support this new filter, allowing users to retrieve usage data for a particular runner across different grouping options (instance aggregate or per root namespace). The changes also include updates to the documentation and the addition of a new test case to verify the functionality of the runner ID filter.

Overall, this enhancement provides more granular control over CI/CD usage data retrieval for GitLab Dedicated.

Resolves the runner_id filter requirement in https://gitlab.com/gitlab-com/gl-infra/gitlab-dedicated/team/-/issues/6707

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshot_2025-02-19_at_12.34.57_PM

How to set up and validate locally

  1. Follow the steps in !179854 (merged) to setup initial requirements.
  2. Use the below query with addition of runnerId arg to the query -
query {
  ciDedicatedHostedRunnerUsage(grouping: INSTANCE_AGGREGATE,
    runnerId: "gid://gitlab/Ci::Runner/61" # Change to your runner ID) {
    nodes {
      billingMonth
      billingMonthIso8601
      computeMinutes
      durationSeconds
      rootNamespace {
        id
        name
      }
    }
  }
}
Edited by Rajendra Kadam

Merge request reports

Loading