Page MenuHomePhabricator

A cli tool to roll back maniphest task transactions
ClosedPublic

Authored by mmodell on Mar 29 2019, 3:31 PM.

Details

Maniphest Tasks
Restricted Task
Reviewers
Aklapper
chasemp
Group Reviewers
Security-Team
Commits
rPHEXce86c50a85a5: Add a cli tool to roll back transactions
Patch without arc
git checkout -b D1145 && curl -L https://phabricator.wikimedia.org/D1145?download=true | git apply
Summary

cli in ./bin/rollback

Support for rolling back project edits is currently half-baked but the maniphest rollback works.

Test Plan

./bin/rollback execute --user some_vandal -d

Unfortunately there aren't any unit tests currently. I'll work on adding some.

Revert Plan

This is entirely self contained, no need for any revert plan.

Diff Detail

Repository
rPHEX phabricator-extensions
Branch
wmf/stable
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 3220
Build 5377: differential-jessieJenkins
Build 5376: arc lint + arc unit

Event Timeline

mmodell created this revision.Mar 29 2019, 3:31 PM
mmodell requested review of this revision.Mar 29 2019, 3:31 PM
mmodell planned changes to this revision.Mar 29 2019, 3:32 PM

This is work in progress - it doesn't currently apply the transactions and it doesn't handle every kind of transaction yet.

mmodell updated this revision to Diff 2977.Mar 30 2019, 3:50 AM

It works!

mmodell added inline comments.Mar 30 2019, 3:53 AM
src/workflow/RollbackTransactionsWorkflow.php
357

Question: should we delete transactions that have been reversed, to clean up the task details? It seems like a good idea except that it's destructive of data.

mmodell retitled this revision from WIP: Add a cli tool to roll back transactions to A cli tool to roll back maniphest task transactions.
mmodell changed the visibility from "Public (No Login Required)" to "Custom Policy".Mar 30 2019, 3:57 AM
mmodell added a task: Restricted Task.
mmodell edited the summary of this revision. (Show Details)Mar 30 2019, 4:02 AM
mmodell edited the test plan for this revision. (Show Details)
mmodell updated the revert plan for this revision. (Show Details)
greg edited the summary of this revision. (Show Details)Mar 30 2019, 6:30 AM
greg added inline comments.
src/workflow/RollbackTransactionsWorkflow.php
357

What does the UI look like after that point?

mmodell added inline comments.Mar 30 2019, 7:50 AM
src/workflow/RollbackTransactionsWorkflow.php
357

if we remove the transactions then it's as if they never existed.

mmodell updated this revision to Diff 2979.Apr 2 2019, 5:50 AM
  • Added offset and limit arguments
  • Improved console output
greg added inline comments.Apr 2 2019, 3:19 PM
src/workflow/RollbackTransactionsWorkflow.php
357

fine with me then :) We just need to be sure we only run this on solely spamming accounts (ie: it's not a tool to run against someone who turned bad/decided to burn bridges after a some time span of being useful).

chasemp accepted this revision.Apr 3 2019, 7:15 PM

AFAICT this should work, it's too much to eyeball without testing and we are going to kick the tires a bit before going live but concept is solid.

This revision is now accepted and ready to land.Apr 3 2019, 7:15 PM
This revision was landed with ongoing or failed builds.Apr 3 2019, 7:34 PM
This revision was automatically updated to reflect the committed changes.
Aklapper added inline comments.Apr 7 2019, 6:17 PM
src/workflow/RollbackTransactionsWorkflow.php
357

I'd also vote for deleting transactions. Scrolling through the vandalism stuff in Phab tasks is distracting.

mmodell changed the visibility from "Custom Policy" to "Public (No Login Required)".Aug 2 2019, 2:30 PM