)]}'
{
  "commit": "cf928f1d78b675f1cec7039d8b345f810c8f48fe",
  "tree": "9325b4791dc998e0b70b158cf058a895b8c06fb5",
  "parents": [
    "076e85045628941591b91c244a14cc4ffc57a599"
  ],
  "author": {
    "name": "Edwin Kempin",
    "email": "ekempin@google.com",
    "time": "Wed Apr 05 08:19:39 2023 +0000"
  },
  "committer": {
    "name": "Edwin Kempin",
    "email": "ekempin@google.com",
    "time": "Wed Apr 05 08:53:31 2023 +0000"
  },
  "message": "Fix async change message that lists owned path on PostReview\n\nSupport for posting the owned paths asynchronously when a code owner\napproval is applied was implemented by change I129e611af.\n\nAt the moment the asynchronous message posting is triggered via the\nOnPostReview#getChangeMessageAddOn extension point. This extension point\nis intended to let plugins extend the change message that is posted by\nPostReview.\n\nTriggering the asynchronous message posting from this extension point\nhas issues:\n\n* When the asynchronous message posting is triggered PostReview is not\n  done yet, i.e. it didn\u0027t commit its updates the change meta ref yet.\n  This means now there is a race between PostReview and the extension to\n  update the change meta ref, which makes it likely that one of the\n  updates fails due to LockFailure.\n\n* Since there is a race with updating the change meta ref, the order in\n  which the messages are posted is undefined, but we want the PostReview\n  message to be posted first.\n\n* If the update that is applied by PostReview fails with LockFailure,\n  the whole operation, including the triggering of async message, is\n  retried. This can lead to a situation where the change message with\n  the owned path is created twice:\n  1. posting the async message succeeds, but the update from PostReview\n     fails due to LockFailure (e.g. due to the problem described above,\n     but LockFailures are also common due to other reasons)\n  2. PostReview is retried\n  3. posting the update from PostReview succeeds, but triggers the async\n     message again which also succeeds (posting the async message is\n     also retried on LockFailure, so it will likely succeed if the\n     PostReview update is applied first)\n\nFix this by not triggering the async posting of the owned paths from the\nOnPostReview#getChangeMessageAddOn extension point, but from the\nCommentAddedListener#onCommentAdded extension point which is only\ninvoked after the PostReview update has been applied.\n\nBug: Google b/276879211\nSigned-off-by: Edwin Kempin \u003cekempin@google.com\u003e\nChange-Id: I4d32542457de2f50b25eb7bf57f5f504720131ab\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "cba940967be5939c533e333b11de0fbcd4d1c021",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/BackendModule.java",
      "new_id": "55421e9458f6c60ceba6b729554f00a4594e518d",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/BackendModule.java"
    },
    {
      "type": "modify",
      "old_id": "e7c03b167489a4ca542160b3a9a3f2416a5328e5",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/OnCodeOwnerApproval.java",
      "new_id": "39775212b220b46671b52b56f0d068eb5055c5f7",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/OnCodeOwnerApproval.java"
    },
    {
      "type": "modify",
      "old_id": "d31cbfb4e539c1fc03f65921f689079b58c72756",
      "old_mode": 33188,
      "old_path": "javatests/com/google/gerrit/plugins/codeowners/acceptance/api/OnCodeOwnerApprovalIT.java",
      "new_id": "3875eb9e4b05d121662b53b3587f6f3423115daf",
      "new_mode": 33188,
      "new_path": "javatests/com/google/gerrit/plugins/codeowners/acceptance/api/OnCodeOwnerApprovalIT.java"
    }
  ]
}
