Class DeleteZombieCommentsRefs


  • public class DeleteZombieCommentsRefs
    extends Object
    This class can be used to clean zombie draft comments refs. More context in https://gerrit-review.googlesource.com/c/gerrit/+/246233

    The implementation has two cases for detecting zombie drafts:

    • An earlier bug in the deletion of draft comments refs/draft-comments/$change_id_short/$change_id/$user_id caused some draft refs to remain in Git and not get deleted. These refs point to an empty tree. We delete such refs.
    • Inspecting all draft-comment refs. Check for each draft if there exists a published comment with the same UUID. These comments are called zombie drafts. If the program is run in dryRun mode, the zombie draft IDs will only be logged for tracking, otherwise they will also be deleted.