Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1256)

Issue 22410044: One-Click Revert in Rietveld (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 6 months ago by rmistry
Modified:
10 years, 5 months ago
Reviewers:
iannucci, M-A
CC:
skiabot_google.com, codereview-list_googlegroups.com
Visibility:
Public.

Description

One-Click Revert in Rietveld. This is the implementation of the design discussions in https://codereview.chromium.org/23483019/. Workflow: * When an issue is closed the revert button shows up. * Clicking on the revert button brings up a popup text field where the user has to enter a reason for requesting the revert. * A revert CL is then automatically created with the original patches in the patchset inverted. * The CQ flag of the revert CL is checked. * The revert CL description contains a link back to the original CL, the reason for revert, TBR, NOTRY and NOTREECHECKS (will be added to the CQ soon). * The original CL gets a new comment that notifies recipients about the reverted CL, who created it and the reason for its creation. What does not work: * This implementation only works with Git patches, it is probably easy to invert SVN patches but I will leave that for another time (if it is required, I suspect it is not). * 'A +' patches with 100% similarity indexes are not reversed because we do not easily know the SHA-1 index of the previous patch. * Very large patches. An error message is displayed in /revert_issue if any of the above are detected so that the system can fail early without creating unnecessary Issues/PatchSets/Patches/Contents. Tested with: * Comprehensive unit tests have been added that test 'A', 'A+', 'M', 'D' and chmod patches for both binaries and ASCII files. * Tested end-to-end using a local modified CQ and the skiabot-test repository in https://skia.googlesource.com/ (it is hidden). Examples of CLs I tested with are: ** https://skia-codereview-staging.appspot.com/341001/ ** https://skia-codereview-staging.appspot.com/191013/ (Feel free to click the 'Revert' button on the above CLs) * Also tested DeadlineExeededErrors and OOMs with the following CLs: ** https://skia-codereview-staging2.appspot.com/40003/ ** https://skia-codereview-staging2.appspot.com/90001/ ** https://skia-codereview-staging2.appspot.com/50003/ Additional Information: * The latest patchset has been rebased with Rietveld rev 45476f54945d. * Support for NOTREECHECKS in the CQ has been added in https://codereview.chromium.org/68113009/ it is required for reverting breaking CLs from Rietveld while the tree is closed (one of the main use-cases of One-Click Revert). * A design doc that details the workflow (with pretty pictures) is coming soon.

Patch Set 1 #

Patch Set 2 : Clean up #

Patch Set 3 : Handling Binary Files #

Patch Set 4 : Support modes and do not support Binary 'A+' and 'M' #

Patch Set 5 : Support cc and reviewers #

Patch Set 6 : Refactored code into models.py #

Patch Set 7 : Refactoring into a new invert_patches.py module #

Patch Set 8 : Adding tests #

Patch Set 9 : Support Binary A+ #

Patch Set 10 : Support mode in the index line #

Patch Set 11 : Fix revert of revert diffs and add more tests #

Patch Set 12 : Handle unchanged file modes for 'M' #

Patch Set 13 : Rebased to 3df35f55de67 #

Patch Set 14 : Adding a javascript prompt and emailing revert and original CLs #

Patch Set 15 : Adding NOTREECHECKS keyword #

Patch Set 16 : Stop sending every Issue parameter to /revert_issue/ #

Patch Set 17 : Cleanup #

Patch Set 18 : Fix Typo #

Patch Set 19 : Remove app.yaml #

Total comments: 31

Patch Set 20 : Addressing review comments #

Total comments: 1

Patch Set 21 : Cleanup #

Patch Set 22 : More cleanup #

Patch Set 23 : Addressing code review comments #

Patch Set 24 : Cleanup #

Patch Set 25 : Add info text when button is disabled #

Total comments: 18

Patch Set 26 : Addressing code review comments #

Total comments: 12

Patch Set 27 : Addressing code review comments #

Patch Set 28 : Addressing code review comments #

Patch Set 29 : Minor fix #

Patch Set 30 : Minor fixes #

Total comments: 4

Patch Set 31 : Addressing review comments #

Patch Set 32 : Addressing review comments #

Patch Set 33 : Addressing review comments #

Patch Set 34 : Creating @staticmethod #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1017 lines, -13 lines) Patch
M codereview/exceptions.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +4 lines, -0 lines 0 comments Download
A codereview/invert_patches.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +248 lines, -0 lines 0 comments Download
M codereview/models.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 31 3 chunks +48 lines, -1 line 0 comments Download
A codereview/revert_patchset.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 1 chunk +277 lines, -0 lines 0 comments Download
M codereview/urls.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +7 lines, -0 lines 0 comments Download
M codereview/views.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 6 chunks +12 lines, -12 lines 0 comments Download
M static/script.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +13 lines, -0 lines 0 comments Download
M templates/patchset.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +10 lines, -0 lines 0 comments Download
A tests/test_invert_patches.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 31 1 chunk +398 lines, -0 lines 0 comments Download

Messages

Total messages: 19
rmistry
10 years, 5 months ago (2013-11-11 21:30:15 UTC) #1
iannucci
I like this a lot, thank you for working on this :) https://codereview.appspot.com/22410044/diff/340001/codereview/invert_patches.py File codereview/invert_patches.py ...
10 years, 5 months ago (2013-11-12 03:20:01 UTC) #2
rmistry
https://codereview.appspot.com/22410044/diff/340001/codereview/invert_patches.py File codereview/invert_patches.py (right): https://codereview.appspot.com/22410044/diff/340001/codereview/invert_patches.py#newcode1 codereview/invert_patches.py:1: # Copyright 2013 Google Inc. On 2013/11/12 03:20:02, iannucci ...
10 years, 5 months ago (2013-11-12 22:00:37 UTC) #3
iannucci
https://codereview.appspot.com/22410044/diff/340001/codereview/views.py File codereview/views.py (right): https://codereview.appspot.com/22410044/diff/340001/codereview/views.py#newcode877 codereview/views.py:877: ' inconvenience.', status=404) Yeah, I know that's the way ...
10 years, 5 months ago (2013-11-13 00:12:32 UTC) #4
rmistry
https://codereview.appspot.com/22410044/diff/340001/codereview/views.py File codereview/views.py (right): https://codereview.appspot.com/22410044/diff/340001/codereview/views.py#newcode868 codereview/views.py:868: 'patchset =', original_patchset.key()) On 2013/11/12 22:00:38, rmistry wrote: > ...
10 years, 5 months ago (2013-11-13 17:51:35 UTC) #5
rmistry
https://codereview.appspot.com/22410044/diff/340001/templates/patchset.html File templates/patchset.html (right): https://codereview.appspot.com/22410044/diff/340001/templates/patchset.html#newcode172 templates/patchset.html:172: {%endif%} On 2013/11/13 00:12:32, iannucci wrote: > On 2013/11/12 ...
10 years, 5 months ago (2013-11-13 18:13:52 UTC) #6
M-A
A few style nits. https://codereview.appspot.com/22410044/diff/450001/app.yaml File app.yaml (right): https://codereview.appspot.com/22410044/diff/450001/app.yaml#newcode1 app.yaml:1: application: skia-codereview-staging Please don't commit ...
10 years, 5 months ago (2013-11-13 21:57:50 UTC) #7
rmistry
https://codereview.appspot.com/22410044/diff/450001/app.yaml File app.yaml (right): https://codereview.appspot.com/22410044/diff/450001/app.yaml#newcode1 app.yaml:1: application: skia-codereview-staging On 2013/11/13 21:57:51, M-A wrote: > Please ...
10 years, 5 months ago (2013-11-14 13:20:04 UTC) #8
M-A
https://codereview.appspot.com/22410044/diff/470001/codereview/invert_patches.py File codereview/invert_patches.py (right): https://codereview.appspot.com/22410044/diff/470001/codereview/invert_patches.py#newcode49 codereview/invert_patches.py:49: self._status = status Frankly, I wouldn't trust the status ...
10 years, 5 months ago (2013-11-14 14:12:31 UTC) #9
rmistry
https://codereview.appspot.com/22410044/diff/470001/codereview/invert_patches.py File codereview/invert_patches.py (right): https://codereview.appspot.com/22410044/diff/470001/codereview/invert_patches.py#newcode49 codereview/invert_patches.py:49: self._status = status On 2013/11/14 14:12:31, M-A wrote: > ...
10 years, 5 months ago (2013-11-14 15:05:04 UTC) #10
M-A
https://codereview.appspot.com/22410044/diff/470001/codereview/invert_patches.py File codereview/invert_patches.py (right): https://codereview.appspot.com/22410044/diff/470001/codereview/invert_patches.py#newcode49 codereview/invert_patches.py:49: self._status = status On 2013/11/14 15:05:04, rmistry wrote: > ...
10 years, 5 months ago (2013-11-14 17:30:55 UTC) #11
rmistry
Added logic to calculate the patch status from the diff header. Also, added support for ...
10 years, 5 months ago (2013-11-15 19:32:50 UTC) #12
rmistry
Friendly ping.
10 years, 5 months ago (2013-11-19 18:53:16 UTC) #13
rmistry
Friendly Ping.
10 years, 5 months ago (2013-11-21 22:36:06 UTC) #14
M-A
lgtm https://codereview.appspot.com/22410044/diff/550001/codereview/revert_patchset.py File codereview/revert_patchset.py (right): https://codereview.appspot.com/22410044/diff/550001/codereview/revert_patchset.py#newcode272 codereview/revert_patchset.py:272: 2 lines
10 years, 5 months ago (2013-11-22 18:40:09 UTC) #15
rmistry
https://codereview.appspot.com/22410044/diff/550001/codereview/revert_patchset.py File codereview/revert_patchset.py (right): https://codereview.appspot.com/22410044/diff/550001/codereview/revert_patchset.py#newcode272 codereview/revert_patchset.py:272: On 2013/11/22 18:40:10, M-A wrote: > 2 lines Done.
10 years, 5 months ago (2013-11-22 18:49:23 UTC) #16
iannucci
Dang, M-A beat me to it. I didn't really have many comments anyway. LGTM as ...
10 years, 5 months ago (2013-11-22 19:07:47 UTC) #17
rmistry
https://codereview.appspot.com/22410044/diff/550001/codereview/invert_patches.py File codereview/invert_patches.py (right): https://codereview.appspot.com/22410044/diff/550001/codereview/invert_patches.py#newcode100 codereview/invert_patches.py:100: self._status = get_patch_status(self._diff_header) On 2013/11/22 19:07:48, iannucci wrote: > ...
10 years, 5 months ago (2013-11-22 21:11:15 UTC) #18
rmistry
10 years, 5 months ago (2013-11-22 21:49:58 UTC) #19
Submitted, thanks Robbie and M-A for the detailed review.

I deployed it to https://1212-7e4874c31aa8.chromiumcodereview-hr.appspot.com/
Will test on Monday and give #chromium a heads-up (as recommended by Robbie)
before making it the Default.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b