Add OneTrust installation script to non-product pages
What does this MR do and why?
As part of #341430, this MR adds the setup code for OneTrust, for the following pages:
- Login page (
app/views/devise/sessions/new.html.haml
) - Sign up page (
app/views/devise/registrations/new.html.haml
) - Trial registration page (
ee/app/views/trial_registrations/new.html.haml
)
OneTrust would only run if the one_trust_id
config value is provided, and there is no current_user
. This is also behind the long-lived ecomm_instrumentation
feature flag, which will be turned on for gitlab.com only. In the related issue, there are more details about the reasoning behind adding this script.
How to set up and validate locally
Validate OneTrust not running
- In rails console, make sure the feature flag is off
Feature.disable(:ecomm_instrumentation)
- Optionally add the
one_trust_id
config value to yourgitlab.yml
file## OneTrust one_trust_id: '_your_one_trust_id'
- Visit any of the listed pages above, such as
http://127.0.0.1:3000/users/sign_in
- Check that OneTrust is not installed/invoked. Running
OneTrust
in the Javascript console to get an undefined error or checking the network requests.
Validate OneTrust running properly
- In rails console, make sure the feature flag is enabled
Feature.enable(:ecomm_instrumentation)
- Add the
one_trust_id
config value to yourgitlab.yml
file## OneTrust one_trust_id: '7f944245-c5cd-4eed-a90e-dd955adfdd08-test'
- Visit any of the listed pages above, such as
http://127.0.0.1:3000/users/sign_in
- Check that OneTrust is installed and running. Running
OneTrust
in the Javascript console to get an object or checking the network requests.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Axel García