DescriptionAdd support for patchset dependencies.
The following is a summary of my changes:
* A new endpoint "get_depends_on_patchset" has been added. This endpoint will be called by apply_issue to form a chain of dependencies to apply to the local checkout. The apply_issue change is here: https://codereview.chromium.org/1149653002/.
* I extracted majority of the new logic into a new module (dependency_utils) and added comprehensive unit tests.
* This CL adds two new fields to the PatchSet model. These fields define the dependency and the dependents of the patchset.
* The dependency and dependents of a patchset are displayed to the user but only in the new UI. I figure we are close enough to making the new UI the default that I can stop doing double UI work.
* I tried to cover all interactions among dependent patchsets, here is a example of dependencies and how different Rietveld actions will impact those dependencies-
-> CL3#PS2
CL1#PS2 -> CL2#PS1 -> CL3.1#PS1
-> CL3.1#PS2
Explanation of the above: CL3#PS2 & CL3.1#PS1 & CL3.1#PS2 all depend on CL2#PS1 which depends on CL1#PS2.
==Rietveld action: issue is closed and reopened==
- If CL2 is closed then CL2#PS1 shows up with a strikethrough in CL3#PS2 & CL3.1#PS1 & CL3.1#PS2.
- If CL2 is reopened then CL2#PS1 shows up normally (without a strikethrough) in CL3#PS2 & CL3.1#PS1 & CL3.1#PS2.
==Rietveld action: issue is deleted==
- If CL2 is deleted then CL3#PS2 & CL3.1#PS1 & CL3.1#PS2 are updated to remove their dependency on CL2#PS1.
Additionally, if any patchset of CL2 is a dependent then its dependency is removed. i.e. CL1#PS2 will be updated to remove CL2#PS1 as a dependent.
==Rietveld action: patchset is deleted==
- If CL2#PS1 is deleted then CL3#PS2 & CL3.1#PS1 & CL3.1#PS2 are updated to remove their dependency on CL2#PS1.
Additionally, if CL2#PS1 is a dependent then its dependency is removed. i.e. CL1#PS2 will be updated to remove CL2#PS1 as a dependent.
Tested end-to-end using a test Git repository (https://skia.googlesource.com/skiabot-test/) and the following CLs created in my test Rietveld instance:
* https://skia-codereview-staging.appspot.com/931002 ('Branch1 CL')
* https://skia-codereview-staging.appspot.com/5001001 ('Branch2 CL')
* https://skia-codereview-staging.appspot.com/9881001 ('Branch3 CL')
* https://skia-codereview-staging.appspot.com/3951001 ('Branch3.1 CL')
Opt into the new UI and observe the new 'Depends on Patchset' and 'Dependent Patchsets' sections in the above CLs.
Design doc is here: https://docs.google.com/document/d/1KZGFKZpOPvco81sYVRCzwlnjGctup71RAzY0MSb0ntc/edit#heading=h.6r6lt4tsvssw
BUG=502255
Committed: https://chromium.googlesource.com/infra/infra/+/be2d01f56f79233fb2fe216916469ac4c06c24a4
Patch Set 1 : Initial upload #Patch Set 2 : dependent_issue -> dependent_patchset #Patch Set 3 : Display depends on patchset (only in new UI) #Patch Set 4 : Dependent -> DependsOn #Patch Set 5 : Record and display dependent CLs #Patch Set 6 : Cleanup #Patch Set 7 : More cleanup #Patch Set 8 : Update dependencies when issue is closed or reopened #Patch Set 9 : Cleanup #Patch Set 10 : Extract into module and add comprehensive unittests #Patch Set 11 : Use the new patchset_dependency_utils module #Patch Set 12 : Lint unittests #Patch Set 13 : Update all patchsets in a CL when deleted or closed/re-opened #Patch Set 14 : Add ability to update dependents #Patch Set 15 : patchset_dependency_utils -> dependency_utils #Patch Set 16 : Add unittest for remove_as_dependent #Patch Set 17 : Remove buildbucket disabling code #Patch Set 18 : Remove debugging stmts #Patch Set 19 : Do not remove dependencies except for deletions and display closed issues with strikethrough #Patch Set 20 : Do not return dependency if the issue is closed #Patch Set 21 : Rebase #Patch Set 22 : Make get_depends_on_patchset return JSON instead of text #
Total comments: 2
Patch Set 23 : Change link text #Patch Set 24 : Rebase #Patch Set 25 : Fix lint issues in test #Messages
Total messages: 24 (10 generated)
|