Skip to content

Commit

Permalink
use sdp-go v0.103.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tphoney committed Dec 17, 2024
1 parent 93ebabe commit fa9a718
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
16 changes: 8 additions & 8 deletions cmd/changes_get_change.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ fetch:
}
}

if riskRes.Msg.GetChangeRiskMetadata().GetChangeAnalysisStatus().GetStatus() == sdp.ChangeAnalysisStatus_STATUS_INPROGRESS {
if riskRes.Msg.GetGetChangeAnalysisStatus().GetChangeAnalysisStatus().GetStatus() == sdp.ChangeAnalysisStatus_STATUS_INPROGRESS {

Check failure on line 105 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / Run Tests

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 105 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / dry-run

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 105 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / lint

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 105 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / actions

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 105 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / interactive

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)
// Extract the currently running milestone if you can
milestones := riskRes.Msg.GetChangeRiskMetadata().GetChangeAnalysisStatus().GetProgressMilestones()
milestones := riskRes.Msg.GetGetChangeAnalysisStatus().GetChangeAnalysisStatus().GetProgressMilestones()

Check failure on line 107 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / Run Tests

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 107 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / dry-run

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 107 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / lint

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 107 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / actions

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 107 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / interactive

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)
var currentMilestone string
for _, milestone := range milestones {
if milestone == nil {
Expand All @@ -117,7 +117,7 @@ fetch:
}

log.WithContext(ctx).WithFields(log.Fields{
"status": riskRes.Msg.GetChangeRiskMetadata().GetChangeAnalysisStatus().GetStatus().String(),
"status": riskRes.Msg.GetGetChangeAnalysisStatus().GetChangeAnalysisStatus().GetStatus().String(),

Check failure on line 120 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / Run Tests

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 120 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / dry-run

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 120 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / lint

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 120 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / actions

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 120 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / interactive

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)
"milestone": currentMilestone,
}).Info("Waiting for risk calculation")

Expand Down Expand Up @@ -163,7 +163,7 @@ fetch:
"risk-levels": renderRiskFilter(riskLevels),
}).Info("filtering risks")

md := riskRes.Msg.GetChangeRiskMetadata()
md := riskRes.Msg.GetGetChangeAnalysisStatus()

Check failure on line 166 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / Run Tests

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 166 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / dry-run

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 166 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / lint

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 166 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / actions

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 166 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / interactive

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)
if md != nil {
md.Risks = filterRisks(md.GetRisks(), riskLevels)
}
Expand All @@ -172,11 +172,11 @@ fetch:
switch viper.GetString("format") {
case "json":
jsonStruct := struct {
Change *sdp.Change `json:"change"`
RiskMetadata *sdp.ChangeRiskMetadata `json:"risk_metadata"`
Change *sdp.Change `json:"change"`
RiskMetadata *sdp.GetChangeAnalysisStatus `json:"risk_metadata"`

Check failure on line 176 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / Run Tests

undefined: sdp.GetChangeAnalysisStatus

Check failure on line 176 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / dry-run

undefined: sdp.GetChangeAnalysisStatus

Check failure on line 176 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / lint

undefined: sdp.GetChangeAnalysisStatus

Check failure on line 176 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / actions

undefined: sdp.GetChangeAnalysisStatus

Check failure on line 176 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / interactive

undefined: sdp.GetChangeAnalysisStatus
}{
Change: changeRes.Msg.GetChange(),
RiskMetadata: riskRes.Msg.GetChangeRiskMetadata(),
RiskMetadata: riskRes.Msg.GetGetChangeAnalysisStatus(),

Check failure on line 179 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / Run Tests

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 179 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / dry-run

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 179 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / lint

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 179 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / actions

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 179 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / interactive

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)
}

b, err := json.MarshalIndent(jsonStruct, "", " ")
Expand Down Expand Up @@ -325,7 +325,7 @@ fetch:
}
}

for _, risk := range riskRes.Msg.GetChangeRiskMetadata().GetRisks() {
for _, risk := range riskRes.Msg.GetGetChangeAnalysisStatus().GetRisks() {

Check failure on line 328 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / Run Tests

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 328 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / dry-run

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 328 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / lint

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 328 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / actions

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 328 in cmd/changes_get_change.go

View workflow job for this annotation

GitHub Actions / interactive

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)
data.Risks = append(data.Risks, TemplateRisk{
SeverityAlt: severity[risk.GetSeverity()].SeverityAlt,
SeverityIcon: severity[risk.GetSeverity()].SeverityIcon,
Expand Down
8 changes: 4 additions & 4 deletions cmd/terraform_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ func TerraformPlanImpl(ctx context.Context, cmd *cobra.Command, oi sdp.OvermindI
return nil
}

for i, ms := range riskRes.Msg.GetChangeRiskMetadata().GetChangeAnalysisStatus().GetProgressMilestones() {
for i, ms := range riskRes.Msg.GetGetChangeAnalysisStatus().GetChangeAnalysisStatus().GetProgressMilestones() {

Check failure on line 399 in cmd/terraform_plan.go

View workflow job for this annotation

GitHub Actions / Run Tests

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 399 in cmd/terraform_plan.go

View workflow job for this annotation

GitHub Actions / dry-run

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 399 in cmd/terraform_plan.go

View workflow job for this annotation

GitHub Actions / lint

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 399 in cmd/terraform_plan.go

View workflow job for this annotation

GitHub Actions / actions

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 399 in cmd/terraform_plan.go

View workflow job for this annotation

GitHub Actions / interactive

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)
if i <= len(milestoneSpinners) {
new := pterm.DefaultSpinner.
WithWriter(multi.NewWriter()).
Expand All @@ -421,7 +421,7 @@ func TerraformPlanImpl(ctx context.Context, cmd *cobra.Command, oi sdp.OvermindI
}
}

status := riskRes.Msg.GetChangeRiskMetadata().GetChangeAnalysisStatus().GetStatus()
status := riskRes.Msg.GetGetChangeAnalysisStatus().GetChangeAnalysisStatus().GetStatus()

Check failure on line 424 in cmd/terraform_plan.go

View workflow job for this annotation

GitHub Actions / Run Tests

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 424 in cmd/terraform_plan.go

View workflow job for this annotation

GitHub Actions / dry-run

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 424 in cmd/terraform_plan.go

View workflow job for this annotation

GitHub Actions / lint

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 424 in cmd/terraform_plan.go

View workflow job for this annotation

GitHub Actions / actions

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 424 in cmd/terraform_plan.go

View workflow job for this annotation

GitHub Actions / interactive

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)
if status == sdp.ChangeAnalysisStatus_STATUS_UNSPECIFIED || status == sdp.ChangeAnalysisStatus_STATUS_INPROGRESS {
if !riskSpinner.IsActive {
// restart after a Fail()
Expand All @@ -443,7 +443,7 @@ func TerraformPlanImpl(ctx context.Context, cmd *cobra.Command, oi sdp.OvermindI
// Submit milestone for tracing
if cmdSpan != nil {
cmdSpan.AddEvent("Risk calculation finished", trace.WithAttributes(
attribute.Int("ovm.risks.count", len(riskRes.Msg.GetChangeRiskMetadata().GetRisks())),
attribute.Int("ovm.risks.count", len(riskRes.Msg.GetGetChangeAnalysisStatus().GetRisks())),

Check failure on line 446 in cmd/terraform_plan.go

View workflow job for this annotation

GitHub Actions / Run Tests

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 446 in cmd/terraform_plan.go

View workflow job for this annotation

GitHub Actions / dry-run

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 446 in cmd/terraform_plan.go

View workflow job for this annotation

GitHub Actions / actions

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)

Check failure on line 446 in cmd/terraform_plan.go

View workflow job for this annotation

GitHub Actions / interactive

riskRes.Msg.GetGetChangeAnalysisStatus undefined (type *sdp.GetChangeRisksResponse has no field or method GetGetChangeAnalysisStatus)
attribute.String("ovm.change.uuid", changeUuid.String()),
))
}
Expand All @@ -454,7 +454,7 @@ func TerraformPlanImpl(ctx context.Context, cmd *cobra.Command, oi sdp.OvermindI
bits = append(bits, fmt.Sprintf("\nItems: %v\nEdges: %v\n", blastRadiusItems, blastRadiusEdges))
}

risks := riskRes.Msg.GetChangeRiskMetadata().GetRisks()
risks := riskRes.Msg.GetGetChangeAnalysisStatus().GetRisks()
bits = append(bits, "")
bits = append(bits, "")
if len(risks) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
github.com/overmindtech/discovery v0.33.4
github.com/overmindtech/k8s-source v0.9.1
github.com/overmindtech/pterm v0.0.0-20240919144758-04d94ccb2297
github.com/overmindtech/sdp-go v0.102.5-0.20241216105318-a0af4432d4b2
github.com/overmindtech/sdp-go v0.103.0
github.com/overmindtech/stdlib-source v0.0.0-20241211162909-1bb8eb048964
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
github.com/sirupsen/logrus v1.9.3
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ github.com/overmindtech/sdp-go v0.102.5-0.20241216101827-31ab7b07f9d8 h1:7V7SYUv
github.com/overmindtech/sdp-go v0.102.5-0.20241216101827-31ab7b07f9d8/go.mod h1:Lx2DtTLaroGuVTq5CL1SBT19zzudhLF6jdRkwXDJXRk=
github.com/overmindtech/sdp-go v0.102.5-0.20241216105318-a0af4432d4b2 h1:dyCFaDLLf+wOCYgirtOepWHspDDzQyWBCddEUyhAEjg=
github.com/overmindtech/sdp-go v0.102.5-0.20241216105318-a0af4432d4b2/go.mod h1:Lx2DtTLaroGuVTq5CL1SBT19zzudhLF6jdRkwXDJXRk=
github.com/overmindtech/sdp-go v0.103.0 h1:MVOYYrP7kdma8Zd6Ol1jX9KHnpe8ZJGlLqm224+Nt/4=
github.com/overmindtech/sdp-go v0.103.0/go.mod h1:Lx2DtTLaroGuVTq5CL1SBT19zzudhLF6jdRkwXDJXRk=
github.com/overmindtech/sdpcache v1.6.4 h1:MJoYBDqDE3s8FrRzZ0RPgFiH39HWI/Mv2ImH1NdLT8k=
github.com/overmindtech/sdpcache v1.6.4/go.mod h1:/F9XStVdntRJEQjlZ86BPuB1Y7VPo1PFcsCNiU1IoGE=
github.com/overmindtech/stdlib-source v0.0.0-20241211162909-1bb8eb048964 h1:StLQfDPOlAHecZtIItkHiYO3ZArKrP1dv3t2Z/n4N1U=
Expand Down

0 comments on commit fa9a718

Please sign in to comment.