Skip to content

Add popularity stats and sorting in ci catalog list page

What does this MR do and why?

Adds the usage statistics to the catalog list view (how many times a resource is being used) and we use a new graphql field called last30DayUsageCount. This field currently always return 0 and we need #452545 (closed) to be completed before this can work fully. This is why this will ship behind a FF called ci_catalog_popularity which we will remove in #464593

Additionally, we add a new sort option to sort by popularity.

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

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2024-05-30_at_11.26.28_AM Screenshot_2024-05-30_at_1.36.26_PM

Mobile:

Before After
Screenshot_2024-05-30_at_3.17.45_PM Screenshot_2024-05-30_at_1.33.00_PM

Screen_Recording_2024-05-30_at_2.19.20_PM

How to set up and validate locally

  1. Set up the project to be a valid catalog resource: https://docs.gitlab.com/ee/ci/components/#create-a-component-project
  2. Create a release for the resource
  3. Go to the explore -> CI/CD Catalog page
  4. Make sure the new sort option is missing
  5. Make sure that the layout is not showing the stats icon
  6. Turn on the FF ci_catalog_popularity
  7. Notice that the stat for usage (or popularity) is shown. This will always be 0 for now.
  8. change the sorting option to popularity. This will have no effect since all ressources have 0, but it emits the correct enum value: USAGE_COUNT_ASC and USAGE_COUNT_DESC according to whether its sorting ascending or descending.

Related to #434333

Edited by Frédéric Caplette

Merge request reports