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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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

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 test plan for this revision. (Show Details)
mmodell updated the revert plan for this revision. (Show Details)
greg added inline comments.
src/workflow/RollbackTransactionsWorkflow.php
357

What does the UI look like after that point?

src/workflow/RollbackTransactionsWorkflow.php
357

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

  • Added offset and limit arguments
  • Improved console output
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).

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.
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