Repository navigation
Conversation
williammartin
left a comment
There was a problem hiding this comment.
@BagToad I pushed a commit on top of this that I would want if we do merge this.
I have some concerns about merging this in #9682 (comment)
gh pr checks exit 0 when no checks are foundgh pr checks uses a unique exit code when no checks are found
| exitCancel exitCode = 2 | ||
| exitAuth exitCode = 4 | ||
| exitPending exitCode = 8 | ||
| exitUnkown exitCode = 16 |
There was a problem hiding this comment.
I'm not particularly concerned about what exit code to use for this situation, so happy to hear others' thoughts about it if you think we could use something better.
There was a problem hiding this comment.
Or even one of the existing exit codes. Though I will say, making a unique exit code for an "unknown results" situation does make the most sense to me. Willing to be convinced otherwise though!
|
|
||
| type UnknownResultsError struct { | ||
| message string | ||
| } | ||
|
|
||
| func (e UnknownResultsError) Error() string { | ||
| return e.message | ||
| } | ||
|
|
||
| func NewUnknownResultsError(message string) UnknownResultsError { | ||
| return UnknownResultsError{message: message} | ||
| } |
There was a problem hiding this comment.
I opted to call this thing UnknownResultsError because it seemed the most appropriate with the problem raised in #9682 (comment):
The branch for the PR might not report any checks if the branch was just created, so before any Checks nor Statuses got registered by external services yet. Re-running the command a few seconds later could show that there are now checks registered as “pending”.
The way I read this is that we don't know, and so it would make sense to exit with something new and unique that is specifically about situations where we don't know.
|
@williammartin this is ready for another look adjusted with the changes discussed in #9682 |
|
Closing in favor of an alternative implementation to be decided later: #9682 (comment) |
This PR proposes changes to
gh pr checksandgh pr checks --requiredto both exit16when no results are found.Demo
Fixes #9682