Loading
Simplify non-billable usage labels on the credits chart
What does this MR do and why?
Follow-up to !260225 (merged). That MR added non-billable GitLab Credits usage to the daily credits chart on the GitLab Credits dashboard, as one stacked series per skip reason next to "Billed usage". This MR addresses review feedback deferred from it. It is a frontend change. The backend specs only had sample data renamed.
Changes:
- Usage with no skip reason now shows under "Non-billable usage (Other)" instead of a separate "Non-billable usage (No reason provided)" series. A null reason covers almost all non-billable usage recorded before CustomersDot started setting reasons. Many customers would see it on older date ranges, and it read like something went wrong.
- Promotional usage is now keyed on the
promoskip reason (wasorbit_promo) and labelled "Non-billable usage (Promotional)" (was "Orbit promotional"). The label is no longer tied to one product. Backend spec sample data is updated topromoto match. - The
internalskip reason, its "Non-billable usage (Internal)" label and its green color are removed. CustomersDot no longer records internal team member usage as non-billable (discussion). Anyinternalusage that's left now shows under "Non-billable usage (Other)" - The chart header "Total: X credits" is now "Billed: X credits". It only counts billed usage and sits next to "Non-billable: X credits".
- The summary cards (total usage, daily average and peak day) now count non-billable usage as well as billed usage, since they give a high-level summary. The chart header and the products list still count billed usage only.
- While the non-billable query refetches after a date-range or product change, the chart no longer shows the previous range's non-billable rows and total. This uses
notifyOnNetworkStatusChange, so theno-cachequery reports loading when variables change. - An entry with no daily usage no longer adds an empty series and legend item.
- Spec cleanups from review: the single-reason color check moved to its own describe, and a duplicate color assertion was trimmed.
References
- Closes https://gitlab.com/gitlab-org/gitlab/-/work_items/632862
- Previous MR: !260225 (merged)
- Label discussion: !260225 (comment 3975025426) and !260225 (comment 3977054295)
Screenshots or screen recordings
| Scenario | Screenshot |
|---|---|
|
skipReason coming as being shown as Any other product with skipReason as promo will be labelled the same way. |
|
|
Empty / null / unknown skipReasons are now clubbed under |
How to set up and validate locally
- Run GDK in SaaS mode (
export GITLAB_SIMULATE_SAAS=1inenv.runit) with a local CustomersDot (export CUSTOMER_PORTAL_URL=http://localhost:5000), then restart Rails. - In CustomersDot, add non-billable usage rows (SkipConsumption = true) to the
usage_billing_enrichedClickHouse table for your group's subscription. Useskip_reasonvaluesbeta,promo, an unknown value, and noskip_reasonat all. - Visit
http://127.0.0.1:3000/groups/<group>/-/settings/gitlab_credits_dashboardand pick a date range that includes those rows. - Check that:
- Rows with no reason and the unknown reason both appear as "Non-billable usage (Other)".
- There is no "No reason provided" series.
promorows appear as "Non-billable usage (Promotional)". Orbit rows only show when theorbit_product_listflag is on in CustomersDot.- The header reads "Billed: X credits".
- Change the date range and check that the non-billable bars and total don't show the previous range's values while loading.
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 Harsh Vardhan Sharma

