Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9fa99074
Commit
9fa99074
authored
Jun 10, 2021
by
Doug Stull
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove invite_signup_page_interaction experiment
- wasn't successful, so we'll remove it. Changelog: other
parent
5b72cb19
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
57 additions
and
270 deletions
+57
-270
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+0
-4
app/controllers/invites_controller.rb
app/controllers/invites_controller.rb
+2
-17
app/controllers/registrations/invites_controller.rb
app/controllers/registrations/invites_controller.rb
+0
-9
app/controllers/registrations_controller.rb
app/controllers/registrations_controller.rb
+0
-1
app/helpers/registrations_helper.rb
app/helpers/registrations_helper.rb
+0
-7
app/views/registrations/invites/new.html.haml
app/views/registrations/invites/new.html.haml
+0
-17
config/feature_flags/experiment/invite_signup_page_interaction.yml
...ature_flags/experiment/invite_signup_page_interaction.yml
+0
-8
config/routes.rb
config/routes.rb
+0
-1
ee/app/controllers/ee/application_controller.rb
ee/app/controllers/ee/application_controller.rb
+4
-0
ee/app/helpers/ee/trial_registration_helper.rb
ee/app/helpers/ee/trial_registration_helper.rb
+12
-0
ee/spec/helpers/ee/trial_registration_helper_spec.rb
ee/spec/helpers/ee/trial_registration_helper_spec.rb
+29
-0
locale/gitlab.pot
locale/gitlab.pot
+0
-6
spec/controllers/invites_controller_spec.rb
spec/controllers/invites_controller_spec.rb
+4
-31
spec/controllers/registrations_controller_spec.rb
spec/controllers/registrations_controller_spec.rb
+0
-32
spec/features/invites_spec.rb
spec/features/invites_spec.rb
+6
-45
spec/helpers/registrations_helper_spec.rb
spec/helpers/registrations_helper_spec.rb
+0
-24
spec/requests/invite_registration_spec.rb
spec/requests/invite_registration_spec.rb
+0
-68
No files found.
app/controllers/application_controller.rb
View file @
9fa99074
...
@@ -106,10 +106,6 @@ class ApplicationController < ActionController::Base
...
@@ -106,10 +106,6 @@ class ApplicationController < ActionController::Base
redirect_back
(
fallback_location:
default
,
**
options
)
redirect_back
(
fallback_location:
default
,
**
options
)
end
end
def
check_if_gl_com_or_dev
render_404
unless
::
Gitlab
.
dev_env_or_com?
end
def
not_found
def
not_found
render_404
render_404
end
end
...
...
app/controllers/invites_controller.rb
View file @
9fa99074
...
@@ -86,18 +86,7 @@ class InvitesController < ApplicationController
...
@@ -86,18 +86,7 @@ class InvitesController < ApplicationController
if
user_sign_up?
if
user_sign_up?
set_session_invite_params
set_session_invite_params
experiment
(
:invite_signup_page_interaction
,
actor:
member
)
do
|
experiment_instance
|
redirect_to
new_user_registration_path
(
invite_email:
member
.
invite_email
),
notice:
_
(
"To accept this invitation, create an account or sign in."
)
set_originating_member_id
if
experiment_instance
.
enabled?
experiment_instance
.
use
do
redirect_to
new_user_registration_path
(
invite_email:
member
.
invite_email
),
notice:
_
(
"To accept this invitation, create an account or sign in."
)
end
experiment_instance
.
try
do
redirect_to
new_users_sign_up_invite_path
(
invite_email:
member
.
invite_email
)
end
experiment_instance
.
track
(
:view
)
end
else
else
redirect_to
new_user_session_path
(
sign_in_redirect_params
),
notice:
sign_in_notice
redirect_to
new_user_session_path
(
sign_in_redirect_params
),
notice:
sign_in_notice
end
end
...
@@ -106,11 +95,7 @@ class InvitesController < ApplicationController
...
@@ -106,11 +95,7 @@ class InvitesController < ApplicationController
def
set_session_invite_params
def
set_session_invite_params
session
[
:invite_email
]
=
member
.
invite_email
session
[
:invite_email
]
=
member
.
invite_email
set_originating_member_id
if
Members
::
InviteEmailExperiment
.
initial_invite_email?
(
params
[
:invite_type
])
session
[
:originating_member_id
]
=
member
.
id
if
Members
::
InviteEmailExperiment
.
initial_invite_email?
(
params
[
:invite_type
])
end
def
set_originating_member_id
session
[
:originating_member_id
]
=
member
.
id
end
end
def
sign_in_redirect_params
def
sign_in_redirect_params
...
...
app/controllers/registrations/invites_controller.rb
deleted
100644 → 0
View file @
5b72cb19
# frozen_string_literal: true
module
Registrations
class
InvitesController
<
RegistrationsController
layout
'simple_registration'
before_action
:check_if_gl_com_or_dev
end
end
app/controllers/registrations_controller.rb
View file @
9fa99074
...
@@ -199,7 +199,6 @@ class RegistrationsController < Devise::RegistrationsController
...
@@ -199,7 +199,6 @@ class RegistrationsController < Devise::RegistrationsController
return
unless
member
return
unless
member
experiment
(
:invite_signup_page_interaction
,
actor:
member
).
track
(
:form_submission
)
experiment
(
'members/invite_email'
,
actor:
member
).
track
(
:accepted
)
experiment
(
'members/invite_email'
,
actor:
member
).
track
(
:accepted
)
end
end
...
...
app/helpers/registrations_helper.rb
View file @
9fa99074
# frozen_string_literal: true
# frozen_string_literal: true
module
RegistrationsHelper
module
RegistrationsHelper
def
social_signin_enabled?
::
Gitlab
.
dev_env_or_com?
&&
omniauth_enabled?
&&
devise_mapping
.
omniauthable?
&&
button_based_providers_enabled?
end
def
signup_username_data_attributes
def
signup_username_data_attributes
{
{
min_length:
User
::
MIN_USERNAME_LENGTH
,
min_length:
User
::
MIN_USERNAME_LENGTH
,
...
...
app/views/registrations/invites/new.html.haml
deleted
100644 → 0
View file @
5b72cb19
-
page_title
_
(
'Join your team'
)
-
add_page_specific_style
'page_bundles/signup'
-
content_for
:page_specific_javascripts
do
=
render
"layouts/google_tag_manager_head"
=
render
"layouts/google_tag_manager_body"
%h2
.center.pt-6.pb-3.gl-mb-0
=
_
(
'Join your team'
)
%p
.gl-text-center
=
_
(
'Create your own profile to collaborate with your teammates in issues, merge requests, and more.'
)
.signup-page
=
render
'devise/shared/signup_box'
,
url:
users_sign_up_invites_path
,
button_text:
_
(
'Continue'
),
show_omniauth_providers:
social_signin_enabled?
,
omniauth_providers_placement: :top
=
render
'devise/shared/sign_in_link'
config/feature_flags/experiment/invite_signup_page_interaction.yml
deleted
100644 → 0
View file @
5b72cb19
---
name
:
invite_signup_page_interaction
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60939
rollout_issue_url
:
https://gitlab.com/gitlab-org/growth/team-tasks/-/issues/379
milestone
:
'
13.12'
type
:
experiment
group
:
group::expansion
default_enabled
:
false
config/routes.rb
View file @
9fa99074
...
@@ -64,7 +64,6 @@ Rails.application.routes.draw do
...
@@ -64,7 +64,6 @@ Rails.application.routes.draw do
end
end
resource
:experience_level
,
only:
[
:show
,
:update
]
resource
:experience_level
,
only:
[
:show
,
:update
]
resources
:invites
,
only:
[
:new
,
:create
]
Gitlab
.
ee
do
Gitlab
.
ee
do
resources
:groups
,
only:
[
:new
,
:create
]
resources
:groups
,
only:
[
:new
,
:create
]
...
...
ee/app/controllers/ee/application_controller.rb
View file @
9fa99074
...
@@ -9,6 +9,10 @@ module EE
...
@@ -9,6 +9,10 @@ module EE
around_action
:set_current_ip_address
around_action
:set_current_ip_address
end
end
def
check_if_gl_com_or_dev
render_404
unless
::
Gitlab
.
dev_env_or_com?
end
def
verify_namespace_plan_check_enabled
def
verify_namespace_plan_check_enabled
render_404
unless
::
Gitlab
::
CurrentSettings
.
should_check_namespace_plan?
render_404
unless
::
Gitlab
::
CurrentSettings
.
should_check_namespace_plan?
end
end
...
...
ee/app/helpers/ee/trial_registration_helper.rb
0 → 100644
View file @
9fa99074
# frozen_string_literal: true
module
EE
module
TrialRegistrationHelper
def
social_signin_enabled?
::
Gitlab
.
dev_env_or_com?
&&
omniauth_enabled?
&&
devise_mapping
.
omniauthable?
&&
button_based_providers_enabled?
end
end
end
ee/spec/helpers/ee/trial_registration_helper_spec.rb
0 → 100644
View file @
9fa99074
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
EE
::
TrialRegistrationHelper
do
using
RSpec
::
Parameterized
::
TableSyntax
describe
'#social_signin_enabled?'
do
before
do
allow
(
::
Gitlab
).
to
receive
(
:dev_env_or_com?
).
and_return
(
com
)
allow
(
view
).
to
receive
(
:omniauth_enabled?
).
and_return
(
omniauth_enabled
)
allow
(
view
).
to
receive
(
:button_based_providers_enabled?
).
and_return
(
button_based_providers_enabled
)
allow
(
view
).
to
receive
(
:devise_mapping
).
and_return
(
double
(
omniauthable?:
omniauthable
))
end
subject
{
helper
.
social_signin_enabled?
}
where
com:
[
true
,
false
],
omniauth_enabled:
[
true
,
false
],
omniauthable:
[
true
,
false
],
button_based_providers_enabled:
[
true
,
false
]
with_them
do
let
(
:result
)
{
com
&&
omniauth_enabled
&&
button_based_providers_enabled
&&
omniauthable
}
it
{
is_expected
.
to
eq
(
result
)
}
end
end
end
locale/gitlab.pot
View file @
9fa99074
...
@@ -9405,9 +9405,6 @@ msgstr ""
...
@@ -9405,9 +9405,6 @@ msgstr ""
msgid "Create your group"
msgid "Create your group"
msgstr ""
msgstr ""
msgid "Create your own profile to collaborate with your teammates in issues, merge requests, and more."
msgstr ""
msgid "Create/import your first project"
msgid "Create/import your first project"
msgstr ""
msgstr ""
...
@@ -18901,9 +18898,6 @@ msgstr ""
...
@@ -18901,9 +18898,6 @@ msgstr ""
msgid "Join Zoom meeting"
msgid "Join Zoom meeting"
msgstr ""
msgstr ""
msgid "Join your team"
msgstr ""
msgid "Joined %{time_ago}"
msgid "Joined %{time_ago}"
msgstr ""
msgstr ""
...
...
spec/controllers/invites_controller_spec.rb
View file @
9fa99074
...
@@ -127,38 +127,11 @@ RSpec.describe InvitesController do
...
@@ -127,38 +127,11 @@ RSpec.describe InvitesController do
expect
(
flash
[
:notice
]).
to
include
(
'create an account or sign in'
)
expect
(
flash
[
:notice
]).
to
include
(
'create an account or sign in'
)
end
end
context
'when it is part of our invite email experiment'
,
:experiment
,
:aggregate_failures
do
it
'is redirected to a new registration with invite email param and flash message'
,
:aggregate_failures
do
let
(
:experience
)
{
:control
}
request
before
do
stub_experiments
(
invite_signup_page_interaction:
experience
)
end
it
'sets originating_member_id session key'
do
request
expect
(
session
[
:originating_member_id
]).
to
eq
(
member
.
id
)
end
context
'with control experience'
do
it
'is redirected to a new registration with invite email param and flash message'
do
request
expect
(
response
).
to
redirect_to
(
new_user_registration_path
(
invite_email:
member
.
invite_email
))
expect
(
flash
[
:notice
]).
to
eq
'To accept this invitation, create an account or sign in.'
end
end
context
'with candidate experience'
do
let
(
:experience
)
{
:candidate
}
it
'is redirected to a new invite registration with invite email param and no flash message'
do
request
expect
(
response
).
to
redirect_to
(
new_users_sign_up_invite_path
(
invite_email:
member
.
invite_email
))
expect
(
response
).
to
redirect_to
(
new_user_registration_path
(
invite_email:
member
.
invite_email
))
expect
(
flash
[
:notice
]).
to
be_nil
expect
(
flash
[
:notice
]).
to
eq
'To accept this invitation, create an account or sign in.'
end
end
end
end
it
'sets session keys for auto email confirmation on sign up'
do
it
'sets session keys for auto email confirmation on sign up'
do
...
...
spec/controllers/registrations_controller_spec.rb
View file @
9fa99074
...
@@ -187,38 +187,6 @@ RSpec.describe RegistrationsController do
...
@@ -187,38 +187,6 @@ RSpec.describe RegistrationsController do
end
end
end
end
context
'when it is part of our invite_signup_page_interaction experiment'
,
:experiment
do
let_it_be
(
:member
)
{
create
(
:project_member
,
:invited
,
invite_email:
user_params
.
dig
(
:user
,
:email
))
}
let
(
:originating_member_id
)
{
member
.
id
}
let
(
:session_params
)
do
{
invite_email:
user_params
.
dig
(
:user
,
:email
),
originating_member_id:
originating_member_id
}
end
context
'when member exists from the session key value'
do
it
'tracks the experiment'
do
expect
(
experiment
(
:invite_signup_page_interaction
)).
to
track
(
:form_submission
)
.
with_context
(
actor:
member
)
.
on_next_instance
subject
end
end
context
'when member does not exist from the session key value'
do
let
(
:originating_member_id
)
{
-
1
}
it
'tracks the experiment'
do
expect
(
experiment
(
:invite_signup_page_interaction
)).
not_to
track
(
:form_submission
)
subject
end
end
end
context
'when invite email matches email used on registration'
do
context
'when invite email matches email used on registration'
do
let
(
:session_params
)
{
{
invite_email:
user_params
.
dig
(
:user
,
:email
)
}
}
let
(
:session_params
)
{
{
invite_email:
user_params
.
dig
(
:user
,
:email
)
}
}
...
...
spec/features/invites_spec.rb
View file @
9fa99074
...
@@ -272,54 +272,15 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do
...
@@ -272,54 +272,15 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do
end
end
end
end
context
'with invite_signup_page_interaction experiment on'
,
:experiment
do
context
'when accepting an invite without an account'
do
context
'with control experience'
do
it
'lands on sign up page and then registers'
do
before
do
visit
invite_path
(
group_invite
.
raw_invite_token
)
stub_experiments
(
invite_signup_page_interaction: :control
)
end
it
'lands on invite sign up page and tracks the accepted invite'
do
expect
(
experiment
(
:invite_signup_page_interaction
)).
to
track
(
:view
)
.
with_context
(
actor:
group_invite
)
.
on_next_instance
visit
invite_path
(
group_invite
.
raw_invite_token
)
expect
(
current_path
).
to
eq
(
new_user_registration_path
)
expect
(
experiment
(
:invite_signup_page_interaction
)).
to
track
(
:form_submission
)
.
with_context
(
actor:
group_invite
)
.
on_next_instance
fill_in_sign_up_form
(
new_user
,
'Register'
)
expect
(
current_path
).
to
eq
(
users_sign_up_welcome_path
)
end
end
context
'with candidate experience on .com'
do
before
do
allow
(
Gitlab
).
to
receive
(
:dev_env_or_com?
).
and_return
(
true
)
stub_experiments
(
invite_signup_page_interaction: :candidate
)
end
it
'lands on invite sign up page and tracks the accepted invite'
do
expect
(
current_path
).
to
eq
(
new_user_registration_path
)
expect
(
experiment
(
:invite_signup_page_interaction
)).
to
track
(
:view
)
.
with_context
(
actor:
group_invite
)
.
on_next_instance
visit
invite_path
(
group_invite
.
raw_invite_token
)
fill_in_sign_up_form
(
new_user
,
'Register'
)
expect
(
current_path
).
to
eq
(
new_users_sign_up_invite_path
)
expect
(
experiment
(
:invite_signup_page_interaction
)).
to
track
(
:form_submission
)
.
with_context
(
actor:
group_invite
)
.
on_next_instance
fill_in_sign_up_form
(
new_user
,
'Continue'
)
expect
(
current_path
).
to
eq
(
users_sign_up_welcome_path
)
expect
(
current_path
).
to
eq
(
users_sign_up_welcome_path
)
end
end
end
end
end
...
...
spec/helpers/registrations_helper_spec.rb
View file @
9fa99074
...
@@ -3,30 +3,6 @@
...
@@ -3,30 +3,6 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
RegistrationsHelper
do
RSpec
.
describe
RegistrationsHelper
do
using
RSpec
::
Parameterized
::
TableSyntax
describe
'#social_signin_enabled?'
do
before
do
allow
(
::
Gitlab
).
to
receive
(
:dev_env_or_com?
).
and_return
(
com
)
allow
(
view
).
to
receive
(
:omniauth_enabled?
).
and_return
(
omniauth_enabled
)
allow
(
view
).
to
receive
(
:button_based_providers_enabled?
).
and_return
(
button_based_providers_enabled
)
allow
(
view
).
to
receive
(
:devise_mapping
).
and_return
(
double
(
omniauthable?:
omniauthable
))
end
subject
{
helper
.
social_signin_enabled?
}
where
com:
[
true
,
false
],
omniauth_enabled:
[
true
,
false
],
omniauthable:
[
true
,
false
],
button_based_providers_enabled:
[
true
,
false
]
with_them
do
let
(
:result
)
{
com
&&
omniauth_enabled
&&
button_based_providers_enabled
&&
omniauthable
}
it
{
is_expected
.
to
eq
(
result
)
}
end
end
describe
'#signup_username_data_attributes'
do
describe
'#signup_username_data_attributes'
do
it
'has expected attributes'
do
it
'has expected attributes'
do
expect
(
helper
.
signup_username_data_attributes
.
keys
).
to
include
(
:min_length
,
:min_length_message
,
:max_length
,
:max_length_message
,
:qa_selector
)
expect
(
helper
.
signup_username_data_attributes
.
keys
).
to
include
(
:min_length
,
:min_length_message
,
:max_length
,
:max_length_message
,
:qa_selector
)
...
...
spec/requests/invite_registration_spec.rb
deleted
100644 → 0
View file @
5b72cb19
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'Registering from an invite'
do
let
(
:com
)
{
true
}
before
do
allow
(
Gitlab
).
to
receive
(
:dev_env_or_com?
).
and_return
(
com
)
end
describe
'GET /users/sign_up/invites/new'
do
subject
(
:request
)
{
get
'/users/sign_up/invites/new'
}
context
'when on .com'
do
it
'renders the template with expected text'
,
:aggregate_failures
do
request
expect
(
response
).
to
render_template
(
'layouts/simple_registration'
)
expect
(
response
).
to
render_template
(
:new
)
expect
(
response
.
body
).
to
include
(
'Join your team'
)
end
end
context
'when not on .com'
do
let
(
:com
)
{
false
}
it
'returns not found'
do
request
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
describe
'POST /users/sign_up/invites'
do
subject
(
:request
)
do
post
'/users/sign_up/invites'
,
params:
{
user:
{
first_name:
'first'
,
last_name:
'last'
,
username:
'new_username'
,
email:
'new@user.com'
,
password:
'Any_password'
}
}
end
context
'when on .com'
do
it
'creates a user'
do
expect
{
request
}.
to
change
(
User
,
:count
).
by
(
1
)
expect
(
response
).
to
have_gitlab_http_status
(
:found
)
end
end
context
'when not on .com'
do
let
(
:com
)
{
false
}
it
'returns not found'
do
request
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment