Add analytics tab for CI/CD catalog
What does this MR do and why?
This merge request adds a new "Analytics" tab to the CI/CD Catalog that shows usage statistics for catalog components. The analytics view displays a table showing project names, usage counts (how many projects used each component in the last 30 days), and available components. This feature is controlled by a feature flag and only shows up for users with maintainer access to catalog projects.
The changes also fix some code style issues related to event naming conventions and update the underlying data queries to support filtering by access level.
References
Screenshots or screen recordings
| Details | Screenshot |
|---|---|
| Feature flag is turened off (no visible changes) |
|
| Feature flag is turened on |
|
| Analytics view for a maintainer |
|
| Analytics view for a developer |
|
How to set up and validate locally
Setup
-
Enable the feature flag in your local environment:
Feature.enable(:show_ci_cd_catalog_analytics, User.find(user_id)) -
Ensure you have maintainer access to at least one CI/CD catalog project to view the analytics tab.
Verification Steps
-
Verify the Analytics tab appears:
- Navigate to the CI/CD Catalog page (
/explore/catalog) - With the feature flag enabled, you should see three tabs: "All", "Your groups", and "Analytics"
- The Analytics tab should only be visible to users with maintainer access to catalog projects
- Navigate to the CI/CD Catalog page (
-
Verify the Analytics tab is hidden for non-maintainers:
- Log in as a user without maintainer access to any catalog project
- The Analytics tab should not appear
- An empty state message should display: "You need maintainer access to at least one CI/CD catalog project to view usage analytics."
-
Verify the Analytics table displays correctly:
- Click on the "Analytics" tab as a maintainer
- A table should display with the following columns:
- Projects: Shows the catalog project name with a badge displaying the latest version
- Usage statistics: Shows the number of unique projects that used components from this catalog in the last 30 days
- Components: Lists the available components from the latest version
- Verify the usage count is accurate (should reflect projects using components in the last 30 days)
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #583419 (closed)



