kegsay / github-pull-review Goto Github PK
View Code? Open in Web Editor NEWA better way to review pull requests
License: Apache License 2.0
A better way to review pull requests
License: Apache License 2.0
We have the concept of done markers in #24. This should be used to present a 2 column table of "Done" and "Not done" items. Each item is a comment thread (Line comments on same line or "Needs action:" overview comments with linked comment IDs as "Done").
https://review.rocks/#/repos/illicitonion/testrepo-hassubmodule/2/diffs?_k=fnpt66
Err getting diffs: {}(anonymous function) @ bundle.js:1851
bundle.js:1852 TypeError: Cannot read property '1' of null
at https://review.rocks/bundle.js:3207:53
at Array.map (native)
at Function.calculateLineData (https://review.rocks/bundle.js:3194:44)
at new Patch (https://review.rocks/bundle.js:3011:30)
at new FileDiff (https://review.rocks/bundle.js:2662:26)
at https://review.rocks/bundle.js:1682:16
at Array.map (native)
at Object.module.exports.getDiffsFromGithubApi (https://review.rocks/bundle.js:1681:21)
at https://review.rocks/bundle.js:2016:34
at tryCatcher (https://review.rocks/bundle.js:9558:23)
at Promise._settlePromiseFromHandler (https://review.rocks/bundle.js:7664:31)
at Promise._settlePromiseAt (https://review.rocks/bundle.js:7738:18)
at Promise._settlePromises (https://review.rocks/bundle.js:7854:14)
at Async._drainQueue (https://review.rocks/bundle.js:5144:16)
at Async._drainQueues (https://review.rocks/bundle.js:5154:10)
at Async.drainQueues (https://review.rocks/bundle.js:5036:14)
You should be able to do this.
http://kegsay.github.io/github-pull-review/#repo=matrix-org/matrix-doc&pr=94
First file: api/client-server/v1/create_room.yaml
Original comment mentioned on line:
\ no newline ...
when I pushed a commit to fix this the comments disappeared and can't be shown (probably because it is blindly thinking that it can display the comments on that line but it can't ?)
https://review.rocks/#/repos/matrix-org/matrix-doc/185/diffs?_k=tog8fx
"api/client-server/v2_alpha/account-data.yaml → api/client-server/account-data.yaml"
That → is quite strange
You should be able to provide code suggestions when viewing up to HEAD
commits. Perhaps double-clicking a line brings you into an "editor view" with a "Suggest" button? When you hit the button it will leave a commit comment with the diff hunk embedded in it to the effect of:
Suggestion:
@@ -11,1 +11,1 - var foo = "bar"; + var foo = "beer";
When Github Pull Review sees a comment matching this form it can then pretty-display the diff hunk and add 2 buttons (YUP/NOPE) and if you hit YUP it will do the commit. Commit can be done using something like http://www.mdswanson.com/blog/2011/07/23/digging-around-the-github-api-take-2.html
We really need anchor tags on:
diff-$SHA_OF_FILE[L|R]$NUM
- e.g. diff-48205bd927ef9295872L57
diff-$FILEPATH-[L-R]$NUM
e.g. diff-foo/bar.py-L89
id=
attributes have limited character ranges (ASCII) which I guess is why they chose SHAs...When you hit the BASE -> COMMENT button, the comment will be somewhere as a line comment so we should jump to it.
When you hit COMMENT -> HEAD, the file may be really small/big, so should jump to the start of the file in question.
They probably should.
Specifically, /list should be accessible from somewhere and we need an auth page so we can remove InfoGetter.
Write a line comment then swap to another tab (e.g. commits) and then back again, and poof your comment has magically disappeared. Same applies to going to unified view. We really should remember this...
Subsections of diff chunks may be the same because they were moved. We should [...] them. Good heuristic would be:
if there is a 15+ line block which has been +/-d:
We can't compare on lines alone though (think keeping within 80 char limits, you shuffle words about)
so we should try to do this based on tokenised words (but careful with semantics here on actual code where indentation matters like python)
I was sadsies because I commented on matrix-doc 136 (owner/assignee @illicitonion ) and it didn't show up on /list
. I was not @ mentioned. After prodding @illicitonion he sez that "mentioned/involved_with" are things we can search on and probably should do.
e.g. if in my description I say:
"Depends on matrix-org/matrix-spec-proposals#158"
it would be great if this in some way rendered to say:
"Depends on [merged] matrix-org/sytest#158"
Maybe through colour, or strikethrough, or something.
The comments do now :)
The previews do not :(
If you're on the file diff view and type in a new PR and hit "View", it clobbers the PR object but doesn't re-collect the diffs, getting this weird stale set of diffs.
This is because there is an outstanding action. The logic should check if the last comment on the line is by the author and then move from "awaiting your response" to "awaiting their action" if all actions are like this.
See http://kegsay.github.io/github-pull-review/#/repos/matrix-org/matrix-doc/108/diffs?_k=mgqt9l
The thread:
Is incorrectly displayed on http://kegsay.github.io/github-pull-review/#/repos/matrix-org/matrix-doc/108/actions
Long lines in a code block will overflow the line diffs.
Two tables was a mistake. One table spanning lots of rows is better. Two tables was a mistake because:
In short, use a single table for side-by-side diffs.
Uncaught Error: Action 'get_commit_diffs_response' was emitted but failed to pass the schema. Expected 'diff' to be of type object but was actually of type undefined
When trying to view the commit diff (1->HEAD) on an added file: event-schemas/schema/v1/m.room.third_party_invite
States should be:
TODO (they left you something to do, and you haven't done it)
Done (you have done it)
InQuestion (they've left you something to do, you've asked a question, waiting on their reply)
It seems that one can switch the diffs for individual files to be unified rather than split, but there doesn't seem to be a way to convert all of the files to be unified.
I would find it useful if the tool recorded the preference for unified vs split across browser sessions, and applied the preference to all PRs since some of my devices have narrow screens where unified diffs are easier to read.
We display absolutely no error messages at all currently. Let's fix that.
We needs one precious.
Each actionable comment (that is, first comment on a line, or any overview comment with the text "Needs action:") has a check box "Done?". If you tick it, it replies with a comment "Done." (which is suppressed on the UI). Subsequent replies on line comments "undones" the comment thread. This is done by unticking the box (which prompts for a "Reason:").
Examples: (A=Reviewer, B=Reviewee)
Basic:
done
box (replies with "Done.") [0 undone items]Basic with non-actionable overview:
Basic with actionable overview:
Ping-pong:
Overview comments:
Each comment has a prev/next diff which aren't hooked up. They should:
BASE -> O -> O -> CMT
etcA commit object has a commit.comment_count value - if it's >0, we should follow its top-level comments_url property and display commit comments.
This literally submits a top-level review comment of "LGTM".
There is currently a "Show all comments" button which is cool I guess. My beef is with the comment header which Unhelpfully says the short SHA e.g. (abcd123). This is bad because you have no clue if this is ancient or really recent.
Given we know the commits and the order... we should probably say "1 commit ago" or "1 commit later" rather than the hash (and maybe <a>
the text to dump you to the commit itself on GH)
We should probably do pagination to get at all the comments... else we only get the first 30 from /comments
. Looks like there is a Link:
header which basically appends &page=2
Github has a "View" button, we should just hyperlink the path of the file.
It looks very littlebig planet atm...
Would be nice. Would be double nice if this screen long-polled Github to live update (which github's own UI doesn't actually do comically).
They currently 404 and aren't shown on the UI that it failed or anything.
Should be hooked up so it goes to /diffs
, to the right file (needs anchoring), to the right base/head comparison (needs query params), to the right line (needs anchoring).
If you view a SHA-HEAD diff and leave a line comment, it leaves a comment on that line number on the BASE-HEAD diff, which may be woefully different to the intended line. This is actually kinda hard to fix without doing per-commit comments (which GH supports and shows in the PR UI but we don't do yet).
Use Flow for type checking rather than the current action bodge.
List N commits done on the TARGET (base) next to merge button (expand to commit list, expand again to file diff) - complicated by merging from master to branch (which should reduce the count)
You should be able to click hunks to expose more of the file.
Steps:
The fields mergeable_state and _links.statuses.href are useful here
Would be good to use it. And you know, have some tests.
We need a new concept of a Store
class. This stores the currently active PullRequest
and is the de jure source for PR info. This entity is the thing which should dispatch PullRequestTriggers
when the underlying PR is updated.
We should remove LineCommentsTrigger
and FileDiffsTrigger
and replace them with PullRequestTrigger
which has a before
and after
prop for the PullRequest
, along with changed
fields.
The intention here is to avoid the controller doing too much (managing state rather than orchestrating other components) and to allow us to do things like "local echo" comments without instigating HTTP hits (we could do it all locally and then have the store broadcast the change).
Yes please :) Based off the file extension
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.