Fix "Buy more minutes" link destination
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
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
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done