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
5adb5a11
Commit
5adb5a11
authored
Sep 30, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
ae2088bc
e51a3eae
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
80 additions
and
111 deletions
+80
-111
app/assets/javascripts/integrations/overrides/components/integration_overrides.vue
...tegrations/overrides/components/integration_overrides.vue
+12
-7
app/assets/stylesheets/pages/login.scss
app/assets/stylesheets/pages/login.scss
+6
-0
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
lib/tasks/import.rake
lib/tasks/import.rake
+3
-10
spec/frontend/integrations/overrides/components/integration_overrides_spec.js
...ations/overrides/components/integration_overrides_spec.js
+18
-11
No files found.
app/assets/javascripts/integrations/overrides/components/integration_overrides.vue
View file @
5adb5a11
<
script
>
import
{
GlLink
,
GlLoadingIcon
,
GlPagination
,
GlTable
}
from
'
@gitlab/ui
'
;
import
{
GlLink
,
GlLoadingIcon
,
GlPagination
,
GlTable
,
GlAlert
}
from
'
@gitlab/ui
'
;
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
{
DEFAULT_PER_PAGE
}
from
'
~/api
'
;
import
createFlash
from
'
~/flash
'
;
import
{
fetchOverrides
}
from
'
~/integrations/overrides/api
'
;
import
{
parseIntPagination
,
normalizeHeaders
}
from
'
~/lib/utils/common_utils
'
;
import
{
truncateNamespace
}
from
'
~/lib/utils/text_utility
'
;
...
...
@@ -16,6 +16,7 @@ export default {
GlLoadingIcon
,
GlPagination
,
GlTable
,
GlAlert
,
ProjectAvatar
,
},
props
:
{
...
...
@@ -36,6 +37,7 @@ export default {
overrides
:
[],
page
:
1
,
totalItems
:
0
,
errorMessage
:
null
,
};
},
computed
:
{
...
...
@@ -49,6 +51,7 @@ export default {
methods
:
{
loadOverrides
(
page
=
this
.
page
)
{
this
.
isLoading
=
true
;
this
.
errorMessage
=
null
;
fetchOverrides
(
this
.
overridesPath
,
{
page
,
...
...
@@ -61,11 +64,9 @@ export default {
this
.
overrides
=
data
;
})
.
catch
((
error
)
=>
{
createFlash
({
message
:
this
.
$options
.
i18n
.
defaultErrorMessage
,
error
,
captureError
:
true
,
});
this
.
errorMessage
=
this
.
$options
.
i18n
.
defaultErrorMessage
;
Sentry
.
captureException
(
error
);
})
.
finally
(()
=>
{
this
.
isLoading
=
false
;
...
...
@@ -85,7 +86,11 @@ export default {
<
template
>
<div>
<gl-alert
v-if=
"errorMessage"
variant=
"danger"
:dismissible=
"false"
>
{{
errorMessage
}}
</gl-alert>
<gl-table
v-else
:items=
"overrides"
:fields=
"$options.fields"
:busy=
"isLoading"
...
...
app/assets/stylesheets/pages/login.scss
View file @
5adb5a11
...
...
@@ -206,6 +206,12 @@
padding
:
0
;
height
:
100%
;
&
.with-system-header
{
.login-page-broadcast
{
margin-top
:
$system-header-height
+
$header-height
;
}
}
// Fixes footer container to bottom of viewport
body
{
// offset height of fixed header + 1 to avoid scroll
...
...
ee/app/views/layouts/nav/sidebar/_group_trial_status_widget.html.haml
View file @
5adb5a11
...
...
@@ -2,10 +2,6 @@
-
root_group
=
group
.
root_ancestor
-
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
#js-trial-status-widget
{
data:
trial_status_widget_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 @
ae2088bc
---
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 @
5adb5a11
...
...
@@ -15,12 +15,17 @@ RSpec.describe 'Billing plan pages', :feature, :js do
let
(
:plans_data
)
{
billing_plans_data
}
before
do
stub_application_setting
(
check_namespace_plan:
true
)
stub_feature_flags
(
show_billing_eoa_banner:
true
)
stub_feature_flags
(
hide_deprecated_billing_plans:
false
)
stub_billing_plans
(
nil
)
stub_billing_plans
(
namespace
.
id
,
plan
.
name
,
plans_data
.
to_json
)
stub_eoa_eligibility_request
(
namespace
.
id
)
stub_application_setting
(
check_namespace_plan:
true
)
allow
(
Gitlab
).
to
receive
(
:com?
)
{
true
}
sign_in
(
user
)
end
...
...
@@ -412,8 +417,11 @@ RSpec.describe 'Billing plan pages', :feature, :js do
let
(
:plan
)
{
free_plan
}
let!
(
:subscription
)
do
create
(
:gitlab_subscription
,
namespace:
namespace
,
hosted_plan:
premium_plan
,
trial:
true
,
trial_ends_on:
Date
.
current
.
tomorrow
,
seats:
15
)
create
(
:gitlab_subscription
,
:active_trial
,
namespace:
namespace
,
hosted_plan:
premium_plan
,
seats:
15
)
end
before
do
...
...
ee/spec/features/billings/extend_reactivate_trial_spec.rb
View file @
5adb5a11
...
...
@@ -23,6 +23,7 @@ RSpec.describe 'Billings > Extend / Reactivate Trial', :js do
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
true
)
stub_ee_application_setting
(
should_check_namespace_plan:
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
}
"
)
.
to_return
(
status:
200
,
body:
plans_data
.
to_json
)
stub_full_request
(
"
#{
EE
::
SUBSCRIPTIONS_URL
}
/trials/extend_reactivate_trial"
,
method: :put
)
...
...
ee/spec/features/trials/show_trial_banner_spec.rb
View file @
5adb5a11
...
...
@@ -3,37 +3,40 @@
require
'spec_helper'
RSpec
.
describe
'Show trial banner'
,
:js
do
include
StubRequests
include
SubscriptionPortalHelpers
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:group
)
{
create
(
:group
)
}
let!
(
:ultimate_plan
)
{
create
(
:ultimate_plan
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let
(
:ultimate_plan
)
{
create
(
:ultimate_plan
)
}
before
do
stub_application_setting
(
check_namespace_plan:
true
)
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
true
).
at_least
(
:once
)
stub_billing_plans
(
namespace_id
)
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
)
stub_billing_plans
(
nil
)
gitlab_
sign_in
(
user
)
sign_in
(
user
)
end
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
visit
profile_billings_path
+
'?trial=true'
visit
profile_billings_path
(
trial:
true
)
expect
(
page
).
to
have_content
(
'Congratulations, your free trial is activated.'
)
end
end
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
visit
group_path
(
group
,
trial:
true
)
...
...
ee/spec/views/layouts/nav/sidebar/_group.html.haml_spec.rb
View file @
5adb5a11
...
...
@@ -3,75 +3,37 @@
require
'spec_helper'
RSpec
.
describe
'layouts/nav/sidebar/_group'
do
let_it_be_with_refind
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
before
do
assign
(
:group
,
group
)
allow
(
view
).
to
receive
(
:show_trial_status_widget?
).
and_return
(
false
)
end
let
(
:group
)
{
create
(
:group
)
}
let
(
:user
)
{
create
(
:user
)
}
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
render
rendered
end
shared_examples
'does not render the widget & popover
'
do
it
'does not render'
do
context
'when the widget should not be shown
'
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-popover'
end
end
shared_examples
'renders the widget & popover'
do
it
'renders both the widget & popover component initialization elements'
do
is_expected
.
to
have_selector
'#js-trial-status-widget'
is_expected
.
to
have_selector
'#js-trial-status-popover'
end
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
context
'when the widget should be shown'
do
before
do
allow
(
view
).
to
receive
(
:show_trial_status_widget?
).
and_return
(
true
)
allow
(
view
).
to
receive
(
:trial_status_widget_data_attrs
).
and_return
({
foo:
'bar'
})
allow
(
view
).
to
receive
(
:trial_status_popover_data_attrs
).
and_return
({
baz:
'quux'
})
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
with_them
do
params
[
:examples_to_include
].
each
do
|
example_set
|
include_examples
(
example_set
)
it
'renders both the widget & popover component initialization elements'
do
is_expected
.
to
have_selector
'#js-trial-status-widget[data-foo="bar"]'
is_expected
.
to
have_selector
'#js-trial-status-popover[data-baz="quux"]'
end
end
end
...
...
lib/gitlab/experimentation.rb
View file @
5adb5a11
...
...
@@ -40,10 +40,6 @@ module Gitlab
},
invite_members_new_dropdown:
{
tracking_category:
'Growth::Expansion::Experiment::InviteMembersNewDropdown'
},
show_trial_status_in_sidebar:
{
tracking_category:
'Growth::Conversion::Experiment::ShowTrialStatusInSidebar'
,
rollout_strategy: :group
}
}.
freeze
...
...
lib/tasks/import.rake
View file @
5adb5a11
...
...
@@ -46,21 +46,14 @@ class GithubImport
def
import!
@project
.
import_state
.
force_start
import_success
=
false
timings
=
Benchmark
.
measure
do
import_success
=
Gitlab
::
GithubImport
::
SequentialImporter
Gitlab
::
GithubImport
::
SequentialImporter
.
new
(
@project
,
token:
@options
[
:token
])
.
execute
end
if
import_success
@project
.
after_import
puts
"Import finished. Timings:
#{
timings
}
"
.
color
(
:green
)
else
puts
"Import was not successful. Errors were as follows:"
puts
@project
.
import_state
.
last_error
end
@project
.
after_import
puts
"Import finished. Timings:
#{
timings
}
"
.
color
(
:green
)
end
def
new_project
...
...
spec/frontend/integrations/overrides/components/integration_overrides_spec.js
View file @
5adb5a11
import
{
GlTable
,
GlLink
,
GlPagination
}
from
'
@gitlab/ui
'
;
import
{
GlTable
,
GlLink
,
GlPagination
,
GlAlert
}
from
'
@gitlab/ui
'
;
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
{
shallowMount
,
mount
}
from
'
@vue/test-utils
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
{
DEFAULT_PER_PAGE
}
from
'
~/api
'
;
import
createFlash
from
'
~/flash
'
;
import
IntegrationOverrides
from
'
~/integrations/overrides/components/integration_overrides.vue
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
httpStatus
from
'
~/lib/utils/http_status
'
;
import
ProjectAvatar
from
'
~/vue_shared/components/project_avatar.vue
'
;
jest
.
mock
(
'
~/flash
'
);
const
mockOverrides
=
Array
(
DEFAULT_PER_PAGE
*
3
)
.
fill
(
1
)
.
map
((
_
,
index
)
=>
({
...
...
@@ -62,6 +60,7 @@ describe('IntegrationOverrides', () => {
text
:
link
.
text
(),
};
});
const
findAlert
=
()
=>
wrapper
.
findComponent
(
GlAlert
);
describe
(
'
while loading
'
,
()
=>
{
it
(
'
sets GlTable `busy` attribute to `true`
'
,
()
=>
{
...
...
@@ -104,18 +103,26 @@ describe('IntegrationOverrides', () => {
describe
(
'
when request fails
'
,
()
=>
{
beforeEach
(
async
()
=>
{
jest
.
spyOn
(
Sentry
,
'
captureException
'
);
mockAxios
.
onGet
(
defaultProps
.
overridesPath
).
reply
(
httpStatus
.
INTERNAL_SERVER_ERROR
);
createComponent
();
await
waitForPromises
();
});
it
(
'
calls createFlash
'
,
()
=>
{
expect
(
createFlash
).
toHaveBeenCalledTimes
(
1
);
expect
(
createFlash
).
toHaveBeenCalledWith
({
message
:
IntegrationOverrides
.
i18n
.
defaultErrorMessage
,
captureError
:
true
,
error
:
expect
.
any
(
Error
),
});
it
(
'
displays error alert
'
,
()
=>
{
const
alert
=
findAlert
();
expect
(
alert
.
exists
()).
toBe
(
true
);
expect
(
alert
.
text
()).
toBe
(
IntegrationOverrides
.
i18n
.
defaultErrorMessage
);
});
it
(
'
hides overrides table
'
,
()
=>
{
const
table
=
findGlTable
();
expect
(
table
.
exists
()).
toBe
(
false
);
});
it
(
'
captures exception in Sentry
'
,
()
=>
{
expect
(
Sentry
.
captureException
).
toHaveBeenCalledWith
(
expect
.
any
(
Error
));
});
});
...
...
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