Commit e8ae7766 authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch '325693-still-looking' into 'master'

New pipeline bug: add check and update tests that failed check

See merge request gitlab-org/gitlab!57581
parents 762b9ae0 e0f37b4b
...@@ -97,6 +97,23 @@ export default { ...@@ -97,6 +97,23 @@ export default {
isFadedOut(jobName) { isFadedOut(jobName) {
return this.highlightedJobs.length > 1 && !this.highlightedJobs.includes(jobName); return this.highlightedJobs.length > 1 && !this.highlightedJobs.includes(jobName);
}, },
isParallel(group) {
return group.size > 1 && group.jobs.length > 1;
},
singleJobExists(group) {
const firstJobDefined = Boolean(group.jobs?.[0]);
if (!firstJobDefined) {
const currentGroup = this.groups.find((element) => element.name === group.name);
const serializedGroup = Object.entries(currentGroup).join(' ');
reportToSentry(
'stage_column_component',
`undefined_job_hunt, serialized group: ${serializedGroup}`,
);
}
return group.size === 1 && firstJobDefined;
},
}, },
}; };
</script> </script>
...@@ -130,7 +147,7 @@ export default { ...@@ -130,7 +147,7 @@ export default {
@mouseleave="$emit('jobHover', '')" @mouseleave="$emit('jobHover', '')"
> >
<job-item <job-item
v-if="group.size === 1" v-if="singleJobExists(group)"
:job="group.jobs[0]" :job="group.jobs[0]"
:job-hovered="jobHovered" :job-hovered="jobHovered"
:pipeline-expanded="pipelineExpanded" :pipeline-expanded="pipelineExpanded"
...@@ -139,7 +156,7 @@ export default { ...@@ -139,7 +156,7 @@ export default {
:class="{ 'gl-opacity-3': isFadedOut(group.name) }" :class="{ 'gl-opacity-3': isFadedOut(group.name) }"
@pipelineActionRequestComplete="$emit('refreshPipelineGraph')" @pipelineActionRequestComplete="$emit('refreshPipelineGraph')"
/> />
<div v-else :class="{ 'gl-opacity-3': isFadedOut(group.name) }"> <div v-else-if="isParallel(group)" :class="{ 'gl-opacity-3': isFadedOut(group.name) }">
<job-group-dropdown :group="group" :pipeline-id="pipelineId" /> <job-group-dropdown :group="group" :pipeline-id="pipelineId" />
</div> </div>
</div> </div>
......
...@@ -24,7 +24,7 @@ const mockJob = { ...@@ -24,7 +24,7 @@ const mockJob = {
const mockGroups = Array(4) const mockGroups = Array(4)
.fill(0) .fill(0)
.map((item, idx) => { .map((item, idx) => {
return { ...mockJob, id: idx, name: `fish-${idx}` }; return { ...mockJob, jobs: [mockJob], id: idx, name: `fish-${idx}` };
}); });
const defaultProps = { const defaultProps = {
...@@ -103,6 +103,10 @@ describe('stage column component', () => { ...@@ -103,6 +103,10 @@ describe('stage column component', () => {
method: mount, method: mount,
props: { props: {
groups: [ groups: [
{
...mockJob,
name: '<img src=x onerror=alert(document.domain)>',
jobs: [
{ {
id: 4259, id: 4259,
name: '<img src=x onerror=alert(document.domain)>', name: '<img src=x onerror=alert(document.domain)>',
...@@ -113,6 +117,8 @@ describe('stage column component', () => { ...@@ -113,6 +117,8 @@ describe('stage column component', () => {
}, },
}, },
], ],
},
],
title: 'test <img src=x onerror=alert(document.domain)>', title: 'test <img src=x onerror=alert(document.domain)>',
}, },
}); });
...@@ -159,6 +165,7 @@ describe('stage column component', () => { ...@@ -159,6 +165,7 @@ describe('stage column component', () => {
label: 'success', label: 'success',
tooltip: '<img src=x onerror=alert(document.domain)>', tooltip: '<img src=x onerror=alert(document.domain)>',
}, },
jobs: [mockJob],
}, },
], ],
title: 'test', title: 'test',
...@@ -191,6 +198,7 @@ describe('stage column component', () => { ...@@ -191,6 +198,7 @@ describe('stage column component', () => {
label: 'success', label: 'success',
tooltip: '<img src=x onerror=alert(document.domain)>', tooltip: '<img src=x onerror=alert(document.domain)>',
}, },
jobs: [mockJob],
}, },
], ],
title: 'test', title: 'test',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment