Skip to content

Commit f88141a

Browse files
Integration with updated go-sdk (#206)
1 parent 4d14928 commit f88141a

File tree

7 files changed

+35
-35
lines changed

7 files changed

+35
-35
lines changed

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ require (
1919
github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249
2020
github.com/oklog/run v1.1.0
2121
github.com/panta/machineid v1.0.2
22-
github.com/signadot/go-sdk v0.3.8-0.20250730210632-13a6fc0827df
22+
github.com/signadot/go-sdk v0.3.8-0.20250828202325-847d6b735fc1
2323
github.com/signadot/libconnect v0.1.1-0.20250814203329-98381c7863de
2424
github.com/spf13/cobra v1.8.1
2525
github.com/spf13/viper v1.11.0
@@ -82,8 +82,8 @@ require (
8282
github.com/go-logr/logr v1.4.3 // indirect
8383
github.com/go-logr/stdr v1.2.2 // indirect
8484
github.com/go-openapi/analysis v0.23.0 // indirect
85-
github.com/go-openapi/errors v0.22.1 // indirect
86-
github.com/go-openapi/jsonpointer v0.21.1 // indirect
85+
github.com/go-openapi/errors v0.22.2 // indirect
86+
github.com/go-openapi/jsonpointer v0.21.2 // indirect
8787
github.com/go-openapi/jsonreference v0.21.0 // indirect
8888
github.com/go-openapi/loads v0.22.0 // indirect
8989
github.com/go-openapi/spec v0.21.0 // indirect

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
134134
github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg=
135135
github.com/go-openapi/analysis v0.23.0 h1:aGday7OWupfMs+LbmLZG4k0MYXIANxcuBTYUC03zFCU=
136136
github.com/go-openapi/analysis v0.23.0/go.mod h1:9mz9ZWaSlV8TvjQHLl2mUW2PbZtemkE8yA5v22ohupo=
137-
github.com/go-openapi/errors v0.22.1 h1:kslMRRnK7NCb/CvR1q1VWuEQCEIsBGn5GgKD9e+HYhU=
138-
github.com/go-openapi/errors v0.22.1/go.mod h1:+n/5UdIqdVnLIJ6Q9Se8HNGUXYaY6CN8ImWzfi/Gzp0=
139-
github.com/go-openapi/jsonpointer v0.21.1 h1:whnzv/pNXtK2FbX/W9yJfRmE2gsmkfahjMKB0fZvcic=
140-
github.com/go-openapi/jsonpointer v0.21.1/go.mod h1:50I1STOfbY1ycR8jGz8DaMeLCdXiI6aDteEdRNNzpdk=
137+
github.com/go-openapi/errors v0.22.2 h1:rdxhzcBUazEcGccKqbY1Y7NS8FDcMyIRr0934jrYnZg=
138+
github.com/go-openapi/errors v0.22.2/go.mod h1:+n/5UdIqdVnLIJ6Q9Se8HNGUXYaY6CN8ImWzfi/Gzp0=
139+
github.com/go-openapi/jsonpointer v0.21.2 h1:AqQaNADVwq/VnkCmQg6ogE+M3FOsKTytwges0JdwVuA=
140+
github.com/go-openapi/jsonpointer v0.21.2/go.mod h1:50I1STOfbY1ycR8jGz8DaMeLCdXiI6aDteEdRNNzpdk=
141141
github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
142142
github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
143143
github.com/go-openapi/loads v0.22.0 h1:ECPGd4jX1U6NApCGG1We+uEozOAvXvJSF4nnwHZ8Aco=
@@ -354,8 +354,8 @@ github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7
354354
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
355355
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
356356
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
357-
github.com/signadot/go-sdk v0.3.8-0.20250730210632-13a6fc0827df h1:3Ii88OxvhZFzNru0tAziGti2XBtwrQqChzcCKKigbjU=
358-
github.com/signadot/go-sdk v0.3.8-0.20250730210632-13a6fc0827df/go.mod h1:oX12C9I/8QaXcl9XLIrc6bUOYVCOGrYPExe+Sln/3IY=
357+
github.com/signadot/go-sdk v0.3.8-0.20250828202325-847d6b735fc1 h1:nq8WXCqtlN8J615VVwdotSM0493W3EEr1VHOucDf5Rc=
358+
github.com/signadot/go-sdk v0.3.8-0.20250828202325-847d6b735fc1/go.mod h1:qgQQHdnLzfDIWJwTvVCfBr5hfPC6pgl/N8yiAMozQLc=
359359
github.com/signadot/libconnect v0.1.1-0.20250814203329-98381c7863de h1:nSClpbMu2p7aJMFDSNiEtwYXY4RqoToE+wsHiP0tK9M=
360360
github.com/signadot/libconnect v0.1.1-0.20250814203329-98381c7863de/go.mod h1:slkLIQlZTXajyc16CmuA2s4E2dcfYpykp9dBYn2Z8Do=
361361
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=

internal/command/jobs/printers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func printJobTable(cfg *config.JobList, out io.Writer, jobs []*models.Job) error
7474
Environment: environment,
7575
StartedAt: createdAt,
7676
Duration: duration,
77-
Status: job.Status.Attempts[0].Phase,
77+
Status: string(job.Status.Attempts[0].Phase),
7878
CreatedAt: getCreatedAt(job),
7979
})
8080
}

internal/command/jobs/utils.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ func getArtifacts(cfg *config.JobGet, job *models.Job) ([]*models.JobArtifact, e
3535
return resp.Payload, nil
3636
}
3737

38-
func isJobPhaseToPrintDefault(ph string) bool {
39-
if ph == "failed" {
38+
func isJobPhaseToPrintDefault(ph models.JobsPhase) bool {
39+
if ph == models.JobsPhaseFailed {
4040
return false
4141
}
42-
if ph == "succeeded" {
42+
if ph == models.JobsPhaseSucceeded {
4343
return false
4444
}
45-
if ph == "canceled" {
45+
if ph == models.JobsPhaseCanceled {
4646
return false
4747
}
4848
return true
@@ -102,15 +102,15 @@ func getJobEnvironment(job *models.Job) string {
102102

103103
func getJobStatus(job *models.Job) string {
104104
switch job.Status.Attempts[0].Phase {
105-
case "queued":
105+
case models.JobsPhaseQueued:
106106
return "Queued"
107-
case "running":
107+
case models.JobsPhaseRunning:
108108
return "Running"
109-
case "failed":
109+
case models.JobsPhaseFailed:
110110
return "Failed"
111-
case "succeeded":
111+
case models.JobsPhaseSucceeded:
112112
return "Succeeded"
113-
case "canceled":
113+
case models.JobsPhaseCanceled:
114114
return "Canceled"
115115
}
116116
return "Unknown"

internal/command/routegroup/printers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ type endpointRow struct {
125125
URL string `sdtab:"URL"`
126126
}
127127

128-
func printEndpointTable(out io.Writer, endpoints []*models.RouteGroupEndpoint) error {
128+
func printEndpointTable(out io.Writer, endpoints []*models.RoutegroupsEndpointURL) error {
129129
t := sdtab.New[endpointRow](out)
130130
t.AddHeader()
131131
for _, ep := range endpoints {

internal/command/smarttest/printers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func printTestExecutionsTable(w io.Writer, txs []*models.TestexecutionsQueryResu
153153
Environment: environment,
154154
CreatedAt: createdAt,
155155
Duration: duration,
156-
Status: tx.Status.Phase,
156+
Status: string(tx.Status.Phase),
157157
})
158158
}
159159
return tab.Flush()

internal/command/smarttest/run_output.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,24 +88,24 @@ func (o *defaultRunOutput) renderTestXsTable(txs []*models.TestExecution, runnin
8888
for _, tx := range txs {
8989
var icon, statusText string
9090
switch tx.Status.Phase {
91-
case "pending":
91+
case models.TestexecutionsPhasePending:
9292
icon = runningIcon
9393
statusText = "pending"
94-
case "in_progress":
94+
case models.TestexecutionsPhaseInProgress:
9595
icon = runningIcon
9696
statusText = "running"
97-
case "failed":
97+
case models.TestexecutionsPhaseFailed:
9898
icon = "❌"
9999
statusText = "failed"
100-
case "canceled":
100+
case models.TestexecutionsPhaseCanceled:
101101
icon = "❌"
102102
statusText = "canceled"
103-
case "succeeded":
103+
case models.TestexecutionsPhaseSucceeded:
104104
icon = "✅"
105105
statusText = "completed"
106106
default:
107107
icon = "⚪"
108-
statusText = tx.Status.Phase
108+
statusText = string(tx.Status.Phase)
109109
}
110110
fmt.Fprintf(tw, "%s\t%s\t[ID: %s, STATUS: %s]\n", icon, truncateTestName(tx.Spec.External.TestName, 48),
111111
tx.ID, statusText)
@@ -137,31 +137,31 @@ func (o *defaultRunOutput) renderTestXsSummary(txs []*models.TestExecution) {
137137

138138
func (o *defaultRunOutput) getExecutionsDetails(txs []*models.TestExecution) string {
139139
total := 0
140-
phaseMap := map[string]int{}
140+
phaseMap := map[models.TestexecutionsPhase]int{}
141141
for _, tx := range txs {
142142
total += 1
143143
phaseMap[tx.Status.Phase] += 1
144144
}
145145

146146
var icon string
147147
switch {
148-
case phaseMap["canceled"] > 0 || phaseMap["failed"] > 0:
148+
case phaseMap[models.TestexecutionsPhaseCanceled] > 0 || phaseMap[models.TestexecutionsPhaseFailed] > 0:
149149
icon = "❌"
150150
default:
151151
icon = "✅"
152152
}
153153

154-
details := fmt.Sprintf("%s %d/%d tests completed", icon, phaseMap["succeeded"], total)
155-
if phaseMap["succeeded"] != total {
154+
details := fmt.Sprintf("%s %d/%d tests completed", icon, phaseMap[models.TestexecutionsPhaseSucceeded], total)
155+
if phaseMap[models.TestexecutionsPhaseSucceeded] != total {
156156
details += " ("
157157
var otherSts []string
158-
if phaseMap["canceled"] > 0 {
158+
if phaseMap[models.TestexecutionsPhaseCanceled] > 0 {
159159
otherSts = append(otherSts,
160-
fmt.Sprintf("%d canceled", phaseMap["canceled"]))
160+
fmt.Sprintf("%d canceled", phaseMap[models.TestexecutionsPhaseCanceled]))
161161
}
162-
if phaseMap["failed"] > 0 {
162+
if phaseMap[models.TestexecutionsPhaseFailed] > 0 {
163163
otherSts = append(otherSts,
164-
fmt.Sprintf("%d failed", phaseMap["failed"]))
164+
fmt.Sprintf("%d failed", phaseMap[models.TestexecutionsPhaseFailed]))
165165
}
166166
details += strings.Join(otherSts, ", ") + ")"
167167
}

0 commit comments

Comments
 (0)