Page MenuHomePhabricator

scap backport --revert command
Closed, ResolvedPublic3 Estimated Story Points

Description

As part of the backport deployment workflow, implement the following:

scap backport --revert change_url [change_url]
  1. Create revert on Gerrit
  2. Run scap backport for the commit in step 1 (which will sync—skipping all prompts)

Event Timeline

jeena renamed this task from scap backport --revert command to scap backport --rollback command.Jun 13 2022, 4:01 PM
jeena updated the task description. (Show Details)
jeena updated the task description. (Show Details)
thcipriani renamed this task from scap backport --rollback command to scap backport --revert command.Jun 13 2022, 4:47 PM
thcipriani updated the task description. (Show Details)
thcipriani set the point value for this task to 3.

Change 806352 had a related patch set uploaded (by Jeena Huneidi; author: Jeena Huneidi):

[mediawiki/tools/scap@master] scap backport: add revert option

https://gerrit.wikimedia.org/r/806352

Change 809094 had a related patch set uploaded (by Jeena Huneidi; author: Jeena Huneidi):

[mediawiki/tools/train-dev@master] Add test for scap backport --revert

https://gerrit.wikimedia.org/r/809094

Change 809094 merged by jenkins-bot:

[mediawiki/tools/train-dev@master] Add test for scap backport --revert

https://gerrit.wikimedia.org/r/809094

Change 806352 merged by jenkins-bot:

[mediawiki/tools/scap@master] scap backport: add revert option

https://gerrit.wikimedia.org/r/806352

dancy added a subscriber: bd808.

Feedback from @bd808 about scap backport --revert:

<bd808> Bryan Davis 
thcipriani: that TrainBranchBot revert process seems slick, but it is not leaving the common "this commit was reverted" linkage that one gets from using the gerrit UI. Might be a nice thing to try and figure out how to add.
Or at least include the hash of the commit being reverted in the commit message so its easier to follow in the reverse direction

Feedback from @bd808 about scap backport --revert:

<bd808> Bryan Davis 
thcipriani: that TrainBranchBot revert process seems slick, but it is not leaving the common "this commit was reverted" linkage that one gets from using the gerrit UI. Might be a nice thing to try and figure out how to add.
Or at least include the hash of the commit being reverted in the commit message so its easier to follow in the reverse direction

The gerrit UI triggered built-in for reverting does two things I like. It puts This reverts commit <git hash>. in the commit message. Having the hash makes it easier to find the antecedent than just having the prior commit subject. Random example from a quick gerrit search is https://gerrit.wikimedia.org/r/c/operations/puppet/+/829005

Revert "db2149: Disable notifications"

This reverts commit 9549250f32499b3f41e0122bba97c62414ac5c79.

Reason for revert: RAID back to optimal

Change-Id: Iea1c1d643ae9ec68777ef87c36e9496aad522ee7

That hash gets linked to a search in the Gerrit UI which then shows both commits: https://gerrit.wikimedia.org/r/q/9549250f32499b3f41e0122bba97c62414ac5c79

Second it adds a message in the change log of the antecedent stating "Created a revert of this change as <Change-Id>". An example from the same set of commits as before is https://gerrit.wikimedia.org/r/c/operations/puppet/+/827176/1#message-d9b879129f274d6f6095f0b7ae0282206bcec3b8. This is nice because it gives a very strong signal when encountering the prior patch in gerrit that it is no longer active (or at least was proposed to no longer be active at time).

I have no idea how much of a pain in the butt adding the comment behavior to scap backport --revert would be, and I don't think its worth more than a short investigation to be honest. Tweaking the commit message of the revert would be a solid improvement independently.

Change 829249 had a related patch set uploaded (by Jeena Huneidi; author: Jeena Huneidi):

[mediawiki/tools/scap@master] Scap backport --revert: improve commit message

https://gerrit.wikimedia.org/r/829249

Change 829249 merged by jenkins-bot:

[mediawiki/tools/scap@master] Scap backport --revert: improve commit message

https://gerrit.wikimedia.org/r/829249