Commit 48f6191c authored by Sarah Groff Hennigh-Palermo's avatar Sarah Groff Hennigh-Palermo Committed by Natalia Tepluhina

Update existing query references

Includes components and specs
parent cb8bb478
<script>
import { GlAlert, GlLoadingIcon } from '@gitlab/ui';
import getPipelineDetails from 'shared_queries/pipelines/get_pipeline_details.query.graphql';
import { __ } from '~/locale';
import { DEFAULT, LOAD_FAILURE } from '../../constants';
import getPipelineDetails from '../../graphql/queries/get_pipeline_details.query.graphql';
import PipelineGraph from './graph_component.vue';
import { unwrapPipelineData, toggleQueryPollingByVisibility, reportToSentry } from './utils';
......
<script>
import getPipelineDetails from '../../graphql/queries/get_pipeline_details.query.graphql';
import getPipelineDetails from 'shared_queries/pipelines/get_pipeline_details.query.graphql';
import LinkedPipeline from './linked_pipeline.vue';
import { LOAD_FAILURE } from '../../constants';
import { UPSTREAM } from './constants';
......
fragment LinkedPipelineData on Pipeline {
id
iid
path
status: detailedStatus {
group
label
icon
}
sourceJob {
name
}
project {
name
fullPath
}
}
#import "../fragments/linked_pipelines.fragment.graphql"
fragment LinkedPipelineData on Pipeline {
__typename
id
iid
path
status: detailedStatus {
__typename
group
label
icon
}
sourceJob {
__typename
name
}
project {
__typename
name
fullPath
}
}
query getPipelineDetails($projectPath: ID!, $iid: ID!) {
project(fullPath: $projectPath) {
__typename
pipeline(iid: $iid) {
__typename
id
iid
downstream {
__typename
nodes {
...LinkedPipelineData
}
......@@ -14,18 +37,25 @@ query getPipelineDetails($projectPath: ID!, $iid: ID!) {
...LinkedPipelineData
}
stages {
__typename
nodes {
__typename
name
status: detailedStatus {
__typename
action {
__typename
icon
path
title
}
}
groups {
__typename
nodes {
__typename
status: detailedStatus {
__typename
label
group
icon
......@@ -33,21 +63,27 @@ query getPipelineDetails($projectPath: ID!, $iid: ID!) {
name
size
jobs {
__typename
nodes {
__typename
name
scheduledAt
needs {
__typename
nodes {
__typename
name
}
}
status: detailedStatus {
__typename
icon
tooltip
hasDetails
detailsPath
group
action {
__typename
buttonTitle
icon
path
......
......@@ -6,6 +6,9 @@
- add_page_specific_style 'page_bundles/reports'
- add_page_specific_style 'page_bundles/ci_status'
- if Feature.enabled?(:graphql_pipeline_details, @project)
- add_page_startup_graphql_call('pipelines/get_pipeline_details', { projectPath: @project.full_path, iid: @pipeline.iid })
.js-pipeline-container{ data: { controller_action: "#{controller.action_name}" } }
#js-pipeline-header-vue.pipeline-header-container{ data: { full_path: @project.full_path, pipeline_iid: @pipeline.iid, pipeline_id: @pipeline.id, pipelines_path: project_pipelines_path(@project) } }
- if @pipeline.commit.present?
......
......@@ -3,9 +3,9 @@ import VueApollo from 'vue-apollo';
import { shallowMount } from '@vue/test-utils';
import { GlAlert, GlLoadingIcon } from '@gitlab/ui';
import createMockApollo from 'helpers/mock_apollo_helper';
import getPipelineDetails from 'shared_queries/pipelines/get_pipeline_details.query.graphql';
import PipelineGraphWrapper from '~/pipelines/components/graph/graph_component_wrapper.vue';
import PipelineGraph from '~/pipelines/components/graph/graph_component.vue';
import getPipelineDetails from '~/pipelines/graphql/queries/get_pipeline_details.query.graphql';
import { mockPipelineResponse } from './mock_data';
const defaultProvide = {
......
import VueApollo from 'vue-apollo';
import { mount, shallowMount, createLocalVue } from '@vue/test-utils';
import createMockApollo from 'helpers/mock_apollo_helper';
import getPipelineDetails from 'shared_queries/pipelines/get_pipeline_details.query.graphql';
import PipelineGraph from '~/pipelines/components/graph/graph_component.vue';
import LinkedPipelinesColumn from '~/pipelines/components/graph/linked_pipelines_column.vue';
import LinkedPipeline from '~/pipelines/components/graph/linked_pipeline.vue';
import getPipelineDetails from '~/pipelines/graphql/queries/get_pipeline_details.query.graphql';
import { DOWNSTREAM, GRAPHQL } from '~/pipelines/components/graph/constants';
import { LOAD_FAILURE } from '~/pipelines/constants';
import {
......
......@@ -56,7 +56,7 @@ export const mockPipelineResponse = {
},
},
needs: {
__typename: 'CiJobConnection',
__typename: 'CiBuildNeedConnection',
nodes: [],
},
},
......@@ -96,7 +96,7 @@ export const mockPipelineResponse = {
},
},
needs: {
__typename: 'CiJobConnection',
__typename: 'CiBuildNeedConnection',
nodes: [],
},
},
......@@ -136,7 +136,7 @@ export const mockPipelineResponse = {
},
},
needs: {
__typename: 'CiJobConnection',
__typename: 'CiBuildNeedConnection',
nodes: [],
},
},
......@@ -176,7 +176,7 @@ export const mockPipelineResponse = {
},
},
needs: {
__typename: 'CiJobConnection',
__typename: 'CiBuildNeedConnection',
nodes: [],
},
},
......@@ -200,7 +200,7 @@ export const mockPipelineResponse = {
},
},
needs: {
__typename: 'CiJobConnection',
__typename: 'CiBuildNeedConnection',
nodes: [],
},
},
......@@ -224,7 +224,7 @@ export const mockPipelineResponse = {
},
},
needs: {
__typename: 'CiJobConnection',
__typename: 'CiBuildNeedConnection',
nodes: [],
},
},
......@@ -277,18 +277,18 @@ export const mockPipelineResponse = {
},
},
needs: {
__typename: 'CiJobConnection',
__typename: 'CiBuildNeedConnection',
nodes: [
{
__typename: 'CiJob',
__typename: 'CiBuildNeed',
name: 'build_c',
},
{
__typename: 'CiJob',
__typename: 'CiBuildNeed',
name: 'build_b',
},
{
__typename: 'CiJob',
__typename: 'CiBuildNeed',
name:
'build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl',
},
......@@ -331,26 +331,26 @@ export const mockPipelineResponse = {
},
},
needs: {
__typename: 'CiJobConnection',
__typename: 'CiBuildNeedConnection',
nodes: [
{
__typename: 'CiJob',
__typename: 'CiBuildNeed',
name: 'build_d 3/3',
},
{
__typename: 'CiJob',
__typename: 'CiBuildNeed',
name: 'build_d 2/3',
},
{
__typename: 'CiJob',
__typename: 'CiBuildNeed',
name: 'build_d 1/3',
},
{
__typename: 'CiJob',
__typename: 'CiBuildNeed',
name: 'build_b',
},
{
__typename: 'CiJob',
__typename: 'CiBuildNeed',
name:
'build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl',
},
......@@ -377,26 +377,26 @@ export const mockPipelineResponse = {
},
},
needs: {
__typename: 'CiJobConnection',
__typename: 'CiBuildNeedConnection',
nodes: [
{
__typename: 'CiJob',
__typename: 'CiBuildNeed',
name: 'build_d 3/3',
},
{
__typename: 'CiJob',
__typename: 'CiBuildNeed',
name: 'build_d 2/3',
},
{
__typename: 'CiJob',
__typename: 'CiBuildNeed',
name: 'build_d 1/3',
},
{
__typename: 'CiJob',
__typename: 'CiBuildNeed',
name: 'build_b',
},
{
__typename: 'CiJob',
__typename: 'CiBuildNeed',
name:
'build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl',
},
......@@ -433,18 +433,18 @@ export const mockPipelineResponse = {
action: null,
},
needs: {
__typename: 'CiJobConnection',
__typename: 'CiBuildNeedConnection',
nodes: [
{
__typename: 'CiJob',
__typename: 'CiBuildNeed',
name: 'build_c',
},
{
__typename: 'CiJob',
__typename: 'CiBuildNeed',
name: 'build_b',
},
{
__typename: 'CiJob',
__typename: 'CiBuildNeed',
name:
'build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl',
},
......@@ -481,10 +481,10 @@ export const mockPipelineResponse = {
action: null,
},
needs: {
__typename: 'CiJobConnection',
__typename: 'CiBuildNeedConnection',
nodes: [
{
__typename: 'CiJob',
__typename: 'CiBuildNeed',
name: 'build_b',
},
],
......@@ -578,41 +578,54 @@ export const upstream = {
export const wrappedPipelineReturn = {
data: {
project: {
__typename: 'Project',
pipeline: {
__typename: 'Pipeline',
id: 'gid://gitlab/Ci::Pipeline/175',
iid: '38',
downstream: {
__typename: 'PipelineConnection',
nodes: [],
},
upstream: {
id: 'gid://gitlab/Ci::Pipeline/174',
iid: '37',
path: '/root/elemenohpee/-/pipelines/174',
__typename: 'Pipeline',
status: {
__typename: 'DetailedStatus',
group: 'success',
label: 'passed',
icon: 'status_success',
},
sourceJob: {
name: 'test_c',
__typename: 'CiJob',
},
project: {
id: 'gid://gitlab/Project/25',
name: 'elemenohpee',
fullPath: 'root/elemenohpee',
__typename: 'Project',
},
},
stages: {
__typename: 'CiStageConnection',
nodes: [
{
name: 'build',
__typename: 'CiStage',
status: {
action: null,
__typename: 'DetailedStatus',
},
groups: {
__typename: 'CiGroupConnection',
nodes: [
{
__typename: 'CiGroup',
status: {
__typename: 'DetailedStatus',
label: 'passed',
group: 'success',
icon: 'status_success',
......@@ -620,20 +633,25 @@ export const wrappedPipelineReturn = {
name: 'build_n',
size: 1,
jobs: {
__typename: 'CiJobConnection',
nodes: [
{
__typename: 'CiJob',
name: 'build_n',
scheduledAt: null,
needs: {
__typename: 'CiBuildNeedConnection',
nodes: [],
},
status: {
__typename: 'DetailedStatus',
icon: 'status_success',
tooltip: 'passed',
hasDetails: true,
detailsPath: '/root/elemenohpee/-/jobs/1662',
group: 'success',
action: {
__typename: 'StatusAction',
buttonTitle: 'Retry this job',
icon: 'retry',
path: '/root/elemenohpee/-/jobs/1662/retry',
......
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