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_path and purchase_credits_path data attributes to ee/app/views/admin/gitlab_credits_dashboard/index.html.haml, wired to the promo url and subscription_portal_self_managed_purchase_credits_url.
  • Rename the injection key from gitlab_com_purchase_credits_path / gitlabComPurchaseCreditsPath to purchase_credits_path / purchaseCreditsPath in the usage_quotas/usage_billing scope. The attribute now serves both SaaS (gitlab.com URL) and SM (self-managed URL); the old name was misleading. The unrelated ai/settings/ usage is left untouched since it remains SaaS-only.

References

Screenrecording

How to set up and validate locally

  1. 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)
  2. Add the activation code and go to /admin/gitlab_credits_dashboard
Edited by Roy Liu

Merge request reports

Loading