commit | 80e8f30d03287f77a3e84428ef5ac0d31eedb1bc | [log] [tgz] |
---|---|---|
author | Edwin Kempin <ekempin@google.com> | Fri Feb 04 14:54:09 2022 +0100 |
committer | Edwin Kempin <ekempin@google.com> | Fri Feb 04 15:08:08 2022 +0100 |
tree | 3623cc519a0ff1ad0f258c3dcdebed37aa3a01a5 | |
parent | 1897989462dd8ce8724914abfdb842825fd04d09 [diff] |
Make log less verbose if change message extention fails due to config error CodeOwnersOnAddReviewer extends the change message when a code owner is added as a reviewer. It lists the owned paths in the message. If any relevant OWNERS file is invalid and cannot be parsed, we cannot compute the owned files, and hence the message cannot be extended in this case. Adding the reviewer succeeds but only the change message that is posted for it doesn't contain any owned files. This works as intended, but we log a verbose error (with stacktrace) in this case that is not needed. Fix the exeption handling so that we log a warning only if the exception is caused by a configuration error. Otherwise still log the verbose error so that it can be investigated when it happens. OnCodeOwnerApproval extends the change message when a code owner approval is applied. Similarly to CodeOwnersOnAddReviewer we cannot extend the message if relevant OWNERS files are invalid. Here too the exception was ignored and logged with stacktrace. Catching and logging this exception was done generically by PluginContext. Now we are handling the exception on our own, so that also here we can log a warning only when the exception is caused by a configuration error. Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: I0d1b3cf747643fd7bef512e6dce0fbd8bb940da9
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.
For testing the plugin with Gerrit FE Dev Helper build the JavaScript bundle and copy it to the plugins/
folder:
bazel build //plugins/code-owners/ui:code-owners cp -f bazel-bin/plugins/code-owners/ui/code-owners.js plugins/
and let the Dev Helper redirect from .+/plugins/code-owners/static/code-owners.js
to http://localhost:8081/plugins_/code-owners.js
.