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
d314a600
Commit
d314a600
authored
Nov 27, 2020
by
Martin Wortschack
Committed by
Sean McGivern
Nov 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove codeReviewAnalyticsHasNewSearch
feature flag
parent
8bb7aacd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
120 deletions
+21
-120
ee/app/assets/javascripts/analytics/code_review_analytics/components/app.vue
...cripts/analytics/code_review_analytics/components/app.vue
+1
-12
ee/app/controllers/projects/analytics/code_reviews_controller.rb
...controllers/projects/analytics/code_reviews_controller.rb
+0
-1
ee/app/views/projects/analytics/code_reviews/index.html.haml
ee/app/views/projects/analytics/code_reviews/index.html.haml
+0
-2
ee/config/feature_flags/development/code_review_analytics_has_new_search.yml
...lags/development/code_review_analytics_has_new_search.yml
+0
-8
ee/spec/features/analytics/code_analytics_spec.rb
ee/spec/features/analytics/code_analytics_spec.rb
+15
-55
ee/spec/frontend/analytics/code_review_analytics/components/app_spec.js
...nd/analytics/code_review_analytics/components/app_spec.js
+5
-42
No files found.
ee/app/assets/javascripts/analytics/code_review_analytics/components/app.vue
View file @
d314a600
<
script
>
<
script
>
import
{
mapState
,
mapActions
}
from
'
vuex
'
;
import
{
mapState
,
mapActions
}
from
'
vuex
'
;
import
{
GlBadge
,
GlLoadingIcon
,
GlEmptyState
,
GlPagination
}
from
'
@gitlab/ui
'
;
import
{
GlBadge
,
GlLoadingIcon
,
GlEmptyState
,
GlPagination
}
from
'
@gitlab/ui
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
MergeRequestTable
from
'
./merge_request_table.vue
'
;
import
MergeRequestTable
from
'
./merge_request_table.vue
'
;
import
FilterBar
from
'
./filter_bar.vue
'
;
import
FilterBar
from
'
./filter_bar.vue
'
;
import
FilteredSearchCodeReviewAnalytics
from
'
../filtered_search_code_review_analytics
'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -15,7 +13,6 @@ export default {
...
@@ -15,7 +13,6 @@ export default {
FilterBar
,
FilterBar
,
MergeRequestTable
,
MergeRequestTable
,
},
},
mixins
:
[
glFeatureFlagsMixin
()],
props
:
{
props
:
{
projectId
:
{
projectId
:
{
type
:
Number
,
type
:
Number
,
...
@@ -50,16 +47,8 @@ export default {
...
@@ -50,16 +47,8 @@ export default {
this
.
fetchMergeRequests
();
this
.
fetchMergeRequests
();
},
},
},
},
codeReviewAnalyticsHasNewSearch
()
{
return
this
.
glFeatures
.
codeReviewAnalyticsHasNewSearch
;
},
},
},
created
()
{
created
()
{
if
(
!
this
.
codeReviewAnalyticsHasNewSearch
)
{
this
.
filterManager
=
new
FilteredSearchCodeReviewAnalytics
();
this
.
filterManager
.
setup
();
}
this
.
setProjectId
(
this
.
projectId
);
this
.
setProjectId
(
this
.
projectId
);
this
.
fetchMergeRequests
();
this
.
fetchMergeRequests
();
},
},
...
@@ -71,7 +60,7 @@ export default {
...
@@ -71,7 +60,7 @@ export default {
<
template
>
<
template
>
<div>
<div>
<filter-bar
v-if=
"codeReviewAnalyticsHasNewSearch"
:project-path=
"projectPath"
/>
<filter-bar
:project-path=
"projectPath"
/>
<div
class=
"mt-2"
>
<div
class=
"mt-2"
>
<gl-loading-icon
v-show=
"isLoading"
size=
"md"
class=
"mt-3"
/>
<gl-loading-icon
v-show=
"isLoading"
size=
"md"
class=
"mt-3"
/>
<template
v-if=
"!isLoading"
>
<template
v-if=
"!isLoading"
>
...
...
ee/app/controllers/projects/analytics/code_reviews_controller.rb
View file @
d314a600
...
@@ -7,7 +7,6 @@ module Projects
...
@@ -7,7 +7,6 @@ module Projects
before_action
:authorize_read_code_review_analytics!
before_action
:authorize_read_code_review_analytics!
before_action
do
before_action
do
push_frontend_feature_flag
(
:code_review_analytics_has_new_search
)
push_frontend_feature_flag
(
:not_issuable_queries
,
@project
,
default_enabled:
true
)
push_frontend_feature_flag
(
:not_issuable_queries
,
@project
,
default_enabled:
true
)
end
end
...
...
ee/app/views/projects/analytics/code_reviews/index.html.haml
View file @
d314a600
...
@@ -5,6 +5,4 @@
...
@@ -5,6 +5,4 @@
%h3
.mb-2
%h3
.mb-2
=
_
(
'Code Review'
)
=
_
(
'Code Review'
)
%span
.text-secondary
=
_
(
'Review time is defined as the time it takes from first comment until merged.'
)
%span
.text-secondary
=
_
(
'Review time is defined as the time it takes from first comment until merged.'
)
-
if
Feature
.
disabled?
(
:code_review_analytics_has_new_search
)
=
render
'shared/issuable/search_bar'
,
type: :issues_analytics
,
show_sorting_dropdown:
false
,
placeholder:
_
(
'Filter results...'
)
#js-code-review-analytics
{
data:
{
project_id:
@project
.
id
,
project_path:
project_path
(
@project
),
new_merge_request_url:
namespace_project_new_merge_request_path
(
@project
.
namespace
),
empty_state_svg_path:
image_path
(
'illustrations/merge_requests.svg'
),
milestone_path:
project_milestones_path
(
@project
),
labels_path:
project_labels_path
(
@project
)
}
}
#js-code-review-analytics
{
data:
{
project_id:
@project
.
id
,
project_path:
project_path
(
@project
),
new_merge_request_url:
namespace_project_new_merge_request_path
(
@project
.
namespace
),
empty_state_svg_path:
image_path
(
'illustrations/merge_requests.svg'
),
milestone_path:
project_milestones_path
(
@project
),
labels_path:
project_labels_path
(
@project
)
}
}
ee/config/feature_flags/development/code_review_analytics_has_new_search.yml
deleted
100644 → 0
View file @
8bb7aacd
---
name
:
code_review_analytics_has_new_search
introduced_by_url
:
rollout_issue_url
:
milestone
:
type
:
development
group
:
default_enabled
:
false
ee/spec/features/analytics/code_analytics_spec.rb
View file @
d314a600
...
@@ -3,8 +3,6 @@
...
@@ -3,8 +3,6 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
'CodeReviewAnalytics Filtered Search'
,
:js
do
RSpec
.
describe
'CodeReviewAnalytics Filtered Search'
,
:js
do
include
FilteredSearchHelpers
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
...
@@ -12,68 +10,30 @@ RSpec.describe 'CodeReviewAnalytics Filtered Search', :js do
...
@@ -12,68 +10,30 @@ RSpec.describe 'CodeReviewAnalytics Filtered Search', :js do
stub_licensed_features
(
code_review_analytics:
true
)
stub_licensed_features
(
code_review_analytics:
true
)
project
.
add_reporter
(
user
)
project
.
add_reporter
(
user
)
end
context
'when the "new search" feature is disabled'
do
before
do
stub_feature_flags
(
code_review_analytics_has_new_search:
false
)
sign_in
(
user
)
sign_in
(
user
)
visit
project_analytics_code_reviews_path
(
project
)
end
it
'renders the filtered search bar correctly'
do
visit
project_analytics_code_reviews_path
(
project
)
page
.
within
(
'.content-wrapper .content .issues-filters'
)
do
end
expect
(
page
).
to
have_css
(
'.filtered-search-box'
)
end
end
it
'displays label and milestone in search hint'
do
filtered_search
.
click
page
.
within
(
'#js-dropdown-hint'
)
do
expect
(
page
).
to
have_content
(
'Label'
)
expect
(
page
).
to
have_content
(
'Milestone'
)
end
end
context
'with merge_requests'
do
let
(
:label
)
{
create
(
:label
,
title:
'awesome label'
,
project:
project
)
}
before
do
create
(
:merge_request
,
title:
"Bug fix-1"
,
source_project:
project
,
source_branch:
"branch-1"
)
create
(
:labeled_merge_request
,
title:
"Bug fix with label"
,
source_project:
project
,
source_branch:
"branch-with-label"
,
labels:
[
label
])
create
(
:labeled_merge_request
,
title:
"Bug fix with label#2"
,
source_project:
project
,
source_branch:
"branch-with-label-2"
,
labels:
[
label
])
end
it
'filters the list of merge requests'
,
quarantine:
'https://gitlab.com/gitlab-org/gitlab/-/issues/250638'
do
has_merge_requests
(
3
)
select_label_on_dropdown
(
label
.
title
)
has_merge_requests
(
2
)
it
'renders the filtered search bar correctly'
do
end
page
.
within
(
'.content-wrapper .content .vue-filtered-search-bar-container'
)
do
expect
(
page
).
to
have_selector
(
'.gl-search-box-by-click'
)
expect
(
page
.
find
(
'.gl-filtered-search-term-input'
)[
:placeholder
]).
to
eq
(
'Filter results'
)
end
end
end
end
context
'when the "new search" feature is enabled
'
do
it
'displays label and milestone in search hint
'
do
before
do
page
.
within
(
'.content-wrapper .content .vue-filtered-search-bar-container'
)
do
stub_feature_flags
(
code_review_analytics_has_new_search:
true
)
page
.
find
(
'.gl-search-box-by-click'
).
click
sign_in
(
user
)
expect
(
page
).
to
have_selector
(
'.gl-filtered-search-suggestion-list'
)
visit
project_analytics_code_reviews_path
(
project
)
hints
=
page
.
find_all
(
'.gl-filtered-search-suggestion-list > li'
)
end
it
'does not render the filtered search bar'
do
expect
(
hints
.
length
).
to
eq
(
2
)
page
.
within
(
'.content-wrapper .content'
)
do
expect
(
hints
[
0
]).
to
have_content
(
'Milestone'
)
expect
(
page
).
not_to
have_css
(
'.issues-filters'
)
expect
(
hints
[
1
]).
to
have_content
(
'Label'
)
end
end
end
end
end
def
has_merge_requests
(
num
=
0
)
expect
(
page
).
to
have_text
(
"Merge Requests in Review
#{
num
}
"
)
end
end
end
ee/spec/frontend/analytics/code_review_analytics/components/app_spec.js
View file @
d314a600
...
@@ -9,13 +9,6 @@ import createMergeRequestsState from 'ee/analytics/code_review_analytics/store/m
...
@@ -9,13 +9,6 @@ import createMergeRequestsState from 'ee/analytics/code_review_analytics/store/m
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
createFiltersState
from
'
~/vue_shared/components/filtered_search_bar/store/modules/filters/state
'
;
import
createFiltersState
from
'
~/vue_shared/components/filtered_search_bar/store/modules/filters/state
'
;
const
mockFilterManagerSetup
=
jest
.
fn
();
jest
.
mock
(
'
ee/analytics/code_review_analytics/filtered_search_code_review_analytics
'
,
()
=>
jest
.
fn
().
mockImplementation
(()
=>
({
setup
:
mockFilterManagerSetup
,
})),
);
const
localVue
=
createLocalVue
();
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
localVue
.
use
(
Vuex
);
...
@@ -62,7 +55,7 @@ describe('CodeReviewAnalyticsApp component', () => {
...
@@ -62,7 +55,7 @@ describe('CodeReviewAnalyticsApp component', () => {
},
},
});
});
const
createComponent
=
(
store
,
codeReviewAnalyticsHasNewSearch
=
false
)
=>
const
createComponent
=
store
=>
shallowMount
(
CodeReviewAnalyticsApp
,
{
shallowMount
(
CodeReviewAnalyticsApp
,
{
localVue
,
localVue
,
store
,
store
,
...
@@ -74,11 +67,6 @@ describe('CodeReviewAnalyticsApp component', () => {
...
@@ -74,11 +67,6 @@ describe('CodeReviewAnalyticsApp component', () => {
projectPath
:
TEST_HOST
,
projectPath
:
TEST_HOST
,
labelsPath
:
`
${
TEST_HOST
}
/labels`
,
labelsPath
:
`
${
TEST_HOST
}
/labels`
,
},
},
provide
:
{
glFeatures
:
{
codeReviewAnalyticsHasNewSearch
,
},
},
});
});
beforeEach
(()
=>
{
beforeEach
(()
=>
{
...
@@ -98,36 +86,11 @@ describe('CodeReviewAnalyticsApp component', () => {
...
@@ -98,36 +86,11 @@ describe('CodeReviewAnalyticsApp component', () => {
const
findPagination
=
()
=>
wrapper
.
find
(
GlPagination
);
const
findPagination
=
()
=>
wrapper
.
find
(
GlPagination
);
describe
(
'
template
'
,
()
=>
{
describe
(
'
template
'
,
()
=>
{
describe
(
'
when "codeReviewAnalyticsHasNewSearch" is disabled
'
,
()
=>
{
it
(
'
renders the filter bar component
'
,
()
=>
{
beforeEach
(()
=>
{
vuexStore
=
createStore
();
vuexStore
=
createStore
();
wrapper
=
createComponent
(
vuexStore
,
true
);
wrapper
=
createComponent
(
vuexStore
);
});
it
(
'
does not render the filter bar component
'
,
()
=>
{
expect
(
findFilterBar
().
exists
()).
toBe
(
false
);
});
it
(
"
calls the filterManager's setup method
"
,
()
=>
{
expect
(
mockFilterManagerSetup
).
toHaveBeenCalled
();
});
});
describe
(
'
when "codeReviewAnalyticsHasNewSearch" is enabled
'
,
()
=>
{
describe
(
'
when the feature is enabled
'
,
()
=>
{
beforeEach
(()
=>
{
vuexStore
=
createStore
();
wrapper
=
createComponent
(
vuexStore
,
true
);
});
it
(
'
renders the filter bar component
'
,
()
=>
{
expect
(
findFilterBar
().
exists
()).
toBe
(
true
);
expect
(
findFilterBar
().
exists
()).
toBe
(
true
);
});
it
(
"
does not call the filterManager's setup method
"
,
()
=>
{
expect
(
mockFilterManagerSetup
).
not
.
toHaveBeenCalled
();
});
});
});
});
describe
(
'
while loading
'
,
()
=>
{
describe
(
'
while loading
'
,
()
=>
{
...
...
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