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
5a8bfd9f
Commit
5a8bfd9f
authored
Sep 30, 2021
by
Dallas Reedy
Committed by
Savas Vedova
Sep 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Promote the "display active trial status" experiment
parent
807fd6a7
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
83 deletions
+41
-83
ee/app/views/layouts/nav/sidebar/_group_trial_status_widget.html.haml
.../layouts/nav/sidebar/_group_trial_status_widget.html.haml
+0
-4
ee/config/feature_flags/experiment/show_trial_status_in_sidebar_experiment_percentage.yml
...nt/show_trial_status_in_sidebar_experiment_percentage.yml
+0
-8
ee/spec/features/billings/billing_plans_spec.rb
ee/spec/features/billings/billing_plans_spec.rb
+11
-3
ee/spec/features/billings/extend_reactivate_trial_spec.rb
ee/spec/features/billings/extend_reactivate_trial_spec.rb
+1
-0
ee/spec/features/trials/show_trial_banner_spec.rb
ee/spec/features/trials/show_trial_banner_spec.rb
+16
-13
ee/spec/views/layouts/nav/sidebar/_group.html.haml_spec.rb
ee/spec/views/layouts/nav/sidebar/_group.html.haml_spec.rb
+13
-51
lib/gitlab/experimentation.rb
lib/gitlab/experimentation.rb
+0
-4
No files found.
ee/app/views/layouts/nav/sidebar/_group_trial_status_widget.html.haml
View file @
5a8bfd9f
...
@@ -2,10 +2,6 @@
...
@@ -2,10 +2,6 @@
-
root_group
=
group
.
root_ancestor
-
root_group
=
group
.
root_ancestor
-
return
unless
show_trial_status_widget?
(
root_group
)
-
return
unless
show_trial_status_widget?
(
root_group
)
-# For the current Growth::Conversion experiment
-
record_experiment_group
(
:show_trial_status_in_sidebar
,
root_group
)
-
return
unless
experiment_enabled?
(
:show_trial_status_in_sidebar
,
subject:
root_group
)
=
nav_link
do
=
nav_link
do
#js-trial-status-widget
{
data:
trial_status_widget_data_attrs
(
root_group
)
}
#js-trial-status-widget
{
data:
trial_status_widget_data_attrs
(
root_group
)
}
#js-trial-status-popover
{
data:
trial_status_popover_data_attrs
(
root_group
)
}
#js-trial-status-popover
{
data:
trial_status_popover_data_attrs
(
root_group
)
}
ee/config/feature_flags/experiment/show_trial_status_in_sidebar_experiment_percentage.yml
deleted
100644 → 0
View file @
807fd6a7
---
name
:
show_trial_status_in_sidebar_experiment_percentage
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/50090
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/281019
milestone
:
'
13.8'
type
:
experiment
group
:
group::conversion
default_enabled
:
false
ee/spec/features/billings/billing_plans_spec.rb
View file @
5a8bfd9f
...
@@ -15,12 +15,17 @@ RSpec.describe 'Billing plan pages', :feature, :js do
...
@@ -15,12 +15,17 @@ RSpec.describe 'Billing plan pages', :feature, :js do
let
(
:plans_data
)
{
billing_plans_data
}
let
(
:plans_data
)
{
billing_plans_data
}
before
do
before
do
stub_application_setting
(
check_namespace_plan:
true
)
stub_feature_flags
(
show_billing_eoa_banner:
true
)
stub_feature_flags
(
show_billing_eoa_banner:
true
)
stub_feature_flags
(
hide_deprecated_billing_plans:
false
)
stub_feature_flags
(
hide_deprecated_billing_plans:
false
)
stub_billing_plans
(
nil
)
stub_billing_plans
(
namespace
.
id
,
plan
.
name
,
plans_data
.
to_json
)
stub_billing_plans
(
namespace
.
id
,
plan
.
name
,
plans_data
.
to_json
)
stub_eoa_eligibility_request
(
namespace
.
id
)
stub_eoa_eligibility_request
(
namespace
.
id
)
stub_application_setting
(
check_namespace_plan:
true
)
allow
(
Gitlab
).
to
receive
(
:com?
)
{
true
}
allow
(
Gitlab
).
to
receive
(
:com?
)
{
true
}
sign_in
(
user
)
sign_in
(
user
)
end
end
...
@@ -412,8 +417,11 @@ RSpec.describe 'Billing plan pages', :feature, :js do
...
@@ -412,8 +417,11 @@ RSpec.describe 'Billing plan pages', :feature, :js do
let
(
:plan
)
{
free_plan
}
let
(
:plan
)
{
free_plan
}
let!
(
:subscription
)
do
let!
(
:subscription
)
do
create
(
:gitlab_subscription
,
namespace:
namespace
,
hosted_plan:
premium_plan
,
create
(
:gitlab_subscription
,
:active_trial
,
trial:
true
,
trial_ends_on:
Date
.
current
.
tomorrow
,
seats:
15
)
namespace:
namespace
,
hosted_plan:
premium_plan
,
seats:
15
)
end
end
before
do
before
do
...
...
ee/spec/features/billings/extend_reactivate_trial_spec.rb
View file @
5a8bfd9f
...
@@ -23,6 +23,7 @@ RSpec.describe 'Billings > Extend / Reactivate Trial', :js do
...
@@ -23,6 +23,7 @@ RSpec.describe 'Billings > Extend / Reactivate Trial', :js do
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
true
)
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
true
)
stub_ee_application_setting
(
should_check_namespace_plan:
true
)
stub_ee_application_setting
(
should_check_namespace_plan:
true
)
stub_feature_flags
(
allow_extend_reactivate_trial:
true
)
stub_feature_flags
(
allow_extend_reactivate_trial:
true
)
stub_billing_plans
(
nil
)
stub_full_request
(
"
#{
EE
::
SUBSCRIPTIONS_URL
}
/gitlab_plans?plan=
#{
plan
.
name
}
&namespace_id=
#{
group
.
id
}
"
)
stub_full_request
(
"
#{
EE
::
SUBSCRIPTIONS_URL
}
/gitlab_plans?plan=
#{
plan
.
name
}
&namespace_id=
#{
group
.
id
}
"
)
.
to_return
(
status:
200
,
body:
plans_data
.
to_json
)
.
to_return
(
status:
200
,
body:
plans_data
.
to_json
)
stub_full_request
(
"
#{
EE
::
SUBSCRIPTIONS_URL
}
/trials/extend_reactivate_trial"
,
method: :put
)
stub_full_request
(
"
#{
EE
::
SUBSCRIPTIONS_URL
}
/trials/extend_reactivate_trial"
,
method: :put
)
...
...
ee/spec/features/trials/show_trial_banner_spec.rb
View file @
5a8bfd9f
...
@@ -3,37 +3,40 @@
...
@@ -3,37 +3,40 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
'Show trial banner'
,
:js
do
RSpec
.
describe
'Show trial banner'
,
:js
do
include
StubRequests
include
SubscriptionPortalHelpers
include
SubscriptionPortalHelpers
let!
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let!
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let!
(
:ultimate_plan
)
{
create
(
:ultimate_plan
)
}
let
(
:ultimate_plan
)
{
create
(
:ultimate_plan
)
}
before
do
before
do
stub_application_setting
(
check_namespace_plan:
true
)
stub_application_setting
(
check_namespace_plan:
true
)
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
true
).
at_least
(
:once
)
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
true
).
at_least
(
:once
)
stub_billing_plans
(
namespace_id
)
stub_billing_plans
(
nil
)
group
.
add_owner
(
user
)
create
(
:gitlab_subscription
,
namespace:
user
.
namespace
,
hosted_plan:
ultimate_plan
,
trial:
true
,
trial_ends_on:
Date
.
current
+
1
.
month
)
create
(
:gitlab_subscription
,
namespace:
group
,
hosted_plan:
ultimate_plan
,
trial:
true
,
trial_ends_on:
Date
.
current
+
1
.
month
)
gitlab_
sign_in
(
user
)
sign_in
(
user
)
end
end
context
"when user's trial is active"
do
context
"when user's trial is active"
do
let
(
:namespace_id
)
{
user
.
namespace_id
}
before
do
create
(
:gitlab_subscription
,
:active_trial
,
namespace:
user
.
namespace
,
hosted_plan:
ultimate_plan
)
stub_billing_plans
(
user
.
namespace_id
)
end
it
'renders congratulations banner for user in profile billing page'
do
it
'renders congratulations banner for user in profile billing page'
do
visit
profile_billings_path
+
'?trial=true'
visit
profile_billings_path
(
trial:
true
)
expect
(
page
).
to
have_content
(
'Congratulations, your free trial is activated.'
)
expect
(
page
).
to
have_content
(
'Congratulations, your free trial is activated.'
)
end
end
end
end
context
"when group's trial is active"
do
context
"when group's trial is active"
do
let
(
:namespace_id
)
{
group
.
id
}
before
do
group
.
add_owner
(
user
)
create
(
:gitlab_subscription
,
:active_trial
,
namespace:
group
,
hosted_plan:
ultimate_plan
)
stub_billing_plans
(
group
.
id
)
end
it
'renders congratulations banner for group in group details page'
do
it
'renders congratulations banner for group in group details page'
do
visit
group_path
(
group
,
trial:
true
)
visit
group_path
(
group
,
trial:
true
)
...
...
ee/spec/views/layouts/nav/sidebar/_group.html.haml_spec.rb
View file @
5a8bfd9f
...
@@ -3,75 +3,37 @@
...
@@ -3,75 +3,37 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
'layouts/nav/sidebar/_group'
do
RSpec
.
describe
'layouts/nav/sidebar/_group'
do
let_it_be_with_refind
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
before
do
before
do
assign
(
:group
,
group
)
assign
(
:group
,
group
)
allow
(
view
).
to
receive
(
:show_trial_status_widget?
).
and_return
(
false
)
allow
(
view
).
to
receive
(
:show_trial_status_widget?
).
and_return
(
false
)
end
end
let
(
:group
)
{
create
(
:group
)
}
let
(
:user
)
{
create
(
:user
)
}
describe
'trial status widget'
,
:aggregate_failures
do
describe
'trial status widget'
,
:aggregate_failures
do
using
RSpec
::
Parameterized
::
TableSyntax
let
(
:experiment_key
)
{
:show_trial_status_in_sidebar
}
let
(
:show_widget
)
{
false
}
let
(
:experiment_enabled
)
{
false
}
before
do
allow
(
view
).
to
receive
(
:show_trial_status_widget?
).
and_return
(
show_widget
)
allow
(
view
).
to
receive
(
:experiment_enabled?
).
with
(
experiment_key
,
subject:
group
).
and_return
(
experiment_enabled
)
allow
(
view
).
to
receive
(
:record_experiment_group
)
allow
(
view
).
to
receive
(
:trial_status_widget_data_attrs
)
allow
(
view
).
to
receive
(
:trial_status_popover_data_attrs
)
render
end
subject
do
subject
do
render
render
rendered
rendered
end
end
shared_examples
'does not render the widget & popover
'
do
context
'when the widget should not be shown
'
do
it
'does not render'
do
it
'does not render
the widget & popover
'
do
is_expected
.
not_to
have_selector
'#js-trial-status-widget'
is_expected
.
not_to
have_selector
'#js-trial-status-widget'
is_expected
.
not_to
have_selector
'#js-trial-status-popover'
is_expected
.
not_to
have_selector
'#js-trial-status-popover'
end
end
end
end
shared_examples
'renders the widget & popover'
do
context
'when the widget should be shown'
do
it
'renders both the widget & popover component initialization elements'
do
before
do
is_expected
.
to
have_selector
'#js-trial-status-widget'
allow
(
view
).
to
receive
(
:show_trial_status_widget?
).
and_return
(
true
)
is_expected
.
to
have_selector
'#js-trial-status-popover'
allow
(
view
).
to
receive
(
:trial_status_widget_data_attrs
).
and_return
({
foo:
'bar'
})
end
allow
(
view
).
to
receive
(
:trial_status_popover_data_attrs
).
and_return
({
baz:
'quux'
})
end
shared_examples
'does record experiment subject'
do
it
'records the group as an experiment subject'
do
expect
(
view
).
to
receive
(
:record_experiment_group
).
with
(
experiment_key
,
group
)
subject
end
end
shared_examples
'does not record experiment subject'
do
it
'does not record the group as an experiment subject'
do
expect
(
view
).
not_to
receive
(
:record_experiment_group
)
subject
end
end
where
:show_widget
,
:experiment_enabled
,
:examples_to_include
do
true
|
true
|
[
'does record experiment subject'
,
'renders the widget & popover'
]
true
|
false
|
[
'does record experiment subject'
,
'does not render the widget & popover'
]
false
|
true
|
[
'does not record experiment subject'
,
'does not render the widget & popover'
]
false
|
false
|
[
'does not record experiment subject'
,
'does not render the widget & popover'
]
end
end
with_them
do
it
'renders both the widget & popover component initialization elements'
do
params
[
:examples_to_include
].
each
do
|
example_set
|
is_expected
.
to
have_selector
'#js-trial-status-widget[data-foo="bar"]'
i
nclude_examples
(
example_set
)
i
s_expected
.
to
have_selector
'#js-trial-status-popover[data-baz="quux"]'
end
end
end
end
end
end
...
...
lib/gitlab/experimentation.rb
View file @
5a8bfd9f
...
@@ -40,10 +40,6 @@ module Gitlab
...
@@ -40,10 +40,6 @@ module Gitlab
},
},
invite_members_new_dropdown:
{
invite_members_new_dropdown:
{
tracking_category:
'Growth::Expansion::Experiment::InviteMembersNewDropdown'
tracking_category:
'Growth::Expansion::Experiment::InviteMembersNewDropdown'
},
show_trial_status_in_sidebar:
{
tracking_category:
'Growth::Conversion::Experiment::ShowTrialStatusInSidebar'
,
rollout_strategy: :group
}
}
}.
freeze
}.
freeze
...
...
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