Skip to content

Fix "Buy more minutes" link destination

Vijay Hawoldar requested to merge vij-fix-minutes-cta-namespace into master

What does this MR do?

In the user dropdown menu, there is a link to buy more pipeline minutes when the namespace is running out (an experiment, currently).

Originally this would always redirect the user to their own personal usage quotas page, /-/profile/usage_quotas, but that's not always the correct destination, as group namespaces also have a usage quotas page.

As such, this was reported as a bug for gitlab-org in #296111 (closed).

This MR addresses the problem by establishing what the root namespace is, e.g. a User for a personal project or a Group for a group project and use that to determine which path to redirect to.

Testing

You can test this out locally quite simply by:

  • Comment out the guard clause at the top of the partial, here
  • View a group project and check the path used in the "Buy more pipeline minutes" link (screenshot below)
  • View a user project and check the path

Screenshot_2021-02-12_at_16.31.39

Please note, testing in this manner will show you the link for projects that you'd otherwise not see it for (i.e. projects you have the ability to view usage quotas for), and is not a bug.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Vijay Hawoldar

Merge request reports

Loading