DescriptionOne-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 #
MessagesTotal messages: 19
|