Perform work asynchronously

The automerger plugin performs expensive work on the request path. The
work isn't actually relevant for the request because it is not returned to the client. To the best of our knowledge, there are no clients that
immediately read back the actions triggered on downstream changes.

To meet SLOs, we do this work asynchrounously. Since the event data
types are mutable, we take a pragmatic approach to make this thread
safe that is deep copying the objects using GSON.

A failure in the old synchronous path had a similar effect as in the
newly asynchronous path (i.e. the downstream work is dropped).

Release-Notes: skip
Change-Id: I6693e014acc682f01bbf03af9219f1bb6969a131
1 file changed
tree: 8672579d176eac35536afd33473ab66a6e2dc16c
  1. src/
  2. web/
  3. .gitignore
  4. BUILD
  5. external_plugin_deps.bzl
  7. LICENSE-re2j

Gerrit Code Review Automerger Plugin

See src/main/resources/documentation.

Web Plugin Development

For running unit tests execute:

bazel test --test_output=all //plugins/automerger/web:karma_test

For checking or fixing eslint formatter problems run:

bazel test //plugins/automerger/web:lint_test
bazel run //plugins/automerger/web:lint_bin -- --fix "$(pwd)/plugins/automerger/web"

For testing the plugin with Gerrit FE Dev Helper build the JavaScript bundle and copy it to the plugins/ folder:

bazel build //plugins/automerger/web:automerger
cp -f bazel-bin/plugins/automerger/web/automerger.js plugins/

and let the Dev Helper redirect from .+/plugins/automerger/static/automerger.js to http://localhost:8081/plugins_/automerger.js.