Troubleshoot Job: scope license feature check to Project
What does this MR do and why?
These code changes are related to a feature called "troubleshoot job with AI" or "Root cause Analysis".
The feature is now enabled only for projects/groups that have an (ultimate)license for it.
Previously, the feature was only enabled if the user had a global ultimate license for the instance.
Steps to reproduce
This was primarily reproduced on staging.gitlab.com. See the chart: https://gitlab.com/gitlab-org/fulfillment/meta/-/work_items/1944#saas
- Setup an admin with an ultimate license https://docs.gitlab.com/ee/administration/license_file.html
- Setup a group with a premium license.
- (It's tricky on gdk, but common in saas, We can take a look at a user that is not
using_license_seat?
and to create a free group. Then checkproject.licensed_feature_available?(:troubleshoot_job)
versus::License.feature_available?(:troubleshoot_job)
on the free group project.
- Navigate to the billing page to see that the group has a premium license even though the instance has a ultimate license: http:///groups/group-without-ultimate-features/-/billings
- Create a project in the group
- The group/project can use RCA to troubleshoot a job (@mfanGitLab, verified this in staging)
- Find the project you created and execute
project.licensed_feature_available?(:troubleshoot_job)
it should returnfalse
. Then execute::License.feature_available?(:troubleshoot_job)
it should returntrue
Edited by Allison Browne