Enable Vue 3 migration rollout for admin usage trends
What does this MR do and why?
Enables the Vue 3 migration rollout for the admin Usage Trends page (app/assets/javascripts/pages/admin/usage_trends).
This uses the vue3_migration.yml mechanism to opt the page into Vue 3 behind a feature flag. When vue3_migrate_usage_trends is enabled, Rails serves the Vue 3 (@vue/compat) chunk; otherwise the page continues to run on Vue 2.
What changed
- Added
config/feature_flags/beta/vue3_migrate_usage_trends.yml - Added
app/assets/javascripts/pages/admin/usage_trends/vue3_migration.ymlwithstatus: rollout
No JavaScript or controller changes are needed.
How to verify
- Enable the feature flag:
Feature.enable(:vue3_migrate_usage_trends) - Navigate to the admin Usage Trends page (Admin > Analytics > Usage trends,
/admin/usage_trends) - Open the browser console and confirm the message:
[gitlab] [V] Using Vue.js 3 - Verify the total counts tiles render, the projects and groups chart renders, and the pipelines and issues/merge requests charts render
Existing test coverage for the usage trends page
For visibility while this rollout is in flight: what is and is not covered for this page today, independent of the Vue 3 mechanism.
Frontend unit tests (Jest), spec/frontend/analytics/usage_trends/
components/app_spec.jscovers the main app: rendering the usage counts component, the users chart, and aUsageTrendsCountChartfor each of "Total projects & groups", "Pipelines", and "Issues & merge requests".components/usage_counts_spec.jscovers the counts tiles: the skeleton loader while loading, and rendering aGlSingleStatper measurement (Projects, Groups) from the GraphQL response.components/usage_trends_count_chart_spec.jscovers the paginated line charts: issuing oneusageTrendsMeasurementsquery per identifier, the skeleton loader, error alerts when all queries or a single query fail (both on the first page and while fetching more pages), the "no data" info alert, passing fetched data to the line chart (snapshot), and fetching additional pages untilhasNextPageis false.components/users_chart_spec.jscovers the total users area chart: loading state, the "no data" alert, the error alert, requesting data (includingfetchMorepagination), and passing the monthly averaged user counts to the chart.utils_spec.jscoversgetAverageByMonth(grouping daily counts into monthly averages, optional rounding, edge cases),getEarliestDate, andgenerateDataKeys.
This suite is not in scripts/frontend/quarantined_vue3_specs.txt, so it runs and must pass in both the jest (Vue 2) and jest vue3 (@vue/compat) CI jobs.
Backend
spec/controllers/admin/usage_trends_controller_spec.rbcovers the page controller (Admin::UsageTrendsController#index): unique visit tracking and Snowplow event tracking with RedisHLL context.spec/requests/api/graphql/usage_trends_measurements_spec.rbcovers theusageTrendsMeasurementsGraphQL query the tiles and charts are built from: returning measurements latest first and filtering byrecordedAfter/recordedBefore.spec/graphql/resolvers/admin/analytics/usage_trends/measurements_resolver_spec.rbcovers the resolver: admin-only authorization (non-admin and unauthenticated users getResourceNotAvailable), date range filtering, and per-identifier filtering (for example, pipeline counts by pipeline status).
Not covered
- No feature/system spec visits this page (nothing under
spec/features/references usage trends or the legacy "instance statistics" naming). - No QA/E2E spec covers this page.
References
- Resolves #607831 (closed)
- Rollout issue: #608144
- Parent epic: gitlab-org#23041