Files
gerrit/gerrit-server/src/main/java/com/google
Dave Borowitz c230ccccb1 Record real user in database for approvals/messages/comments
Add a new field to PatchSetApproval, ChangeMessage, and
PatchLineComment that records the real user as reported by
CurrentUser. For compatibility with the old value in the database and
to avoid a migration, use null when the effective user is the real
user. However, in most other code, following the example of
CurrentUser, always return a non-null value from getters even when
effective and real users are the same.

On the NoteDb side, add a new optional footer and comment field
"Real-user" to indicate this situation. In NoteDb commits, leave the
effective user in the git committer field, reflecting the fact that
for most purposes, we care about the effective user, and have to look
a little closer to see whether there was another caller involved.

In theory we could add real user fields to other entities, like
Change and PatchSet, to reflect the fact that X-Gerrit-RunAs can be
used with arbitrary requests. However, for now, we are mostly
concerned explicit on_behalf_of support in PostReview and Submit, so
we only change entities that can be modified through those endpoints.

Change-Id: Iab5302f65321cc740376f4b4f117dd38b7496fc5
2016-10-10 12:01:03 -04:00
..