Skip to content

Skip email verification on sign in for QA users

Alex Buijs requested to merge skip-email-verification-for-qa into master

What does this MR do and why?

Skip email verification on Sign In for QA users on staging environment.

When the feature flag is turned on on staging, tests will fail, see slack discussion.

This allows skipping email verification when ENV['GITLAB_QA_USER_AGENT'] is present and the current request's user agent matches it's value.

How to set up and validate locally

Verify required email verification is working:

  1. In Rails console, run: Feature.enable(:require_email_verification)
  2. Visit http://localhost:3000/users/sign_in and try to sign in 3 times with a wrong password
  3. Sign in with your correct password and verify you need to verify your identity by email

Verify required email verification is skipped when acting as a QA user:

  1. Note your browser user agent by typing navigator.userAgent in the inspector
  2. Simulate GL.com and set the QA header to the browser user agent by running these commands in the console from the gdk root:
    gdk stop
    echo export GITLAB_SIMULATE_SAAS=1 >> env.runit
    echo export GITLAB_QA_USER_AGENT="<your browser's user agent>" >> env.runit
    gdk restart
  3. Visit http://localhost:3000/users/sign_in and try to sign in 3 times with a wrong password
  4. Sign in with your correct password and verify you don't need to verify your identity by email

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 Alex Buijs

Merge request reports