Skip to content

Part 2 in duo enterprise trial phase 1 implementation

Doug Stull requested to merge 468050-part-2 into master

What does this MR do and why?

Part 2 in duo enterprise trial phase 1 implementation

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

Screen Before After
form Screenshot_2024-07-31_at_9.52.08_AM Screenshot_2024-07-31_at_4.31.31_PM
submission Screenshot_2024-07-31_at_4.30.25_PM Screenshot_2024-07-31_at_4.26.54_PM

How to set up and validate locally

  1. Setup GDK to simulate SaaS.
  2. Enable duo_enterprise_trials feature flag in bin/rails console with Feature.enable(:duo_enterprise_trials).
  3. Seed the add-ons for your instance from the terminal if they haven't been created yet(rerun will not harm anything if you do have them)
    • FILTER=add_ons bundle exec rake db:seed_fu
  4. Create new group.
  5. In rails console make it ultimate.
bin/rails c

Group.last.gitlab_subscription.update(hosted_plan: Plan.find_by(name: 'ultimate'))
  1. Visit /-/trials/duo_enterprise/new?namespace_id=<group id created>.
  2. Make the below diff changes to get successful submission
diff
diff --git a/ee/app/controllers/gitlab_subscriptions/trials/duo_enterprise_controller.rb b/ee/app/controllers/gitlab_subscriptions/trials/duo_enterprise_controller.rb
index 018ed197b8bb..dbe7ac359d4b 100644
--- a/ee/app/controllers/gitlab_subscriptions/trials/duo_enterprise_controller.rb
+++ b/ee/app/controllers/gitlab_subscriptions/trials/duo_enterprise_controller.rb
@@ -32,11 +32,11 @@ def create
           step: general_params[:step], lead_params: lead_params, trial_params: trial_params, user: current_user
         ).execute

-        if @result.success?
+        if true
           # lead and trial created
           flash[:success] = success_flash_message

-          redirect_to group_settings_gitlab_duo_usage_index_path(@result.payload[:namespace])
+          redirect_to group_settings_gitlab_duo_usage_index_path(namespace)
         elsif @result.reason == GitlabSubscriptions::Trials::CreateDuoEnterpriseService::NOT_FOUND
           # namespace not found/not permitted to create
           render_404
  1. Submit the form.
  2. Verify location and flash message.

Related to #468050

Edited by Doug Stull

Merge request reports

Loading