commit | da713fe199a8319d99bb5805180b9767bcc0f16e | [log] [tgz] |
---|---|---|
author | Edwin Kempin <ekempin@google.com> | Fri Feb 04 16:01:40 2022 +0100 |
committer | Edwin Kempin <ekempin@google.com> | Mon Feb 07 12:52:42 2022 +0100 |
tree | e027051f91c3cc4215f413dbd88391ad65d9dd94 | |
parent | 80e8f30d03287f77a3e84428ef5ac0d31eedb1bc [diff] |
Do not throw code owners ISE if cause is DiffNotAvailableException For internal server errors that occur in the code-owners plugin we throw a specific RuntimeException (CodeOwnersInternalServerErrorException). If this exception is thrown we let the user know that there was an internal server error in the code-owners plugin, instead of just saying that there was an internal server error. This was done to root cause exceptions that were caused by the code-owners plugin more quickly to the code-owners plugin. However not all exceptions that happen in the code-owners plugin are caused by the code-owners plugin. E.g. if the code-owners plugin invokes functionality in Gerrit core and a failure happens there then the exception is caused by Gerrit core and not the code-owners plugin. So far these false positives were not a big issue since by looking at the cause detecting them was easy. However lately there are often failures caused by corrupted data in Git that cause DiffNotAvailableException's in Gerrit core when trying to get the file diff for a commit. This is functionality that the code-owners plugin invokes frequently and hence the code-owners plugin is often affected by this. In these cases users and also developers investigating the issue blame the code-owners plugin for the error. This is bad since it delays investigating the actual root cause. So for this particular case we stop throwing CodeOwnersInternalServerErrorException, but instead throw StorageException, so that this becomes a regular Gerrit internal server error, which is what it is. This doesn't change the stacktrace of the exception, but only the exception type. So from the stacktrace you can still see that the error affected the code-owners plugin. Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: Ie191c7f0137656199b8fa5d19ab49e9bd0344a6f
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
.