commit | 9dce875de059e92204970d7d16c4a3f50ddc4d0f | [log] [tgz] |
---|---|---|
author | Patrick Hiesel <hiesel@google.com> | Thu Jul 27 13:32:06 2023 +0200 |
committer | Patrick Hiesel <hiesel@google.com> | Fri Jul 28 06:44:16 2023 +0000 |
tree | 8672579d176eac35536afd33473ab66a6e2dc16c | |
parent | 8ef8bfe936d01899e43a55cfb830bfb8a1d06272 [diff] |
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
See src/main/resources/documentation.
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
.