Skip to content

Commit 1e6c0ac

Browse files
added pipline v2 and workflow v2 api
1 parent 904f6e1 commit 1e6c0ac

File tree

2 files changed

+16
-22
lines changed

2 files changed

+16
-22
lines changed

pkg/codefresh/pipeline_v2.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ func (p *pipelineV2) Get(ctx context.Context, name, namespace, runtime string) (
4848
metadata {
4949
name
5050
namespace
51+
runtime
5152
}
5253
self {
5354
healthStatus
55+
syncStatus
5456
version
5557
}
5658
projects
@@ -76,6 +78,10 @@ func (p *pipelineV2) Get(ctx context.Context, name, namespace, runtime string) (
7678
return nil, graphqlErrorResponse{errors: res.Errors}
7779
}
7880

81+
if res.Data.Pipeline.Metadata == nil {
82+
return nil, err
83+
}
84+
7985
return &res.Data.Pipeline, nil
8086
}
8187

@@ -89,9 +95,11 @@ func (p *pipelineV2) List(ctx context.Context, filterArgs model.PipelinesFilterA
8995
metadata {
9096
name
9197
namespace
98+
runtime
9299
}
93100
self {
94101
healthStatus
102+
syncStatus
95103
version
96104
}
97105
projects

pkg/codefresh/workflow_v2.go

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ func (w *workflowV2) Get(ctx context.Context, name, namespace, runtime string) (
4848
metadata {
4949
name
5050
namespace
51+
runtime
5152
}
5253
projects
5354
spec {
@@ -61,9 +62,6 @@ func (w *workflowV2) Get(ctx context.Context, name, namespace, runtime string) (
6162
}
6263
}
6364
status {
64-
createdAt
65-
startedAt
66-
finishedAt
6765
phase
6866
progress {
6967
total
@@ -73,20 +71,13 @@ func (w *workflowV2) Get(ctx context.Context, name, namespace, runtime string) (
7371
type
7472
name
7573
}
76-
message
77-
statuses {
78-
since
79-
phase
80-
message
81-
}
8274
}
8375
pipeline {
8476
metadata {
8577
name
8678
namespace
8779
}
8880
}
89-
actualManifest
9081
}
9182
}`,
9283
"variables": map[string]interface{}{
@@ -106,6 +97,10 @@ func (w *workflowV2) Get(ctx context.Context, name, namespace, runtime string) (
10697
return nil, graphqlErrorResponse{errors: res.Errors}
10798
}
10899

100+
if res.Data.Workflow.Metadata == nil {
101+
return nil, err
102+
}
103+
109104
return &res.Data.Workflow, nil
110105
}
111106

@@ -119,6 +114,7 @@ func (w *workflowV2) List(ctx context.Context, filterArgs model.WorkflowsFilterA
119114
metadata {
120115
name
121116
namespace
117+
runtime
122118
}
123119
projects
124120
spec {
@@ -132,9 +128,6 @@ func (w *workflowV2) List(ctx context.Context, filterArgs model.WorkflowsFilterA
132128
}
133129
}
134130
status {
135-
createdAt
136-
startedAt
137-
finishedAt
138131
phase
139132
progress {
140133
total
@@ -144,20 +137,13 @@ func (w *workflowV2) List(ctx context.Context, filterArgs model.WorkflowsFilterA
144137
type
145138
name
146139
}
147-
message
148-
statuses {
149-
since
150-
phase
151-
message
152-
}
153-
}
140+
}
154141
pipeline {
155142
metadata {
156143
name
157144
namespace
158145
}
159-
}
160-
actualManifest
146+
}
161147
}
162148
}
163149
}

0 commit comments

Comments
 (0)