Show non-billable usage on the personal credits dashboard

What does this MR do and why?

The personal GitLab Credits dashboard (User settings > GitLab Credits, GitLab.com only) showed billable usage only, so a user's Orbit promotional usage was invisible there, while the group dashboard's Total usage card already counts it.

This MR makes the personal dashboard match the group dashboard:

  • Credits used in this billing period, Total usage, Daily average usage and Peak day usage count billable plus non-billable usage.
  • The chart keeps its "Billable: X credits / Non-billable: Y credits" header and stacks one series per skip reason next to Billable usage, through the shared CreditsConsumptionChart.
  • Non-billable usage comes from the nonBillableUsage field added in !265505 (merged), read in its own query (get_user_non_billable_usage.query.graphql) so a failure there never blanks the billed dashboard: the cards fall back to billable usage only. The query runs twice: once with only the namespace path for the billing-period card, and once with the date range and product filters for the range-scoped cards and chart. Both use fetchPolicy: 'no-cache' because they read the same un-normalized creditsUsage field as the billable queries.
  • Non-billable usage of products this instance doesn't display is left out, as on the group dashboard. The billing-period card uses a product catalog from the dashboard-level query, so it doesn't depend on the filter-scoped query having resolved.
  • The field is selected with @gl_introduced(version: "19.6.0"), so the frontend keeps working while the backend MR is not deployed yet: the field is nulled and the cards show billable usage only.
  • Jest specs and a WithoutNonBillableUsage story.

This is change C of the plan in #633154 (comment 4099142904). B (!265505 (merged)) is merged; this MR targets master and merges only after B has fully rolled out on GitLab.com.

References

Screenshots or screen recordings

Before After
Screenshot_2026-10-28_at_09.48.17 Screenshot_2026-10-28_at_09.41.17

How to set up and validate locally

  1. Check out this branch (!265505 (merged) is merged in master).

  2. Set up GDK in SaaS mode with a local CustomersDot, as in "How to set up and validate locally" in !260725 (merged).

  3. In CustomersDot, seed billable and non-billable usage for your user and run enrichment, for example:

    bin/populate_usage_data -r 20 --realm SaaS --root-namespace-id <id> --user-id <user_id> --feature-qualified-name orbit_mcp --team-member --skip-reason promo
    bin/populate_usage_data -r 20 --realm SaaS --root-namespace-id <id> --user-id <user_id> --feature-qualified-name orbit_rest
  4. Visit /-/profile/gitlab_credits_dashboard.

  5. The Credits used in this billing period and Total usage cards show billable + non-billable credits; the chart header splits them and the chart stacks a Promotional series on top of Billable usage.

  6. Apply a Products filter: the non-billable usage follows the filter.

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.

Edited by Sheldon Led

Merge request reports

Loading
Loading