Close and Delete a Batch Change
Learn in detail about how to close, delete, and opt out of a Batch Change.
You can close a batch change when you no longer need it, when all changes have been merged, or when you decide not to make changes. A closed batch change still appears in the batch changes list. To completely remove it, you can delete the batch change.
Any user with admin access to the batch change can close or delete it.
Close a batch change
To close the batch change, do the following:
- Click the Batch Changes icon in the top navigation bar
- From this list, click the batch change that you'd like to close or delete
- In the top right, click the Close button
- Select whether you want to close all of the batch change's open changesets (e.g., closing all associated GitHub pull requests on the code host)
- Click Close batch change
- Once a batch change is closed, it can't be updated or reopened anymore
Delete a batch change
To delete a batch change, follow these steps:
- First, close the batch change
- Instead of a Close batch change button you'll now see a Delete button
- Click Delete. The batch change has been deleted from the Sourcegraph instance. The changesets it created (and possibly closed) will still exist on the code hosts since most code hosts don't support deleting changesets
Opt out of batch changes
Repository owners that are not interested in batch change changesets can opt-out so that their repository will be skipped when a batch spec is executed. To opt-out:
- Create a file called
.batchignore
at the root of the repository you wish to be skipped - Now,
src batch [apply|preview]
will skip that repository if it's yielded by theon
part of the batch spec
-force-override-ignore
flag to override that behavior and not skip any ignored repositories.Ownership
When a user is deleted, their Batch Changes become inaccessible in the UI but the data is not permanently deleted. This allows recovering the Batch Changes if the user is restored.
However, if the user deletion is permanent, deleting both account and data, then the associated Batch Changes are also permanently deleted from the database. This frees storage space and removes dangling references.