Resolve "FF Rollout - ci_catalog_popularity"
What does this MR do and why?
Remove FF ci_catalog_popularity
feature flag and make popularity the default sort.
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 |
---|---|
![]() |
![]() |
Screen_Recording_2024-06-18_at_3.23.16_PM
How to set up and validate locally
- Create 3 catalog resources:
bundle exec rake "gitlab:seed:ci_catalog_resources[<YOUR-GROUP-PATH>, 3, true]"
- Create a version for each catalog resource:
project_ids = Project.last(3).pluck(:id) # These should be the project IDs from the first step
user = User.first # This should be your root user
Project.where(id: project_ids).each do |project|
Releases::CreateService.new(project, user, tag: '1.0.0', ref: 'main', legacy_catalog_publish: true).execute
end
- For each catalog resource, create usages within the last 30 days:
expected_ordered_usage_counts = [12, 1, 7]
resources = Ci::Catalog::Resource.where(project_id: project_ids).order(:id)
resources.each_with_index do |resource, i|
usage_count = expected_ordered_usage_counts[i]
component = resource.components.first
(1..usage_count).each do |k|
Ci::Catalog::Resources::Components::Usage.create!(component: component, catalog_resource: component.catalog_resource, project: component.project, used_by_project_id: k, used_date: Date.today - k.days)
end
end
- Go to Explore > CI/CD Catalog
- Notice that each resource you created show usage count on the catalog list items.
Related to #464593
Edited by Frédéric Caplette