Skip to content

Adds the concept of passing through params for registration flow

What does this MR do and why?

It enables passing params through the registration flow. This is part of #355661 (closed)

Screenshots or screen recordings

Screen_Recording_2022-04-25_at_1.05.03_PM

How to set up and validate locally

  1. Setup prerequisites:
    1. Ensure GITLAB_SIMULATE_SAAS=true is in your environment and that you've restarted your services after setting it.
    2. Ensure that your license is up to date so that new users can be registered successfully (do we need steps documented for this?)
    3. Ensure the customers application is setup and working.
    4. Ensure admin approval for user registration is not required: (via the rails console)
      ApplicationSetting.first.update(require_admin_approval_after_user_signup: false)
    5. Ensure that email confirmations are not required: (via the rails console)
      ApplicationSetting.first.update(send_user_confirmation_email: false)
    6. Enable the following feature flags: (via the rails console)
      Feature.enable(:user_other_role_details)
      Feature.enable(:combined_registration)
      Feature.enable(:about_your_company_registration_flow)
    7. Ensure that any other feature flags that might impact the registration flows are disabled. (via the rails console)
  2. Replication steps:
    1. Register a new user by visiting: http://gdk.test:3000/users/sign_up
    2. You must answer the following questions in this way to see the whole registration flow:
      1. Welcome page:
        1. Who will be using GitLab? My company or team
        2. What would you like to do? Create a new project
      2. About your company page:
        1. GitLab Ultimate trial (optional) Toggled ON
    3. Upon completion of the registration steps, verify that the expected request(s) have gone to the customers application and that they contain the expected new params.

OR

You can utilize the feature specs that we've written for these flows:

WEBDRIVER_DELAY=0.1 WEBDRIVER_HEADLESS=false bundle exec rspec ee/spec/features/registrations/saas_user_registration_spec.rb --example "User registration using the standard flow for my company wanting to create a project"

Since things will happen quickly visually, it might be hard to capture all of it for review, so you can add the following to your spec/support/capybara.rb to slow things down, adjusting the WEBDRIVER_DELAY if it's still too fast.

# Allow for feature specs to be slowed down for UX review, and to
# avoid the really long and painful setup and replication steps.
require 'selenium/webdriver/remote'
class Selenium::WebDriver::Remote::Bridge
  if (delay = ENV['WEBDRIVER_DELAY'].to_s.to_f) > 0
    alias_method :execute_without_delay, :execute
    define_method(:execute) do |*args|
      sleep delay
      execute_without_delay(*args)
    end
  end
end

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Jeremy Jackson

Merge request reports