PipelinesUsageApp: add project list and their CI usage
What does this MR do and why?
Relates to: https://gitlab.com/gitlab-org/gitlab/-/issues/345373
As part of the bigger effort to have a common layout for Usage Quotas we need to migrate the pipelines tab to vue. This MR is the next in line after !83021 (merged)
For this MR we add the project list to the PipelinesUsageApp:
- Add GraphQL queries (
getNamespaceProjectsInfoto fetch projects details, andgetCiMinutesUsageNamespaceto get ci minute usage per project and later will be used to populate the graph above) - Add loading and error states
Screenshots or screen recordings
Namespace with projects
| Before | After |
|---|---|
![]() |
![]() |
To add some data:
Ci::Minutes::ProjectMonthlyUsage.where(project_id: <project id here>, date: Date.new(2022, 04, 01), amount_used: 100).save- The date here needs to be the first day of the current month in order to appear in the project list
Namespace without projects
Here there was a bug where the wrong message was shown, we're fixing this in this MR too
| Before | After |
|---|---|
![]() |
![]() |
Namespace with projects with shared runner disabled
- For all projects of the namespace:
Project.find(<project id here>).update(shared_runners_enabled: false)- We need this call to return false:
Project.with_shared_runners.in_namespace(Group.find(<group id here>)).any?
- We need this call to return false:
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
- Apply this patch to inject
PipelinesUsageAppin the Usage Quotas page: pipelines-vue-patch.patch- Download the file then
git apply ~/path/to/file/pipelines-vue-patch.patch
- Download the file then
- Navigate to the Usage Quotas page, e.g.: http://gdk.test:3000/groups/flightjs/-/usage_quotas#pipelines-quota-tab
- Check that the project list is loading fine
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Sheldon Led





