Add Secrets Manager to AddOn Model
What does this MR do and why?
This MR adds the secrets_manager add-on to the GitlabSubscriptions::AddOn model along with a .for_secrets_manager scope on GitlabSubscriptions::AddOnPurchase, in order to prepare for the upcoming changes being introduced as part of https://gitlab.com/groups/gitlab-org/-/work_items/21729+
Additional scopes and provisioning logic will be added in subsequent issues as part of the above mentioned epic.
GitlabSubscriptions::AddOnPurchase.for_secrets_manager Scope Query
The for_secrets_manager scope follows the same identical pattern as existing for_* add-on scopes (e.g., for_gitlab_credits). No secrets_manager AddOnPurchase records exist in production yet, so a query plan would not provide meaningful data. The raw SQL is provided here for reference per the database review guidelines
SELECT "subscription_add_on_purchases".* FROM "subscription_add_on_purchases" WHERE "subscription_add_on_purchases"."subscription_add_on_id" IN (SELECT "subscription_add_ons"."id" FROM "subscription_add_ons" WHERE "subscription_add_ons"."name" = 8) /* loading for pp */ LIMIT 11 References
- https://gitlab.com/gitlab-org/gitlab/-/work_items/597392+
- https://gitlab.com/groups/gitlab-org/-/work_items/21729+
Screenshots or screen recordings
N/A (backend changes only)
How to set up and validate locally
- Check out this branch locally to your GDK
- Open a Rails console session
- Confirm that you can create the
AddOnrecord successfully forsecrets_managerusing the following command
GitlabSubscriptions::AddOn.find_or_create_by_name('secrets_manager')- Once created, confirm that the
secrets_manageradd-on record is not returned in the list of Duo add-ons, ex:
GitlabSubscriptions::AddOn.duo_add_ons- Confirm that
secrets_manageris not included in the list ofseat_assignable_duo_add_ons
GitlabSubscriptions::AddOn.seat_assignable_duo_add_onsMR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #597392