Skip to content

Update Duo Pro Card to to show Add seats button for SM

Minahil Nichols requested to merge 441697-update-duo-pro-sm into master

What does this MR do and why?

Solves https://gitlab.com/gitlab-org/gitlab/-/issues/441697

Currently any customers with SM subscriptions cannot see the "Add seats" button to purchase more Duo Pro seats. This is a solution for this iteration, we have a follow-up issue https://gitlab.com/gitlab-org/gitlab/-/issues/442909 which will take care of hiding this button for ineligible users. The checks needed here are already present on CDot so the customer will not be able to purchase seats which is sufficient for this iteration.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
image image

How to set up and validate locally

General setup

Enable the following feature flags in the Rails console (bundle exec rails c):

Feature.enable(:code_suggestions)
Feature.enable(:code_suggestions_tokens_api)
Feature.enable(:purchase_code_suggestions)
Feature.enable(:self_managed_code_suggestions)
Feature.enable(:hamilton_seat_management)

Apply the patch - we need to emulate SM with purchased code suggestions addon

8286.patch
diff --git a/ee/app/controllers/admin/code_suggestions_controller.rb b/ee/app/controllers/admin/code_suggestions_controller.rb
index a801673cf5eb..dcb9f759da18 100644
--- a/ee/app/controllers/admin/code_suggestions_controller.rb
+++ b/ee/app/controllers/admin/code_suggestions_controller.rb
@@ -19,7 +19,8 @@ def index
     private

     def ensure_feature_available!
-      render_404 unless gitlab_sm? && License.current&.paid? && code_suggestions_available?
+      true
+      # render_404 unless gitlab_sm? && License.current&.paid? && code_suggestions_available?
     end
   end
 end
  1. Login as root
  2. Create or locate a SM group with Duo Pro seats
  3. Visit http://localhost:3000/admin/code_suggestions.
  4. You should see the Duo Pro tab and "Add seats" button appear.

Related to #441697

Merge request reports