Commit 62021a35 authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch '276949-undefined-job-bug' into 'master'

Attempt fix for undefined job bug [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!57142
parents 4073b15a 2b402631
......@@ -50,6 +50,10 @@ export default {
};
},
update(data) {
if (!data?.project?.pipeline) {
return this.graphData;
}
const {
stages: { nodes: stages },
} = data.project.pipeline;
......
<script>
import { capitalize, escape, isEmpty } from 'lodash';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import MainGraphWrapper from '../graph_shared/main_graph_wrapper.vue';
import { accessValue } from './accessors';
import ActionComponent from './action_component.vue';
......@@ -15,6 +16,7 @@ export default {
JobItem,
MainGraphWrapper,
},
mixins: [glFeatureFlagMixin()],
props: {
groups: {
type: Array,
......@@ -57,6 +59,21 @@ export default {
'gl-pl-3',
],
computed: {
/*
currentGroups and filteredGroups are part of
a test to hunt down a bug
(see: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57142).
They should be removed when the bug is rectified.
*/
currentGroups() {
return this.glFeatures.pipelineFilterJobs ? this.filteredGroups : this.groups;
},
filteredGroups() {
return this.groups.map((group) => {
return { ...group, jobs: group.jobs.filter(Boolean) };
});
},
formattedTitle() {
return capitalize(escape(this.title));
},
......@@ -104,7 +121,7 @@ export default {
</template>
<template #jobs>
<div
v-for="group in groups"
v-for="group in currentGroups"
:id="groupId(group)"
:key="getGroupId(group)"
data-testid="stage-column-group"
......
......@@ -9,7 +9,7 @@ const unwrapGroups = (stages) => {
const unwrapNodesWithName = (jobArray, prop, field = 'name') => {
return jobArray.map((job) => {
return { ...job, [prop]: job[prop].nodes.map((item) => item[field]) };
return { ...job, [prop]: job[prop].nodes.map((item) => item[field] || '') };
});
};
......
......@@ -15,6 +15,7 @@ class Projects::PipelinesController < Projects::ApplicationController
before_action do
push_frontend_feature_flag(:new_pipeline_form, project, default_enabled: :yaml)
push_frontend_feature_flag(:pipeline_graph_layers_view, project, type: :development, default_enabled: :yaml)
push_frontend_feature_flag(:pipeline_filter_jobs, project, default_enabled: :yaml)
push_frontend_feature_flag(:graphql_pipeline_details, project, type: :development, default_enabled: :yaml)
push_frontend_feature_flag(:graphql_pipeline_details_users, current_user, type: :development, default_enabled: :yaml)
push_frontend_feature_flag(:jira_for_vulnerabilities, project, type: :development, default_enabled: :yaml)
......
---
name: pipeline_filter_jobs
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57142
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/325693
milestone: '13.11'
type: development
group: group::pipeline authoring
default_enabled: false
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