Support ChangeUpdates from InternalUser

In a few codepaths, such as auto-abandoning open changes on deleted
projects, we might have ChangeMessages with no Account.Id, indicating
the message was written by the server. Support this in notedb by
comparing the author and committer on the meta commit. Fail during
parsing if we would need to store a null account anywhere other than
the ChangeMessage.

Change-Id: Ie3f087e5bd326747906a6d824f721ee97ab9f9c6
This commit is contained in:
Dave Borowitz
2016-02-19 16:28:18 -05:00
parent d8bce6c90b
commit 15cddfecc0
9 changed files with 113 additions and 14 deletions

View File

@@ -234,7 +234,7 @@ public class ChangeDraftUpdate extends AbstractChangeUpdate {
protected CommitBuilder applyImpl(ObjectInserter ins)
throws OrmException, IOException {
CommitBuilder cb = new CommitBuilder();
cb.setAuthor(newIdent(getUser().getAccount(), when));
cb.setAuthor(newAuthorIdent());
cb.setCommitter(new PersonIdent(serverIdent, when));
cb.setMessage("Update draft comments");
AtomicBoolean removedAllComments = new AtomicBoolean();