-
Couldn't load subscription status.
- Fork 7.3k
gh pr checks #1563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh pr checks #1563
Conversation
Let's use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good! I have some questions for whether they were planned to be rolled up in the same PR:
-
In
pr status, we display the summary of both Checks and Statuses, since the PR Merge Box in the web interface displays the summary of both. This change set only seems to aggregate Checks; was support for Statuses planned as part of the same iteration? -
Should we attempt to order the list of Checks the same way the web interface does? I'm guessing the rough algorithm is: first failing, then pending, and alphabetical order for anything in-between.
-
When a repository (like ours) has both
pushandpull_requestactions, each resulting run is rendered twice. For example, I seebuild (ubuntu-latest)reported twice, but there is no indicator which one ispushand which one ispull_requestlike in the web interface. Do we have enough information from the API to disambiguate this?
Ref. #1529
|
wow TIL that statuses and checks are two different things. That clarifies some things. 🤦 🤦 🤦 🤦 🤦 I'll work on including those, changing the ordering, and exposing the push/pullrequest thing (if it's possible thru the api) |
A basic first pass on gh pr checks that shows all check runs for a given PR's latest commit.
|
okay, this is ready for re-review @mislav . I:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work; thank you! A few notes, but all things that can potentially be addressed as follow-up, so nothing blocking. 🚀
| nodes { | ||
| commit { | ||
| oid | ||
| statusCheckRollup { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My slight concern with expanding the PullRequestByNumber is that the Checks+Statuses data is unnecessarily fetched every time a user does any operation on a pull request, such as gh pr view 123 --web. However, I do understand that this approach is the most feasible to implement, since any other course of action would require us to either duplicate the logic of shared.PRFromArgs() to fetch extra fields, or to come up with a shippable solution to #1081. I'm only bringing this up as a note that this is a good candidate to revisit in a few weeks 👍
| tp.AddField(o.mark, nil, nil) | ||
| tp.AddField(o.name, nil, nil) | ||
| tp.AddField(o.elapsed, nil, nil) | ||
| tp.AddField(o.link, nil, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is tricky! We render the URL in this column, but the way I designed TablePrinter is to automatically truncate long columns in narrow terminals. That means that the URL column will be the first one put up on the chopping block, and URLs become completely useless after they are truncated.
A good followup candidate would be to add a feature to TablePrinter to mark some columns as exempt from elastic resizing/truncation.
|
this is merge-able but going to wait to merge since there is already a ton going into the next release. |
Was the |
|
@tierninho you found a bug D: I'll fix that; |
|
ahhh right, thanks for the reminder. |
|
@tierninho I merged in trunk to get the fix for that -R problem. |
|
If checks are at a repo level, should we prevent this cmd as it implies branches can be queried?
|
|
it's at the pr level. the R flag is for looking up a PR via argument in another repo. |
This PR adds a basic first version of
gh pr checks. It accepts no flags and its only positional argument is a PR selector; otherwise, the current PR is used.Considerations:
the unicode bullet originally used in the mockups caused formatting glitches; it was not printed as a full width character. I wasn't able to find a suitable replacement and usedswitched to.for now.-as per ampinsk's suggestionwatching these checks. Right now running this command withwatch(watch gh pr checks) means that the output is formatted for machines and not people. I'd like a workaround for this; either a--watchparameter we provide ourselves, a--colorparameter that overrides the tty detection, or something else.TTY output
non TTY output
Ref. #1525