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
f29fb7e2
Commit
f29fb7e2
authored
Jun 28, 2021
by
Ezekiel Kigbo
Committed by
Nicolò Maria Mezzopera
Jun 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix displaying query timeout errors for VSA
parent
4936d8b8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
14 deletions
+39
-14
ee/app/assets/javascripts/analytics/cycle_analytics/components/base.vue
...javascripts/analytics/cycle_analytics/components/base.vue
+2
-2
ee/app/assets/javascripts/analytics/cycle_analytics/components/stage_table.vue
...ipts/analytics/cycle_analytics/components/stage_table.vue
+1
-1
ee/app/assets/javascripts/analytics/cycle_analytics/store/mutations.js
.../javascripts/analytics/cycle_analytics/store/mutations.js
+5
-1
ee/app/assets/javascripts/analytics/cycle_analytics/store/state.js
...sets/javascripts/analytics/cycle_analytics/store/state.js
+1
-1
ee/spec/frontend/analytics/cycle_analytics/components/base_spec.js
...rontend/analytics/cycle_analytics/components/base_spec.js
+22
-9
ee/spec/frontend/analytics/cycle_analytics/components/stage_table_spec.js
.../analytics/cycle_analytics/components/stage_table_spec.js
+4
-0
ee/spec/frontend/analytics/cycle_analytics/store/mutations_spec.js
...rontend/analytics/cycle_analytics/store/mutations_spec.js
+4
-0
No files found.
ee/app/assets/javascripts/analytics/cycle_analytics/components/base.vue
View file @
f29fb7e2
...
@@ -54,7 +54,7 @@ export default {
...
@@ -54,7 +54,7 @@ export default {
'
selectedProjects
'
,
'
selectedProjects
'
,
'
selectedStage
'
,
'
selectedStage
'
,
'
stages
'
,
'
stages
'
,
'
current
StageEvents
'
,
'
selected
StageEvents
'
,
'
errorCode
'
,
'
errorCode
'
,
'
startDate
'
,
'
startDate
'
,
'
endDate
'
,
'
endDate
'
,
...
@@ -239,7 +239,7 @@ export default {
...
@@ -239,7 +239,7 @@ export default {
<stage-table
<stage-table
v-else
v-else
:is-loading=
"isLoading || isLoadingStage"
:is-loading=
"isLoading || isLoadingStage"
:stage-events=
"
current
StageEvents"
:stage-events=
"
selected
StageEvents"
:selected-stage=
"selectedStage"
:selected-stage=
"selectedStage"
:stage-count=
"selectedStageCount"
:stage-count=
"selectedStageCount"
:empty-state-message=
"selectedStageError"
:empty-state-message=
"selectedStageError"
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/components/stage_table.vue
View file @
f29fb7e2
...
@@ -269,7 +269,7 @@ export default {
...
@@ -269,7 +269,7 @@ export default {
</
template
>
</
template
>
</gl-table>
</gl-table>
<gl-pagination
<gl-pagination
v-if=
"!isLoading"
v-if=
"!isLoading
&& !isEmptyStage
"
:value=
"pagination.page"
:value=
"pagination.page"
:prev-page=
"prevPage"
:prev-page=
"prevPage"
:next-page=
"nextPage"
:next-page=
"nextPage"
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/store/mutations.js
View file @
f29fb7e2
...
@@ -35,9 +35,11 @@ export default {
...
@@ -35,9 +35,11 @@ export default {
[
types
.
REQUEST_STAGE_DATA
](
state
)
{
[
types
.
REQUEST_STAGE_DATA
](
state
)
{
state
.
isLoadingStage
=
true
;
state
.
isLoadingStage
=
true
;
state
.
selectedStageError
=
''
;
state
.
selectedStageError
=
''
;
state
.
selectedStageEvents
=
[];
state
.
pagination
=
{};
},
},
[
types
.
RECEIVE_STAGE_DATA_SUCCESS
](
state
,
events
=
[])
{
[
types
.
RECEIVE_STAGE_DATA_SUCCESS
](
state
,
events
=
[])
{
state
.
current
StageEvents
=
events
.
map
((
fields
)
=>
state
.
selected
StageEvents
=
events
.
map
((
fields
)
=>
convertObjectPropsToCamelCase
(
fields
,
{
deep
:
true
}),
convertObjectPropsToCamelCase
(
fields
,
{
deep
:
true
}),
);
);
state
.
isLoadingStage
=
false
;
state
.
isLoadingStage
=
false
;
...
@@ -46,6 +48,8 @@ export default {
...
@@ -46,6 +48,8 @@ export default {
[
types
.
RECEIVE_STAGE_DATA_ERROR
](
state
,
message
)
{
[
types
.
RECEIVE_STAGE_DATA_ERROR
](
state
,
message
)
{
state
.
isLoadingStage
=
false
;
state
.
isLoadingStage
=
false
;
state
.
selectedStageError
=
message
;
state
.
selectedStageError
=
message
;
state
.
selectedStageEvents
=
[];
state
.
pagination
=
{};
},
},
[
types
.
REQUEST_STAGE_MEDIANS
](
state
)
{
[
types
.
REQUEST_STAGE_MEDIANS
](
state
)
{
state
.
medians
=
{};
state
.
medians
=
{};
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/store/state.js
View file @
f29fb7e2
...
@@ -17,7 +17,7 @@ export default () => ({
...
@@ -17,7 +17,7 @@ export default () => ({
selectedStage
:
null
,
selectedStage
:
null
,
selectedValueStream
:
null
,
selectedValueStream
:
null
,
current
StageEvents
:
[],
selected
StageEvents
:
[],
isLoadingValueStreams
:
false
,
isLoadingValueStreams
:
false
,
isCreatingValueStream
:
false
,
isCreatingValueStream
:
false
,
...
...
ee/spec/frontend/analytics/cycle_analytics/components/base_spec.js
View file @
f29fb7e2
...
@@ -156,6 +156,9 @@ describe('EE Value Stream Analytics component', () => {
...
@@ -156,6 +156,9 @@ describe('EE Value Stream Analytics component', () => {
return
comp
;
return
comp
;
}
}
const
findPathNavigation
=
()
=>
wrapper
.
findComponent
(
PathNavigation
);
const
findStageTable
=
()
=>
wrapper
.
findComponent
(
StageTable
);
const
displaysProjectsDropdownFilter
=
(
flag
)
=>
{
const
displaysProjectsDropdownFilter
=
(
flag
)
=>
{
expect
(
wrapper
.
findComponent
(
ProjectsDropdownFilter
).
exists
()).
toBe
(
flag
);
expect
(
wrapper
.
findComponent
(
ProjectsDropdownFilter
).
exists
()).
toBe
(
flag
);
};
};
...
@@ -169,7 +172,7 @@ describe('EE Value Stream Analytics component', () => {
...
@@ -169,7 +172,7 @@ describe('EE Value Stream Analytics component', () => {
};
};
const
displaysStageTable
=
(
flag
)
=>
{
const
displaysStageTable
=
(
flag
)
=>
{
expect
(
wrapper
.
findComponent
(
StageTable
).
exists
()).
toBe
(
flag
);
expect
(
findStageTable
(
).
exists
()).
toBe
(
flag
);
};
};
const
displaysDurationChart
=
(
flag
)
=>
{
const
displaysDurationChart
=
(
flag
)
=>
{
...
@@ -180,8 +183,6 @@ describe('EE Value Stream Analytics component', () => {
...
@@ -180,8 +183,6 @@ describe('EE Value Stream Analytics component', () => {
expect
(
wrapper
.
findComponent
(
TypeOfWorkCharts
).
exists
()).
toBe
(
flag
);
expect
(
wrapper
.
findComponent
(
TypeOfWorkCharts
).
exists
()).
toBe
(
flag
);
};
};
const
findPathNavigation
=
()
=>
wrapper
.
findComponent
(
PathNavigation
);
const
displaysPathNavigation
=
(
flag
)
=>
{
const
displaysPathNavigation
=
(
flag
)
=>
{
expect
(
findPathNavigation
().
exists
()).
toBe
(
flag
);
expect
(
findPathNavigation
().
exists
()).
toBe
(
flag
);
};
};
...
@@ -368,7 +369,6 @@ describe('EE Value Stream Analytics component', () => {
...
@@ -368,7 +369,6 @@ describe('EE Value Stream Analytics component', () => {
beforeEach
(
async
()
=>
{
beforeEach
(
async
()
=>
{
mock
=
new
MockAdapter
(
axios
);
mock
=
new
MockAdapter
(
axios
);
mockRequiredRoutes
(
mock
);
mockRequiredRoutes
(
mock
);
wrapper
=
await
createComponent
();
});
});
afterEach
(()
=>
{
afterEach
(()
=>
{
...
@@ -397,7 +397,7 @@ describe('EE Value Stream Analytics component', () => {
...
@@ -397,7 +397,7 @@ describe('EE Value Stream Analytics component', () => {
.
onGet
(
mockData
.
endpoints
.
stageData
)
.
onGet
(
mockData
.
endpoints
.
stageData
)
.
reply
(
httpStatusCodes
.
NOT_FOUND
,
{
response
:
{
status
:
httpStatusCodes
.
NOT_FOUND
}
});
.
reply
(
httpStatusCodes
.
NOT_FOUND
,
{
response
:
{
status
:
httpStatusCodes
.
NOT_FOUND
}
});
await
createComponent
({
selectedStage
:
mockData
.
issueStage
});
wrapper
=
await
createComponent
({
selectedStage
:
mockData
.
issueStage
});
expect
(
createFlash
).
toHaveBeenCalledWith
({
expect
(
createFlash
).
toHaveBeenCalledWith
({
message
:
'
There was an error fetching data for the selected stage
'
,
message
:
'
There was an error fetching data for the selected stage
'
,
...
@@ -410,7 +410,7 @@ describe('EE Value Stream Analytics component', () => {
...
@@ -410,7 +410,7 @@ describe('EE Value Stream Analytics component', () => {
mock
mock
.
onGet
(
mockData
.
endpoints
.
tasksByTypeTopLabelsData
)
.
onGet
(
mockData
.
endpoints
.
tasksByTypeTopLabelsData
)
.
reply
(
httpStatusCodes
.
NOT_FOUND
,
{
response
:
{
status
:
httpStatusCodes
.
NOT_FOUND
}
});
.
reply
(
httpStatusCodes
.
NOT_FOUND
,
{
response
:
{
status
:
httpStatusCodes
.
NOT_FOUND
}
});
await
createComponent
();
wrapper
=
await
createComponent
();
await
waitForPromises
();
await
waitForPromises
();
expect
(
createFlash
).
toHaveBeenCalledWith
({
expect
(
createFlash
).
toHaveBeenCalledWith
({
...
@@ -424,7 +424,7 @@ describe('EE Value Stream Analytics component', () => {
...
@@ -424,7 +424,7 @@ describe('EE Value Stream Analytics component', () => {
mock
mock
.
onGet
(
mockData
.
endpoints
.
tasksByTypeData
)
.
onGet
(
mockData
.
endpoints
.
tasksByTypeData
)
.
reply
(
httpStatusCodes
.
NOT_FOUND
,
{
response
:
{
status
:
httpStatusCodes
.
NOT_FOUND
}
});
.
reply
(
httpStatusCodes
.
NOT_FOUND
,
{
response
:
{
status
:
httpStatusCodes
.
NOT_FOUND
}
});
await
createComponent
();
wrapper
=
await
createComponent
();
await
waitForPromises
();
await
waitForPromises
();
expect
(
createFlash
).
toHaveBeenCalledWith
({
expect
(
createFlash
).
toHaveBeenCalledWith
({
...
@@ -438,13 +438,26 @@ describe('EE Value Stream Analytics component', () => {
...
@@ -438,13 +438,26 @@ describe('EE Value Stream Analytics component', () => {
mock
mock
.
onGet
(
mockData
.
endpoints
.
stageMedian
)
.
onGet
(
mockData
.
endpoints
.
stageMedian
)
.
reply
(
httpStatusCodes
.
NOT_FOUND
,
{
response
:
{
status
:
httpStatusCodes
.
NOT_FOUND
}
});
.
reply
(
httpStatusCodes
.
NOT_FOUND
,
{
response
:
{
status
:
httpStatusCodes
.
NOT_FOUND
}
});
await
createComponent
();
wrapper
=
await
createComponent
();
await
waitForPromises
();
expect
(
createFlash
).
toHaveBeenCalledWith
({
expect
(
createFlash
).
toHaveBeenCalledWith
({
message
:
'
There was an error fetching median data for stages
'
,
message
:
'
There was an error fetching median data for stages
'
,
});
});
});
});
it
(
'
will display an error if the fetchStageData request is successful but has an embedded error
'
,
async
()
=>
{
const
tooMuchDataError
=
'
There is too much data to calculate. Please change your selection.
'
;
mock
.
onGet
(
mockData
.
endpoints
.
stageData
)
.
reply
(
httpStatusCodes
.
OK
,
{
error
:
tooMuchDataError
});
wrapper
=
await
createComponent
({
selectedStage
:
mockData
.
issueStage
});
displaysStageTable
(
true
);
expect
(
findStageTable
().
props
(
'
emptyStateMessage
'
)).
toBe
(
tooMuchDataError
);
expect
(
findStageTable
().
props
(
'
stageEvents
'
)).
toEqual
([]);
expect
(
findStageTable
().
props
(
'
pagination
'
)).
toEqual
({});
});
});
});
describe
(
'
Path navigation
'
,
()
=>
{
describe
(
'
Path navigation
'
,
()
=>
{
...
...
ee/spec/frontend/analytics/cycle_analytics/components/stage_table_spec.js
View file @
f29fb7e2
...
@@ -267,6 +267,10 @@ describe('StageTable', () => {
...
@@ -267,6 +267,10 @@ describe('StageTable', () => {
it
(
'
will display the default no data message
'
,
()
=>
{
it
(
'
will display the default no data message
'
,
()
=>
{
expect
(
wrapper
.
html
()).
toContain
(
notEnoughDataError
);
expect
(
wrapper
.
html
()).
toContain
(
notEnoughDataError
);
});
});
it
(
'
will not display the pagination component
'
,
()
=>
{
expect
(
findPagination
().
exists
()).
toBe
(
false
);
});
});
});
describe
(
'
emptyStateMessage set
'
,
()
=>
{
describe
(
'
emptyStateMessage set
'
,
()
=>
{
...
...
ee/spec/frontend/analytics/cycle_analytics/store/mutations_spec.js
View file @
f29fb7e2
...
@@ -39,7 +39,11 @@ describe('Value Stream Analytics mutations', () => {
...
@@ -39,7 +39,11 @@ describe('Value Stream Analytics mutations', () => {
${
types
.
REQUEST_VALUE_STREAMS
}
|
${
'
isLoadingValueStreams
'
}
|
${
true
}
${
types
.
REQUEST_VALUE_STREAMS
}
|
${
'
isLoadingValueStreams
'
}
|
${
true
}
${
types
.
RECEIVE_VALUE_STREAMS_ERROR
}
|
${
'
isLoadingValueStreams
'
}
|
${
false
}
${
types
.
RECEIVE_VALUE_STREAMS_ERROR
}
|
${
'
isLoadingValueStreams
'
}
|
${
false
}
${
types
.
REQUEST_STAGE_DATA
}
|
${
'
isLoadingStage
'
}
|
${
true
}
${
types
.
REQUEST_STAGE_DATA
}
|
${
'
isLoadingStage
'
}
|
${
true
}
${
types
.
REQUEST_STAGE_DATA
}
|
${
'
selectedStageEvents
'
}
|
${[]}
${
types
.
REQUEST_STAGE_DATA
}
|
${
'
pagination
'
}
|
${{}}
$
{
types
.
RECEIVE_STAGE_DATA_ERROR
}
|
${
'
isLoadingStage
'
}
|
${
false
}
$
{
types
.
RECEIVE_STAGE_DATA_ERROR
}
|
${
'
isLoadingStage
'
}
|
${
false
}
${
types
.
RECEIVE_STAGE_DATA_ERROR
}
|
${
'
selectedStageEvents
'
}
|
${[]}
${
types
.
RECEIVE_STAGE_DATA_ERROR
}
|
${
'
pagination
'
}
|
${{}}
$
{
types
.
REQUEST_VALUE_STREAM_DATA
}
|
${
'
isLoading
'
}
|
${
true
}
$
{
types
.
REQUEST_VALUE_STREAM_DATA
}
|
${
'
isLoading
'
}
|
${
true
}
${
types
.
RECEIVE_GROUP_STAGES_ERROR
}
|
${
'
stages
'
}
|
${[]}
${
types
.
RECEIVE_GROUP_STAGES_ERROR
}
|
${
'
stages
'
}
|
${[]}
${
types
.
REQUEST_GROUP_STAGES
}
|
${
'
stages
'
}
|
${[]}
${
types
.
REQUEST_GROUP_STAGES
}
|
${
'
stages
'
}
|
${[]}
...
...
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