Skip to content

Commit df58831

Browse files
authored
Merge pull request cli#3336 from cli/pr-checks-crash
Treat unrecognized PR Checks statuses as "pending"
2 parents 531b15c + 05c7c2b commit df58831

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

api/queries_pr.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,8 @@ func (pr *PullRequest) ChecksStatus() (summary PullRequestChecksStatus) {
188188
summary.Passing++
189189
case "ERROR", "FAILURE", "CANCELLED", "TIMED_OUT", "ACTION_REQUIRED":
190190
summary.Failing++
191-
case "EXPECTED", "REQUESTED", "QUEUED", "PENDING", "IN_PROGRESS", "STALE":
191+
default: // "EXPECTED", "REQUESTED", "WAITING", "QUEUED", "PENDING", "IN_PROGRESS", "STALE"
192192
summary.Pending++
193-
default:
194-
panic(fmt.Errorf("unsupported status: %q", state))
195193
}
196194
summary.Total++
197195
}

pkg/cmd/pr/checks/checks.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,11 @@ func checksRun(opts *ChecksOptions) error {
141141
markColor = cs.Red
142142
failing++
143143
bucket = "fail"
144-
case "EXPECTED", "REQUESTED", "QUEUED", "PENDING", "IN_PROGRESS", "STALE":
144+
default: // "EXPECTED", "REQUESTED", "WAITING", "QUEUED", "PENDING", "IN_PROGRESS", "STALE"
145145
mark = "-"
146146
markColor = cs.Yellow
147147
pending++
148148
bucket = "pending"
149-
default:
150-
panic(fmt.Errorf("unsupported status: %q", state))
151149
}
152150

153151
elapsed := ""

0 commit comments

Comments
 (0)