馃殌 Bulk actions on changesets
Created by: sourcegraph-bot
Problem
User problem
Users creating batch changes with hundreds of changesets have to manage them across their lifecycle, until they get merged. Managing a large number of changesets is very clumsy and time consuming. For example in a large scale campaign, adding a comment with instructions for getting a batch change merged would take manually clicking, copy pasting, and creating a comment on dozens or hundreds changesets.
Use cases
-
I want to comment on changesets that are not merged so as to remind the repo owners that they have to take action.
-
I have created a batch change, and some changesets are erored, so I want to retry them.
-
I want to close all changesets that are starving and have been opened for more than 3 months.
-
I want to merge all of the changesets I filtered manually
Why this fits our goals
-
We want to make it easy to manage very large scale batch changes, and close the gap with existing internal solutions that have this feature.
-
Making the management of batch changes easy encourages developers to invest the time in creating a batch change and should increase adoption.
Solution
This generalizes into:
-
Filter changesets based on status, review, check status (and more to come eg. team)
-
And/or manually select a set of changesets
-
Then trigger an action
Scope
For the first iteration, I propose this scope:
-
Use existing filters (status, check, review)
-
Select changesets manually
-
Actions: comment, close, merge, retry
To be considered for future versions
-
Add reviewer from codeowners
-
Filter based on team
-
Filter based on plaintext search
-
Rebase
-
Filter changesets that have been opened for more than
ndays -
A specific list of checks have passed
-
changeset has been reviewed / changeset has not been reviewed
-
PR changes files matching rule (is at root, has extension (eg.
.yml))
Tasks in scope for now
-
Introduce ChangesetJob entity -
Implement dbworker for ChangesetJob processing -
Implement CreateCommentonChangesetSource -
Add tab to UI "Bulk jobs" -
Add notice bar when running or recently failed/completed bulk job exists for batch change -
Enable select UI on all changeset views -
Add "select all all" button to select UI -
Add mutation createBulkJob() -
Expose bulk jobs in GraphQL API -
Add documentation for bulk commenting feature
For release 3.28, the scope is commenting only.
Follow up work
#20866 (closed)
#20865 (closed)
#20867 (closed)
#21548 (closed)