Skip to content

Commit 68bc5b0

Browse files
tphoneyactions-user
authored andcommitted
(fix) cli get change waits on 'in progress' and 'unspecified' (#1042)
re #1041 ![image](https://github.com/user-attachments/assets/639b239b-9efe-4545-b070-649f07b800e2) with the changes in where we do processing for a change. when we first ask the status of the risk analysis, each step will be 0, ie unknown. We should wait on this status of ChangeAnalysisStatus_STATUS_UNSPECIFIED similar to ChangeAnalysisStatus_STATUS_INPROGRESS. longer term GetChangeRisks will be removed, and we will ask the change_timeline_v2 what is happening and this logic will be different. GitOrigin-RevId: 295095de4be0675e8abfaab9006797f2e6163ca4
1 parent 3c380c1 commit 68bc5b0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cmd/changes_get_change.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,14 @@ fetch:
102102
}
103103
}
104104

105-
if riskRes.Msg.GetChangeRiskMetadata().GetChangeAnalysisStatus().GetStatus() == sdp.ChangeAnalysisStatus_STATUS_INPROGRESS {
105+
currentStatus := riskRes.Msg.GetChangeRiskMetadata().GetChangeAnalysisStatus().GetStatus()
106+
// if everything is pending or in progress we need to wait.
107+
// - ChangeAnalysisStatus_STATUS_UNSPECIFIED: When all are pending
108+
// - ChangeAnalysisStatus_STATUS_SKIPPED: When all are skipped
109+
// - ChangeAnalysisStatus_STATUS_INPROGRESS: When >1 is in progress
110+
// - ChangeAnalysisStatus_STATUS_ERROR: When any of the steps are errored
111+
// - ChangeAnalysisStatus_STATUS_DONE: Any other situation
112+
if currentStatus == sdp.ChangeAnalysisStatus_STATUS_INPROGRESS || currentStatus == sdp.ChangeAnalysisStatus_STATUS_UNSPECIFIED {
106113
// Extract the currently running milestone if you can
107114
milestones := riskRes.Msg.GetChangeRiskMetadata().GetChangeAnalysisStatus().GetProgressMilestones()
108115
var currentMilestone string

0 commit comments

Comments
 (0)