Fix broken trial CTAs on SM GitLab Credits dashboard
Summary
On Self-Managed EE instances with a trial license, the admin/gitlab_credits_dashboard page renders FreeTierTrialApp which mounts two cards whose CTAs (Purchase credits, Upgrade to Premium) injected paths that the admin haml never passed — both buttons rendered with empty/undefined href.
- Add
upgrade_button_pathandpurchase_credits_pathdata attributes toee/app/views/admin/gitlab_credits_dashboard/index.html.haml, wired to the promo url andsubscription_portal_self_managed_purchase_credits_url. - Rename the injection key from
gitlab_com_purchase_credits_path/gitlabComPurchaseCreditsPathtopurchase_credits_path/purchaseCreditsPathin theusage_quotas/usage_billingscope. The attribute now serves both SaaS (gitlab.com URL) and SM (self-managed URL); the old name was misleading. The unrelatedai/settings/usage is left untouched since it remains SaaS-only.
References
- Resolves https://gitlab.com/gitlab-org/gitlab/-/issues/600173
- Related UAT: https://gitlab.com/gitlab-org/gitlab/-/work_items/598134
| Screenrecording |
|---|
How to set up and validate locally
- Simulate EE trial by setting GITLAB_SIMULATE_SAAS: '0' and obtain a self-managed trial activation code (check how: https://gitlab.com/gitlab-org/gitlab/-/work_items/600173#steps-to-reproduce)
- Add the activation code and go to /admin/gitlab_credits_dashboard
Edited by Roy Liu