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
f82a4246
Commit
f82a4246
authored
Oct 25, 2021
by
Payton Burdette
Committed by
Kushal Pandya
Oct 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix endless pipeline status loop when no pipeline was triggered
parent
c7c927c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
2 deletions
+40
-2
app/assets/javascripts/pipeline_editor/components/header/pipeline_status.vue
...pts/pipeline_editor/components/header/pipeline_status.vue
+16
-1
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/frontend/pipeline_editor/components/header/pipeline_status_spec.js
...pipeline_editor/components/header/pipeline_status_spec.js
+21
-1
No files found.
app/assets/javascripts/pipeline_editor/components/header/pipeline_status.vue
View file @
f82a4246
...
@@ -21,6 +21,9 @@ export const i18n = {
...
@@ -21,6 +21,9 @@ export const i18n = {
`Pipeline|Pipeline %{idStart}#%{idEnd} %{statusStart}%{statusEnd} for %{commitStart}%{commitEnd}`
,
`Pipeline|Pipeline %{idStart}#%{idEnd} %{statusStart}%{statusEnd} for %{commitStart}%{commitEnd}`
,
),
),
viewBtn
:
s__
(
'
Pipeline|View pipeline
'
),
viewBtn
:
s__
(
'
Pipeline|View pipeline
'
),
pipelineNotTriggeredMsg
:
s__
(
'
Pipeline|No pipeline was triggered for the latest changes due to the current CI/CD configuration.
'
,
),
};
};
export
default
{
export
default
{
...
@@ -73,16 +76,22 @@ export default {
...
@@ -73,16 +76,22 @@ export default {
result
(
res
)
{
result
(
res
)
{
if
(
res
.
data
?.
project
?.
pipeline
)
{
if
(
res
.
data
?.
project
?.
pipeline
)
{
this
.
hasError
=
false
;
this
.
hasError
=
false
;
}
else
{
this
.
hasError
=
true
;
this
.
pipelineNotTriggered
=
true
;
}
}
},
},
error
()
{
error
()
{
this
.
hasError
=
true
;
this
.
hasError
=
true
;
this
.
networkError
=
true
;
},
},
pollInterval
:
POLL_INTERVAL
,
pollInterval
:
POLL_INTERVAL
,
},
},
},
},
data
()
{
data
()
{
return
{
return
{
networkError
:
false
,
pipelineNotTriggered
:
false
,
hasError
:
false
,
hasError
:
false
,
};
};
},
},
...
@@ -126,10 +135,16 @@ export default {
...
@@ -126,10 +135,16 @@ export default {
</div>
</div>
</
template
>
</
template
>
<
template
v-else-if=
"hasError"
>
<
template
v-else-if=
"hasError"
>
<div>
<div
v-if=
"networkError"
>
<gl-icon
class=
"gl-mr-auto"
name=
"warning-solid"
/>
<gl-icon
class=
"gl-mr-auto"
name=
"warning-solid"
/>
<span
data-testid=
"pipeline-error-msg"
>
{{
$options
.
i18n
.
fetchError
}}
</span>
<span
data-testid=
"pipeline-error-msg"
>
{{
$options
.
i18n
.
fetchError
}}
</span>
</div>
</div>
<div
v-else
>
<gl-icon
class=
"gl-mr-auto"
name=
"information-o"
/>
<span
data-testid=
"pipeline-not-triggered-error-msg"
>
{{
$options
.
i18n
.
pipelineNotTriggeredMsg
}}
</span>
</div>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<div>
<div>
...
...
locale/gitlab.pot
View file @
f82a4246
...
@@ -25369,6 +25369,9 @@ msgstr ""
...
@@ -25369,6 +25369,9 @@ msgstr ""
msgid "Pipeline|Merged result pipeline"
msgid "Pipeline|Merged result pipeline"
msgstr ""
msgstr ""
msgid "Pipeline|No pipeline was triggered for the latest changes due to the current CI/CD configuration."
msgstr ""
msgid "Pipeline|Passed"
msgid "Pipeline|Passed"
msgstr ""
msgstr ""
...
...
spec/frontend/pipeline_editor/components/header/pipeline_status_spec.js
View file @
f82a4246
...
@@ -40,6 +40,8 @@ describe('Pipeline Status', () => {
...
@@ -40,6 +40,8 @@ describe('Pipeline Status', () => {
const
findPipelineId
=
()
=>
wrapper
.
find
(
'
[data-testid="pipeline-id"]
'
);
const
findPipelineId
=
()
=>
wrapper
.
find
(
'
[data-testid="pipeline-id"]
'
);
const
findPipelineCommit
=
()
=>
wrapper
.
find
(
'
[data-testid="pipeline-commit"]
'
);
const
findPipelineCommit
=
()
=>
wrapper
.
find
(
'
[data-testid="pipeline-commit"]
'
);
const
findPipelineErrorMsg
=
()
=>
wrapper
.
find
(
'
[data-testid="pipeline-error-msg"]
'
);
const
findPipelineErrorMsg
=
()
=>
wrapper
.
find
(
'
[data-testid="pipeline-error-msg"]
'
);
const
findPipelineNotTriggeredErrorMsg
=
()
=>
wrapper
.
find
(
'
[data-testid="pipeline-not-triggered-error-msg"]
'
);
const
findPipelineLoadingMsg
=
()
=>
wrapper
.
find
(
'
[data-testid="pipeline-loading-msg"]
'
);
const
findPipelineLoadingMsg
=
()
=>
wrapper
.
find
(
'
[data-testid="pipeline-loading-msg"]
'
);
const
findPipelineViewBtn
=
()
=>
wrapper
.
find
(
'
[data-testid="pipeline-view-btn"]
'
);
const
findPipelineViewBtn
=
()
=>
wrapper
.
find
(
'
[data-testid="pipeline-view-btn"]
'
);
const
findStatusIcon
=
()
=>
wrapper
.
find
(
'
[data-testid="pipeline-status-icon"]
'
);
const
findStatusIcon
=
()
=>
wrapper
.
find
(
'
[data-testid="pipeline-status-icon"]
'
);
...
@@ -117,7 +119,8 @@ describe('Pipeline Status', () => {
...
@@ -117,7 +119,8 @@ describe('Pipeline Status', () => {
await
waitForPromises
();
await
waitForPromises
();
});
});
it
(
'
renders error
'
,
()
=>
{
it
(
'
renders api error
'
,
()
=>
{
expect
(
findPipelineNotTriggeredErrorMsg
().
exists
()).
toBe
(
false
);
expect
(
findIcon
().
attributes
(
'
name
'
)).
toBe
(
'
warning-solid
'
);
expect
(
findIcon
().
attributes
(
'
name
'
)).
toBe
(
'
warning-solid
'
);
expect
(
findPipelineErrorMsg
().
text
()).
toBe
(
i18n
.
fetchError
);
expect
(
findPipelineErrorMsg
().
text
()).
toBe
(
i18n
.
fetchError
);
});
});
...
@@ -129,6 +132,23 @@ describe('Pipeline Status', () => {
...
@@ -129,6 +132,23 @@ describe('Pipeline Status', () => {
expect
(
findPipelineViewBtn
().
exists
()).
toBe
(
false
);
expect
(
findPipelineViewBtn
().
exists
()).
toBe
(
false
);
});
});
});
});
describe
(
'
when pipeline is null
'
,
()
=>
{
beforeEach
(()
=>
{
mockPipelineQuery
.
mockResolvedValue
({
data
:
{
project
:
{
pipeline
:
null
}
},
});
createComponentWithApollo
();
waitForPromises
();
});
it
(
'
renders pipeline not triggered error
'
,
()
=>
{
expect
(
findPipelineErrorMsg
().
exists
()).
toBe
(
false
);
expect
(
findIcon
().
attributes
(
'
name
'
)).
toBe
(
'
information-o
'
);
expect
(
findPipelineNotTriggeredErrorMsg
().
text
()).
toBe
(
i18n
.
pipelineNotTriggeredMsg
);
});
});
});
});
describe
(
'
when feature flag for pipeline mini graph is enabled
'
,
()
=>
{
describe
(
'
when feature flag for pipeline mini graph is enabled
'
,
()
=>
{
...
...
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