Fixed link to replying to other replies in the diff viewer
Review Request #7926 — Created Jan. 30, 2016 and submitted
On the diff page the list of comments doesn't differenciate between
top-level comments and replies to those comments. Because reviewboard
doesn't support replying to a reply of a comment, the "Reply" link on
those reply comments would not work properly. This fix solves that problem
by changing those reply links to reply to their parent comment.
Manual Test:
-Create a comment on a line on the diff viewer page for a review request.-Reply to that comment.
-Go back to the diff viewer page and click the reply link of
that reply comment.-Expected result is that it should go to the review page, scroll to,
and open the reply editor for the parent comment of that reply.-Jasmine js test suite passed
-Reviewboard unit test suite passed
-2 new tests added to the js test suit
Description | From | Last Updated |
---|---|---|
Needs a trailing comma after the last entry (we do this so that if we end up adding another entry … |
mike_conley | |
Let's call this reply_to_id, for consistency. |
chipx86 | |
This one should be comment-list-reply-action. That will make your queries easier, too. |
chipx86 | |
In our codebase, we only ever have one var statement per function, at the very top, one variable per line. … |
chipx86 | |
This made me notice a typo in the original object. Should be "Test User". |
chipx86 | |
As above, the var should go at the top of this function (with a blank line after it). |
chipx86 | |
Same here. |
chipx86 | |
This should be formatted as: expect(/*...*/) .toContain(/*...*/) |
brennie | |
Single quotes. Also, this should be formatted as: expect(/*...*/) .toContain(/*...*/); |
brennie | |
Same here. |
brennie | |
We don't usually put trailing comments. |
brennie | |
Since you're doing $commentsList.find(selector) multiple times, it would be better to do: var $replies; editor.set(/*...*/); dlg.open(); $replies = $commentList.find(selector); expect($replies[0].href).toContain(/*...*/); … |
brennie | |
We use single quotes. |
brennie | |
Same here. |
brennie | |
Can also probably build the target string ahead of time, too. |
brennie |
-
Something that's important when writing commit/review request descriptions is to tell the reviewer the story of your change. Assume that the person reading it may be reading it 3 years from now, and may have no knowledge of what you did or why. Then go from there.
The summary should be a clear, concise thing about what you did: "Fixed the link for replying to other replies in the diff viewer."
Then tell the story in the description of what was wrong before and what you've done to address it. Not all the technical details, but the higher-level stuff.
See https://www.reviewboard.org/docs/codebase/dev/writing-good-descriptions/ for examples.
-
Looking good! Can you please update the bug number in this review request?
-
Needs a trailing comma after the last entry (we do this so that if we end up adding another entry to the end of this list, we don't have to add the comma to the previous entry which updates blame on that line.
Also, I'm not 100% sure, but doesn't this default to None already if no relationship is set? If so, we can probably just rewrite this as:
... 'reply_to': comment.reply_to_id,
-
This is also going to need unit tests that check for the two possibilities: A reply to ID, or a review ID.
This would live in
js/views/tests/commentDialogViewTests.js
. You can see where we have adescribe('Other published comments list', ...)
section, which already does a few things. You'd add new tests that verify the links for both types of comments.By having this, we ensure that this can't break down the road without us noticing.
- Summary:
-
Reply link on diff page conditonally links to parent commentFixed bug #4049 which fixes replying to other replies in the diff viewer
- Description:
-
~ Reply link on diff page conditonally links to parent comment
~ This is a fix for bug #4049. On the diff page the list of comments doesn't differenciate between top-level comments and replies to those comments. Because reviewboard doesn't support replying to a reply of a comment, the "Reply" link on those reply comments would not work properly. This fix solves that problem by changing those reply links to reply to their parent comment.
- Testing Done:
-
~ Only manual testing was done.
~ Only manual testing was done.
+ Create a comment on a line on the diff viewer page for a review request. + Reply to that comment. + Go back to the diff viewer page and click the reply link of that reply comment. + Expected result is that it should go to the review page, scroll to, and open the reply editor for the parent comment of that reply.
- Change Summary:
-
Added the trailing comma on the newest attribute to keep git blame consistent. Also removed extraneous "or None".
-
Tool: Pyflakes Processed Files: reviewboard/reviews/context.py Ignored Files: reviewboard/static/rb/js/views/commentDialogView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/context.py Ignored Files: reviewboard/static/rb/js/views/commentDialogView.js
-
Almost! The bug number actually isn't useful in either the summary or the description. It should go in the bugs field. That will automatically be placed in the commit message when landing.
The description should also wrap at 80 characters, like our source code. It's best to compose this in your commit message, using your editor to ensure the proper width, and use that for the review request description. The summary/description in the review request will be used as-is in the commit message.
- Bugs:
- Summary:
-
Fixed bug #4049 which fixes replying to other replies in the diff viewerFixed link to replying to other replies in the diff viewer
- Description:
-
~ This is a fix for bug #4049. On the diff page the list of comments doesn't differenciate between top-level comments and replies to those comments. Because reviewboard doesn't support replying to a reply of a comment, the "Reply" link on those reply comments would not work properly. This fix solves that problem by changing those reply links to reply to their parent comment.
~ On the diff page the list of comments doesn't differenciate between top-level comments and replies to those comments. Because reviewboard doesn't support replying to a reply of a comment, the "Reply" link on those reply comments would not work properly. This fix solves that problem by changing those reply links to reply to their parent comment.
-
Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/context.py Ignored Files: reviewboard/static/rb/js/views/tests/commentDialogViewTests.js reviewboard/static/rb/js/views/commentDialogView.js Tool: Pyflakes Processed Files: reviewboard/reviews/context.py Ignored Files: reviewboard/static/rb/js/views/tests/commentDialogViewTests.js reviewboard/static/rb/js/views/commentDialogView.js
- Change Summary:
-
Wrapped description to 80 characters.
- Description:
-
~ On the diff page the list of comments doesn't differenciate between top-level comments and replies to those comments. Because reviewboard doesn't support replying to a reply of a comment, the "Reply" link on those reply comments would not work properly. This fix solves that problem by changing those reply links to reply to their parent comment.
~ On the diff page the list of comments doesn't differenciate between
+ top-level comments and replies to those comments. Because reviewboard + doesn't support replying to a reply of a comment, the "Reply" link on + those reply comments would not work properly. This fix solves that problem + by changing those reply links to reply to their parent comment. - Testing Done:
-
~ Only manual testing was done.
~ Create a comment on a line on the diff viewer page for a review request. ~ Reply to that comment. ~ Go back to the diff viewer page and click the reply link of that reply comment. ~ Expected result is that it should go to the review page, scroll to, and open the reply editor for the parent comment of that reply. ~ Only manual testing was done.
~ ~ -Create a comment on a line on the diff viewer page for a review request.
~ ~ -Reply to that comment.
+ + -Go back to the diff viewer page and click the reply link of
+ that reply comment. + + -Expected result is that it should go to the review page, scroll to,
+ and open the reply editor for the parent comment of that reply.
-
Tool: Pyflakes Processed Files: reviewboard/reviews/context.py Ignored Files: reviewboard/static/rb/js/views/tests/commentDialogViewTests.js reviewboard/static/rb/js/views/commentDialogView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/context.py Ignored Files: reviewboard/static/rb/js/views/tests/commentDialogViewTests.js reviewboard/static/rb/js/views/commentDialogView.js
- Testing Done:
-
Only manual testing was done.
-Create a comment on a line on the diff viewer page for a review request.
-Reply to that comment.
-Go back to the diff viewer page and click the reply link of
that reply comment. -Expected result is that it should go to the review page, scroll to,
and open the reply editor for the parent comment of that reply. + + -Jasmine js test passed
+ -Reviewboard unit test passed
- Testing Done:
-
~ Only manual testing was done.
~ ~ Manual Test:
~ -Create a comment on a line on the diff viewer page for a review request. - -Create a comment on a line on the diff viewer page for a review request.
-Reply to that comment.
-Go back to the diff viewer page and click the reply link of
that reply comment. -Expected result is that it should go to the review page, scroll to,
and open the reply editor for the parent comment of that reply. ~ -Jasmine js test passed
~ -Reviewboard unit test passed ~ -Jasmine js test suite passed
~ -Reviewboard unit test suite passed + -2 new tests added to the js test suit
-
-
-
-
-
-
Since you're doing
$commentsList.find(selector)
multiple times, it would be better to do:var $replies; editor.set(/*...*/); dlg.open(); $replies = $commentList.find(selector); expect($replies[0].href).toContain(/*...*/); expect($replies[1].href).toContain(/*...*/);
We should also probably do:
expect($replies.length).toEqual(2);
-
-
-
-
Tool: Pyflakes Processed Files: reviewboard/reviews/context.py Ignored Files: reviewboard/static/rb/js/views/tests/commentDialogViewTests.js reviewboard/static/rb/js/views/commentDialogView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/context.py Ignored Files: reviewboard/static/rb/js/views/tests/commentDialogViewTests.js reviewboard/static/rb/js/views/commentDialogView.js