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

Screenshots or screen recordings

N/A (backend changes only)

How to set up and validate locally

  1. Check out this branch locally to your GDK
  2. Open a Rails console session
  3. Confirm that you can create the AddOn record successfully for secrets_manager using the following command
GitlabSubscriptions::AddOn.find_or_create_by_name('secrets_manager')
  1. Once created, confirm that the secrets_manager add-on record is not returned in the list of Duo add-ons, ex:
GitlabSubscriptions::AddOn.duo_add_ons
  1. Confirm that secrets_manager is not included in the list of seat_assignable_duo_add_ons
GitlabSubscriptions::AddOn.seat_assignable_duo_add_ons

MR 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

Edited by Valerie Burton

Merge request reports

Loading
Loading