Page MenuHomePhabricator

Closing old revisions
Closed, DuplicatePublic

Description

We have a lot of old diff that have more-or-less been abandoned. The status of the diffs, however, is still open.

In many cases, the author of the diff is no longer with our company and there is little chance that the diff remains useful. In other cases the diff was accepted and landed but never closed.

I am looking for a way to close these diffs on behalf of another user. I am aware that I could commandeer the revision and abandon it myself, but this doesnt seem like the correct course of action.

Event Timeline

joshuaspence assigned this task to epriestley.
joshuaspence raised the priority of this task from to Wishlist.
joshuaspence updated the task description. (Show Details)
joshuaspence added a project: Differential.
joshuaspence added a subscriber: joshuaspence.

This is partially a duplicate of T4720 (which doesn't including closing diffs)

T4720 is one approach, commandeer + abandon is another.

If you set differential.always-allow-close in your config, you should be able to close other users' accepted revisions (I think arc close-revision will work from the CLI, too, which might make the process a little easier).

The approach used at Facebook is to ignore these revisions. Our experience there was that active users will naturally accumulate a large number of long-term, open revisions (for example, I have roughly 100 on my dashboard after ~3 years on this project) and these will tend to outnumber the number of revisions which are totally detached from an owner (and, at least when people left on good terms, they would usually try to reassign all their tasks and do something with their revisions before their last day).

You can force these revisions to "Abandoned" by setting the differential_revision.status column to the value 4, or closed with value 3 -- just be careful about this, as there's no easy way to revert to the prior value if you touch too many columns. These constants are defined in src/differential/constants/ArcanistDifferentialRevisionStatus.php. This won't leave an audit trial, of course.

I'm going to merge this in to T4720 since I think that's probably the best approximation of the missing features, given the existence of differential.always-allow-close. There's no flag to let you close out of non-accepted states, but presumably that only applies to a very small fraction of revisions.