)]}'
{
  "commit": "9d732c942391765a344798ce3e8250b6569399f9",
  "tree": "7001dfd6b3f7ebf5f6c656a86eecbf62a2767614",
  "parents": [
    "ee9eb5b59fbce645cf5c24b927a60f70d1014a96"
  ],
  "author": {
    "name": "Jacek Centkowski",
    "email": "jcentkowski@collab.net",
    "time": "Fri Sep 08 17:17:27 2017 +0200"
  },
  "committer": {
    "name": "Jacek Centkowski",
    "email": "jcentkowski@collab.net",
    "time": "Wed Oct 18 13:20:21 2017 +0200"
  },
  "message": "Introduce events processor\n\nCurrent webhooks implementation supports stream-events like (native)\nevents. However, enabling implementation of different formats may be\nuseful.\n\nThe following steps were performed to enable it:\n* Configuration was changed to be extensible (this way adding more\nconfiguration options is achievable by injecting specific\nimplementation)\n\n* EventProcessor interface was introduced and it is responsible for\nhandling event according to provided remote configuration.\n\n* EventProcessor\u0027s process method is performed by executor in dedicated\nthread hence it could be resource consuming. In addition result of\nprocessing is kept in Supplier with cache (memoize) so that processing\nis not repeated when post gets repeated (for recoverable failure).\n\n* Default implementation is provided and injected within ProcessorModule\nthat could be overwritten with different implementations without\nnecessity to re-bind core webhook classes (HttpSession,\nHttpResponseHandler, etc) so that they can stay package-protected.\n\n4 steps to introduce own webhook implementation and preserve plugin\u0027s\nlogic for HTTP and configuration handling:\n1. implement EventProcessor or better AbstractEventProcessor as it\nalready checks if event is configured for remote\n2. extend Configuration and inject it directly in case more\nconfiguration options are required by implementation\n3. extend ProcessorModule to bind EventProcessor to its new\nimplementation\n4. add bindings for Configuration and ProcessorModule implementations\nand install Module so that all necessary bits (related to webhooks\nconfiguration and HTTP handling) are provided by Guice\n\nChange-Id: Id575eba9b5aedd917e2441a70ae87d43276d2ab1\nSigned-off-by: Jacek Centkowski \u003cjcentkowski@collab.net\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b374bdeb3bf91b962b48148e4e7b5643b8a659bd",
      "old_mode": 33188,
      "old_path": "src/main/java/com/googlesource/gerrit/plugins/webhooks/Configuration.java",
      "new_id": "5dda6b4518d01cf702019428f1e2ddc9acb295f8",
      "new_mode": 33188,
      "new_path": "src/main/java/com/googlesource/gerrit/plugins/webhooks/Configuration.java"
    },
    {
      "type": "modify",
      "old_id": "0b83fe1593d4647c5ff9e957ef4e260c6663b551",
      "old_mode": 33188,
      "old_path": "src/main/java/com/googlesource/gerrit/plugins/webhooks/EventHandler.java",
      "new_id": "a29014c1afd58d23dce63c533d7d9ac2acf7a6ab",
      "new_mode": 33188,
      "new_path": "src/main/java/com/googlesource/gerrit/plugins/webhooks/EventHandler.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "866df37ff5e62b194b9d9ddfa566d31503bb417d",
      "new_mode": 33188,
      "new_path": "src/main/java/com/googlesource/gerrit/plugins/webhooks/EventProcessor.java"
    },
    {
      "type": "modify",
      "old_id": "f59df7c1c452a46253236ec58222021377990a04",
      "old_mode": 33188,
      "old_path": "src/main/java/com/googlesource/gerrit/plugins/webhooks/Module.java",
      "new_id": "1b6c6afebb4d71368e7ca679742b58092737e456",
      "new_mode": 33188,
      "new_path": "src/main/java/com/googlesource/gerrit/plugins/webhooks/Module.java"
    },
    {
      "type": "modify",
      "old_id": "eeb6d4614171ce594bad175abd775783bb11d4e8",
      "old_mode": 33188,
      "old_path": "src/main/java/com/googlesource/gerrit/plugins/webhooks/PostTask.java",
      "new_id": "01548042bf8eccab60ef52a7cc105433afcf037a",
      "new_mode": 33188,
      "new_path": "src/main/java/com/googlesource/gerrit/plugins/webhooks/PostTask.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "8288327cc85ab645816a1ada4b06bb24e67290a0",
      "new_mode": 33188,
      "new_path": "src/main/java/com/googlesource/gerrit/plugins/webhooks/ProcessorModule.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0763204e0fb27bfae748c497d567da681f0b67ba",
      "new_mode": 33188,
      "new_path": "src/main/java/com/googlesource/gerrit/plugins/webhooks/RemoteConfig.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "8c727e084cb390dd9e5fc90f095b572fa243f74b",
      "new_mode": 33188,
      "new_path": "src/main/java/com/googlesource/gerrit/plugins/webhooks/processors/AbstractEventProcessor.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "b8532b48cc6d629e62fba62684043ea7b1e6a1cf",
      "new_mode": 33188,
      "new_path": "src/main/java/com/googlesource/gerrit/plugins/webhooks/processors/GerritEventProcessor.java"
    },
    {
      "type": "modify",
      "old_id": "56ef8c9e306ddd72c0e7df3519e804f714242ac2",
      "old_mode": 33188,
      "old_path": "src/test/java/com/googlesource/gerrit/plugins/webhooks/EventHandlerTest.java",
      "new_id": "eb677e1bfd6192efd1f39a948e29cc705808ec52",
      "new_mode": 33188,
      "new_path": "src/test/java/com/googlesource/gerrit/plugins/webhooks/EventHandlerTest.java"
    },
    {
      "type": "modify",
      "old_id": "cf41a4dc4f1487c313eb35078dd643815e2ae87c",
      "old_mode": 33188,
      "old_path": "src/test/java/com/googlesource/gerrit/plugins/webhooks/PostTaskTest.java",
      "new_id": "043828f90bad0576195a7ef49bff0de525ee5ac9",
      "new_mode": 33188,
      "new_path": "src/test/java/com/googlesource/gerrit/plugins/webhooks/PostTaskTest.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "d461487411a07899ffe7ae9db2c8ce65de337f17",
      "new_mode": 33188,
      "new_path": "src/test/java/com/googlesource/gerrit/plugins/webhooks/processors/AbstractEventProcessorTest.java"
    }
  ]
}
