Repository navigation
[GH-127] Improve RHS UI and content - #170
Conversation
|
The functionality is practically complete, but there are a few concerns. First of all, I would like to know if there are any standard styles you want to use for several parts of the code. Also, to retrieve status and reviews imply making several more calls, which might become a problem due to the rates from the API. We are talking that retrieving the PRs now implies: 1 call for the list of PRs + 3 calls for each PR. Finally, there are some details that I am not sure whether they have been done in the most desirable way. Due to how I was able to check the reviews, we get the "Changes requested" message whenever someone asked for changes, even if we have clicked the "Re-request review" button. Is this the expected behaviour? |
|
This issue has been automatically labelled "stale" because it hasn't had recent activity. /cc @jasonblais @hanzei |
|
/update-branch |
Thanks @larkox! Sorry for the delay response as some of us where away for the holidays.
Could you provide some screenshots of your changes in the PR description that would help get an initial UX review? We will also take a look at the code and provide any styles suggestions there are necessary.
Agreed that it seems too many extra calls to do each time we get all PRs. Two possible suggestions:
I believe this is the way Github handles the review state correct? |
marianunez
left a comment
There was a problem hiding this comment.
See comment regarding breaking out the extra PR information call
|
Thanks @marianunez ! I uploaded a new version of this, with pr fetching and extra info fetching decoupled. Whenever you tell me what information is needed and what not, I will remove that part. As a small remainder:
I also have been taking a look into it, and using GraphQL (github API v4, right now we are using v3) might allow us to put all this in a single call. If you want, we can continue this PR as it is right now, and at some point consider migrating the api calls to GraphQL and use all the potential they have. Regarding UX, I added one screenshot on how it looks right now. My point is that if we have already some CSS classes created that will work for this, let me know which ones, so I use them directly. If they are not created, let me know the definition (colors, sizes, theme parameters...) so I can implement them. Thanks! |
|
@larkox What exactly does the x button does? |
|
Hello @asaadmahmood ! The X should be red, and is the same X as in this screens (taken from github directly): It states the status of the PR. Whether it failed any check, or passed all the checks or it is pending something. It can be also a green tick: This image is used in several other places with similar meaning. For example: Is it clear? Or do you need more context? |
|
@larkox Got it, can you setup a test server with that a PR that has that x icon on it. |
@larkox That sounds like an excellent improvement! Thank you for pointing out this option. When we are talking about API requests per PR, are we referring to API to calls to the MM server, or API calls to the GitHub server? If it is the former, we can consolidate some of the API requests into endpoints that return several pieces of data. If it is the latter, GraphQL seems like a good way to get everything we need from GitHub in (ideally) one request. |
|
@larkox Here's a test server you can use: Username: |
|
@mickmister Yes, it is the second case. 3 different calls to github. I haven't explored enough the GraphQL api yet, but hopefully it can make things easier. |
| switch (item.status) { | ||
| case 'success': | ||
| status = ( | ||
| <svg |
There was a problem hiding this comment.
@larkox Can we move these svg's to a separate file with named exports?
@marianunez Does this make sense or do you think they should each have their own file? I think it clutters this file having them laid out like they are currently.
There was a problem hiding this comment.
+1 on their own file. We could follow the model of webapp for the icons here too
|
|
||
| let reviewers = ''; | ||
| if (item.reviewers && item.reviewers > 0) { | ||
| reviewers = (<span>{item.reviewers} pending reviews.</span>); |
There was a problem hiding this comment.
I believe these are the amount of reviewers requested regardless if pending or not. Not sure if there is any value on providing the total reviewers.
Thoughts @mickmister ?
There was a problem hiding this comment.
Could we have a 3 out of 4 reviews complete display or something of the sort?
There was a problem hiding this comment.
This is a mistake on my part. The reviewers value comes from "requested_reviewers". As far as I have seen, a requested reviewer is marked as that since the it is requested for review until it makes its first review. After that, even if you request a rereview, it will not appear on "requested_reviewers" anymore.
That being said... reviewers is indeed the pending reviews. Also, because of that, my first question about how to deal with the reviews. I can "do the maths" and leave it as 3 out of 4 reviews approved, or I could go even overkill with something as:
- 1 approved review.
- 2 changes requested reviews.
- 1 pending review.
- 1 out of 4 reviews complete.
What I cannot do (as far as I have seen at least) is distinguish between a Changes Requested review and a rerequested review.
All that being said, what do you expect to be the most useful way to give this information?
There was a problem hiding this comment.
@larkox I think saying 1 out of 4 reviews complete and a small indicator to express that at least one reviewer currently has requested changes (just like the red icon that shows up in GitHub) would be sufficient. I think this solution is both compact and informative.
|
@asaadmahmood The test server that @mickmister provided already has one version of my changes. You have several cases. If you want to try any other case, please let me know. Here is the info for the server again: Username: sysadmin @mickmister In order to let Asaad try this, I created a mockClient for the webapp part. I am not sure whether this will be useful on the future, but I can clean it up and have upload it also if you find it useful. |
lieut-data
left a comment
There was a problem hiding this comment.
Very concise, thanks @larkox! Two questions below.
| @@ -556,11 +556,13 @@ func (p *Plugin) getPrsDetails(w http.ResponseWriter, r *http.Request) { | |||
| func fetchPRDetails(ctx context.Context, client *github.Client, prURL string, prNumber int) (*PRDetails, error) { | |||
There was a problem hiding this comment.
It looks like we never return a non-nil error -- should we omit that return value altogether for now?
There was a problem hiding this comment.
You are completely right. We suppose the result always comes the best it can. There is nothing to handle if there is any error either way (the call was just logging the error).
| status := "" | ||
| requestedReviewers := []*string{} | ||
| var reviewsList []*github.PullRequestReview = nil | ||
| var reviewsList []*github.PullRequestReview = []*github.PullRequestReview{} |
There was a problem hiding this comment.
Would I be correct in assuming you're initializing this so that the resulting JSON serialization returns an empty array [] vs the null it would otherwise encode when there are no reviews? If that's the case, I'd recommend the more idiomatic:
// Initialize to a non-nil slice to simplify JSON handling semantics.
reviewsList := []*github.PullRequestReview{}
There was a problem hiding this comment.
It was more a hunch than anything else. I did not like that sometimes reviewsList was a nil, sometimes was a list. I preferred it to be something more stable.
|
/update-branch |
|
Hi @larkox well done! This UX improvement looks great! I found 1 very small issue. On the PR Needing Review Section, when the last record at bottom has changes requested from the reviewer(s), the help text for the "+/-" still opens downward so the text "Changes Requested" is not visible. Is it possible to fix it such the it opens upward when there is not enough vertical space for it below? |
|
Hi @larkox as mentioned above, I see only one minor issue (possibly CSS related) is this is something easy enough to resolve? |
|
I have been checking, and there seems that there will not be an "easy" solution. The only easy solution will be always showing it on top. There is always space on top, but may be annoying since will cover part of the text of the issue you are looking at. |
|
@asaadmahmood Is this issue something you be able to provide some guidance on? Alternatively, this PR has been waiting a while and this minor CSS issue is an edge case. @aaronrothschild would it makes sense to merge this and create a follow-up issue for the remain CSS problem? |
|
@DHaussermann I may have a to look at it. We can take it in, so I can see it live in action. |
I agree that we should open a JIRA ticket to fix this border case and merge this PR. It's a great improvement and would love to see it in community soon. 🎉 |
|
/update-branch |
DHaussermann
left a comment
There was a problem hiding this comment.
Tested and passed
Reviewed new data for accuracy
Reviewed detail in this task and related ticket to ensure everything was implemneted
The following has been successfully added:
- PR number
- Checks Passes (Review required section only)
- Milestone version - if applicable
- Time the PR has been open - in the case of PR lists
- Reviews complete (Review required section only)
LGTM! Thanks @larkox for the effort on this!
@aaronrothschild note that a follow up issue was created for the minor CSS issue found.
#194
|
Thanks @larkox. This is such an awesome improvement. I can't wait to use it myself. |




Summary
Improve RHS UI and content
Ticket Link
Fixes #127
Screenshots