Files
gerrit/gerrit-server
Dave Borowitz 8079bb0882 ChangeRebuilderImpl: Support deleting patch set 1 of a change
We were hard-coding patch set 1 and only including the Branch and
Change-id footers in the ChangeUpdate for this change. However, if PS1
of a change was a deleted draft, then this patch set won't be in
ReviewDb, so we would never write those footers. That results in an
exception during rebuilding like:

 com.google.gwtorm.server.OrmException: org.eclipse.jgit.errors.ConfigInvalidException: Change 64: Missing footers: Branch, Change-id
 	at com.google.gerrit.server.notedb.AbstractChangeNotes.load(AbstractChangeNotes.java:134)

Instead, keep track of the earliest patch set that we actually have
for a change, and record the mandatory footers in the update for that
change.

This issue only applies to rebuilding changes from ReviewDb, as patch
set deletion in native NoteDb happens by adding tombstone records, and
does not affect the root commit in the change meta graph.

Add tests for deleting a subset of patch sets to DeleteDraftPatchSetIT
to get some coverage for this case.

Bug: Issue 4084
Change-Id: I36da735cabc9a5eddbda0a55c086027c0b2ad031
2016-04-27 17:11:10 -04:00
..