Store draft PatchLineComments in Git notes
The draft comments for a user will be stored in their own unique ref
in the All-Users repository. The ref will look like
'refs/users/34/1234/comments-5678' where the user's accountId is 1234
and the change's changeId is 5678. Since these commits will live in a
different repository than the change at a different ref, I created two
new classes (ChangeDraftUpdate and DraftCommentNotes) to mimic the
workflow of ChangeNotes and ChangeUpdate.
The basic workflow is that when a draft comment is added, it will be
written to a note attached to the user's ref for the given change in
the All-Users repository. However, whenever a draft is published or
deleted, then it should be removed from that location and instead
written to the same place as the other published comments (in the
notes attached to the commits in the meta ref related to the given
change).
Additionally, I added a helper method to TestChanges to help construct
ChangeDraftUpdates for test. Finally, I added test coverage for
storing draft PatchLineComments in the notedb to ChangeNotesTest.
Change-Id: I178b039529937c2a65a0efed388ee6ca1043aaa7
12 files changed