Record reviewer state in notes database

Stop implicitly adding/removing reviewers by adding an arbitrary
PatchSetApprovals with a 0 vote. This is ugly and error-prone,
especially when LabelTypes change.

Instead, use the existing ReviewerState enum, adding a REMOVED type
as a tombstone. When parsing, record these during the walk, and prune
all REMOVED tombstones after the fact.

Change-Id: Iffb0517eb0162eb6cce66bf36d905a6eb60e75da
This commit is contained in:
Dave Borowitz
2013-12-09 15:11:15 -08:00
parent d2d4d1cead
commit 89aa86394e
11 changed files with 519 additions and 161 deletions

View File

@@ -18,8 +18,8 @@ import com.google.common.collect.Multimap;
import com.google.gerrit.common.errors.NoSuchAccountException;
import com.google.gerrit.reviewdb.client.Account;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gerrit.server.ApprovalsUtil.ReviewerState;
import com.google.gerrit.server.account.AccountResolver;
import com.google.gerrit.server.notedb.ReviewerState;
import com.google.gwtorm.server.OrmException;
import org.eclipse.jgit.revwalk.FooterKey;