Add REST endpoint to rename an email in code owner config files of one branch

This REST endpoint updates code owner config files programmatically. If
it would update the emails by parsing, updating and then formatting code
owner config files, comments in the code owner config files would be
lost (since they are not read and remembered during parsing). Instead
this REST endpoint replaces emails in code owner config files on text
level by doing a string replacement. To match email strings in code
owner config files correctly, we need backend specific knowledge about
the syntax, e.g. which characters can appear before and after an email.
Doing a simple string replacement (replace oldEmail-string with
newEmail-string) would wrongly affect emails that contain the oldEmail
as a substring.

This REST endpoint cannot be used to assign the code ownerships of one
user to another user, but requires that the old and new emails belong to
the same account.

This REST endpoint requires the caller to be project owner or have
direct push permissions to the branch.

It is intended that this REST endpoint is used by a service or bot that
takes care of updating code owner config files when a user changes their
email, as the email update potentially needs to be done in all repos and
all branches.

Change-Id: I3d930b03503dcc6a212736e37ea9ab00b9e6952d
Signed-off-by: Edwin Kempin <ekempin@google.com>
14 files changed
tree: 384e0ab33175faf9973df81c3b2dc2d7c705706c
  1. java/
  2. javatests/
  3. proto/
  4. resources/
  5. test/
  6. ui/
  7. .eslintrc.json
  8. .gitignore
  9. .gitreview
  10. bower.json
  11. BUILD
  12. LICENSE
  13. package-lock.json
  14. package.json
  15. README.md
README.md

Gerrit Code Review code-owners plugin

This plugin provides support for defining code owners for files in a repository.

If the code-owners plugin is enabled, changes can only be submitted if all touched files are covered by approvals from code owners.

Also see resources/Documentation/about.md

IMPORTANT: Before installing/enabling the plugin follow the instructions from the setup guide, see resources/Documentation/setup-guide.md