diff --git a/cmd/changes_get_change.go b/cmd/changes_get_change.go index 6b48ab4..13e392a 100644 --- a/cmd/changes_get_change.go +++ b/cmd/changes_get_change.go @@ -102,22 +102,22 @@ fetch: } } - if riskRes.Msg.GetChangeRiskMetadata().GetRiskCalculationStatus().GetStatus() == sdp.RiskCalculationStatus_STATUS_INPROGRESS { + if riskRes.Msg.GetChangeRiskMetadata().GetChangeAnalysisStatus().GetStatus() == sdp.ChangeAnalysisStatus_STATUS_INPROGRESS { // Extract the currently running milestone if you can - milestones := riskRes.Msg.GetChangeRiskMetadata().GetRiskCalculationStatus().GetProgressMilestones() + milestones := riskRes.Msg.GetChangeRiskMetadata().GetChangeAnalysisStatus().GetProgressMilestones() var currentMilestone string for _, milestone := range milestones { if milestone == nil { continue } - if milestone.GetStatus() == sdp.RiskCalculationStatus_ProgressMilestone_STATUS_INPROGRESS { + if milestone.GetStatus() == sdp.ChangeAnalysisStatus_ProgressMilestone_STATUS_INPROGRESS { currentMilestone = milestone.GetDescription() } } log.WithContext(ctx).WithFields(log.Fields{ - "status": riskRes.Msg.GetChangeRiskMetadata().GetRiskCalculationStatus().GetStatus().String(), + "status": riskRes.Msg.GetChangeRiskMetadata().GetChangeAnalysisStatus().GetStatus().String(), "milestone": currentMilestone, }).Info("Waiting for risk calculation") diff --git a/cmd/terraform_plan.go b/cmd/terraform_plan.go index 2869d57..ff72bf0 100644 --- a/cmd/terraform_plan.go +++ b/cmd/terraform_plan.go @@ -387,7 +387,7 @@ func TerraformPlanImpl(ctx context.Context, cmd *cobra.Command, oi sdp.OvermindI return nil } - for i, ms := range riskRes.Msg.GetChangeRiskMetadata().GetRiskCalculationStatus().GetProgressMilestones() { + for i, ms := range riskRes.Msg.GetChangeRiskMetadata().GetChangeAnalysisStatus().GetProgressMilestones() { if i <= len(milestoneSpinners) { new := pterm.DefaultSpinner. WithWriter(multi.NewWriter()). @@ -397,23 +397,23 @@ func TerraformPlanImpl(ctx context.Context, cmd *cobra.Command, oi sdp.OvermindI } switch ms.GetStatus() { - case sdp.RiskCalculationStatus_ProgressMilestone_STATUS_PENDING: + case sdp.ChangeAnalysisStatus_ProgressMilestone_STATUS_PENDING: continue - case sdp.RiskCalculationStatus_ProgressMilestone_STATUS_INPROGRESS: + case sdp.ChangeAnalysisStatus_ProgressMilestone_STATUS_INPROGRESS: if !milestoneSpinners[i].IsActive { milestoneSpinners[i], _ = milestoneSpinners[i].Start() } - case sdp.RiskCalculationStatus_ProgressMilestone_STATUS_ERROR: + case sdp.ChangeAnalysisStatus_ProgressMilestone_STATUS_ERROR: milestoneSpinners[i].Fail() - case sdp.RiskCalculationStatus_ProgressMilestone_STATUS_DONE: + case sdp.ChangeAnalysisStatus_ProgressMilestone_STATUS_DONE: milestoneSpinners[i].Success() - case sdp.RiskCalculationStatus_ProgressMilestone_STATUS_SKIPPED: + case sdp.ChangeAnalysisStatus_ProgressMilestone_STATUS_SKIPPED: milestoneSpinners[i].Warning(fmt.Sprintf("%v: skipped", ms.GetDescription())) } } - status := riskRes.Msg.GetChangeRiskMetadata().GetRiskCalculationStatus().GetStatus() - if status == sdp.RiskCalculationStatus_STATUS_UNSPECIFIED || status == sdp.RiskCalculationStatus_STATUS_INPROGRESS { + status := riskRes.Msg.GetChangeRiskMetadata().GetChangeAnalysisStatus().GetStatus() + if status == sdp.ChangeAnalysisStatus_STATUS_UNSPECIFIED || status == sdp.ChangeAnalysisStatus_STATUS_INPROGRESS { if !riskSpinner.IsActive { // restart after a Fail() riskSpinner, _ = riskSpinner.Start("Calculating Risks") @@ -421,7 +421,7 @@ func TerraformPlanImpl(ctx context.Context, cmd *cobra.Command, oi sdp.OvermindI // retry time.Sleep(time.Second) - } else if status == sdp.RiskCalculationStatus_STATUS_ERROR { + } else if status == sdp.ChangeAnalysisStatus_STATUS_ERROR { riskSpinner.Fail("Calculating Risks: waiting for a retry") } else { // it's done diff --git a/go.mod b/go.mod index 7e5c9fd..4862e93 100644 --- a/go.mod +++ b/go.mod @@ -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.4 + github.com/overmindtech/sdp-go v0.102.5-0.20241216105318-a0af4432d4b2 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 diff --git a/go.sum b/go.sum index beebda4..d0ce812 100644 --- a/go.sum +++ b/go.sum @@ -326,6 +326,10 @@ github.com/overmindtech/pterm v0.0.0-20240919144758-04d94ccb2297 h1:ih4bqBMHTCtg github.com/overmindtech/pterm v0.0.0-20240919144758-04d94ccb2297/go.mod h1:bRQZYnvLrW1S5wYT6tbQnun8NpO5X6zP5cY3VKuDc4U= github.com/overmindtech/sdp-go v0.102.4 h1:PENbGxfoOvh7L3yCeOH1bWtFNfCGeYg/22iF0JeYPdw= github.com/overmindtech/sdp-go v0.102.4/go.mod h1:Lx2DtTLaroGuVTq5CL1SBT19zzudhLF6jdRkwXDJXRk= +github.com/overmindtech/sdp-go v0.102.5-0.20241216101827-31ab7b07f9d8 h1:7V7SYUvxFq8IaLXoeX/2j8Q8iwdbCN3dmEwenQlUi7Y= +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/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=