Page MenuHomePhabricator

A cli tool to roll back maniphest task transactions
ClosedPublic

Authored by mmodell on Mar 29 2019, 3:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 6, 9:10 PM
Unknown Object (File)
Apr 26 2023, 8:58 PM
Unknown Object (File)
Mar 16 2023, 11:36 PM
Unknown Object (File)
Mar 15 2023, 2:12 PM
Unknown Object (File)
Mar 9 2023, 7:55 PM
Unknown Object (File)
Feb 28 2023, 11:11 AM
Unknown Object (File)
Feb 24 2023, 2:48 PM
Unknown Object (File)
Feb 22 2023, 5:20 PM
Subscribers

Details

Maniphest Tasks
Restricted Task
Reviewers
Aklapper
chasemp
Group Reviewers
Security-Team
Commits
rMWc9b4abef2e6b: Update patch set 1
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 Passed
Unit
No Test Coverage
Build Status
Buildable 3222
Build 5381: differential-jessie
Build 5380: arc lint + arc unit

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