)]}'
{
  "commit": "0021eafa47500a008367d98d6fa6e599eeb8e952",
  "tree": "5cdd5457ae0010558dcab855edacc756e12fa058",
  "parents": [
    "5feb3fd01007e0d9f66fc14759df0e71c7690de6"
  ],
  "author": {
    "name": "Edwin Kempin",
    "email": "ekempin@google.com",
    "time": "Wed Apr 21 10:06:20 2021 +0200"
  },
  "committer": {
    "name": "Edwin Kempin",
    "email": "ekempin@google.com",
    "time": "Wed Apr 21 10:06:33 2021 +0200"
  },
  "message": "Cache all parsed config values to avoid reparsing them\n\nThe code-owners plugin has quite a lot of configuration parameters that\nare accessed frequently. If reading config parameters is slow, this can\nsum up to a significant amount of latency.\n\nWhat we have done so far is that CodeOwnersPluginConfigSnapshot which\nreads the project specific plugin configuration is cached for the time\nof the request (see change If541bc329). This avoids loading the\ncode-owners.config file from this project and the parent projects again\nand again. However whenever a config parameter is needed, we still\nreparse it each time. Parsing a config parameter means inspecting the\nConfig that was read from the code-owners.config files and if necessary\nfall-back to inspecting the Config that was read from gerrit.config.\nWith this change we do the parsing only once and cache the result in\nCodeOwnersPluginConfigSnapshot.\n\nIn addition to project specific configuration parameters that are\nhandled by CodeOwnersPluginConfigSnapshot there are also a couple of\nglobal configuration parameters that are handled in\nCodeOwnersPluginConfiguration. For the global parameters we have the\nsame problem that they are reparsed on each access. E.g. the allowed\nemail domains are parsed each time a code owner email is resolved to an\naccount. This can be the reason why the step that resolves code owner\nemails to accounts is rather slow. To address this we follow the example\nof CodeOwnersPluginConfigSnapshot and add a\nCodeOwnersPluginGlobalConfigSnapshot class that handles the reading of\nthe global config parameters. Same as CodeOwnersPluginConfigSnapshot it\nis cached for the request time and internally it caches the parsed\nconfig values so that they need to parsed only once.\n\nTo make it clearer that CodeOwnersPluginConfigSnapshot is about reading\nproject-specific configuration parameters, it is renamed to\nCodeOwnersPluginProjectConfigSnapshot.\n\nChange-Id: I6e4c608133717b598d356d1ce76246eb19b08c4b\nSigned-off-by: Edwin Kempin \u003cekempin@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "0ba6d417f3485adf92efbb93b7a779dfcc3aacd6",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/BackendModule.java",
      "new_id": "e137ba740e547bcc1dae43bcb434a186de77a47f",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/BackendModule.java"
    },
    {
      "type": "modify",
      "old_id": "f98ecb85f483ddcebf682ca2fd5e8e4ad896a206",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerApprovalCheck.java",
      "new_id": "792087d06d6d922f8517e8dc0bd6cb0473bc79c5",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerApprovalCheck.java"
    },
    {
      "type": "modify",
      "old_id": "a1f1c34c3b8828f63304b0b3bf17cb09171b1118",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolver.java",
      "new_id": "f78804fbdb3e31e10f57faa534f44f34a9502ce0",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolver.java"
    },
    {
      "type": "modify",
      "old_id": "403fe49023d4dca23550ba7cfbe8a2905c24e667",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/CodeOwnersOnAddReviewer.java",
      "new_id": "1aa96603ac1b313f2b46a23b4f989c73f16193c7",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/CodeOwnersOnAddReviewer.java"
    },
    {
      "type": "modify",
      "old_id": "9803951d27db51b5fb56819db0762a9af75f86cf",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/OnCodeOwnerApproval.java",
      "new_id": "d6beb5f86d06a46a714a3960aff9055b7dfc96db",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/OnCodeOwnerApproval.java"
    },
    {
      "type": "modify",
      "old_id": "138623ffcf8c212382fc43433afe82077a6fbcef",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/OnCodeOwnerOverride.java",
      "new_id": "09e36241e67d771c92a66aedc47c64eb6e3766e0",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/OnCodeOwnerOverride.java"
    },
    {
      "type": "modify",
      "old_id": "65ec30899d56bc452cb594870b120b47f057a955",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/TransientCodeOwnerConfigCache.java",
      "new_id": "e8a1ab7d4ce6fd53b03cd1706b4491ad4041da28",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/TransientCodeOwnerConfigCache.java"
    },
    {
      "type": "modify",
      "old_id": "d070d819acfe3284aff573acc336f12eff2b3385",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginConfiguration.java",
      "new_id": "a216eb168d519119d82690f2b15989d3fe8ab26b",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginConfiguration.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "c466b8a697b211fd89b617da68db4a2530f2cc96",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginGlobalConfigSnapshot.java"
    },
    {
      "type": "rename",
      "old_id": "df0d4186ba00a994ef13362962ff4709f69b9f10",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginConfigSnapshot.java",
      "new_id": "0d0b44d77c43a24b3e80b1f0cbc32383ced19c6e",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginProjectConfigSnapshot.java",
      "score": 75
    },
    {
      "type": "modify",
      "old_id": "49053ec3f72a07ec74b4255e5c4681ecc8c36b07",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/restapi/CodeOwnerProjectConfigJson.java",
      "new_id": "7caf0a15712cdf2819c719eff9ca1b48ed16b5cc",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/restapi/CodeOwnerProjectConfigJson.java"
    },
    {
      "type": "modify",
      "old_id": "13474713afb2c58d1514107ddb9126fd1bb096f6",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/restapi/GetCodeOwnerConfigForPathInBranch.java",
      "new_id": "ac049d20c9a48df0fac1964476c8a76483025456",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/restapi/GetCodeOwnerConfigForPathInBranch.java"
    },
    {
      "type": "modify",
      "old_id": "8bb6fd7f91a76f218d9374130d80f1033319c175",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/validation/CodeOwnerConfigValidator.java",
      "new_id": "7ec5b1f6f8e28eb916b31ae37e2bb94de021c2e8",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/validation/CodeOwnerConfigValidator.java"
    },
    {
      "type": "modify",
      "old_id": "d9c3e14c33a935626d974246998dc32c0a8e6fca",
      "old_mode": 33188,
      "old_path": "javatests/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginConfigurationTest.java",
      "new_id": "28b15a643397c9d99565b6044ca9a057fd81ca03",
      "new_mode": 33188,
      "new_path": "javatests/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginConfigurationTest.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e38256692e46b4b4bfd1967f1b72acb037180fce",
      "new_mode": 33188,
      "new_path": "javatests/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginGlobalConfigSnapshotTest.java"
    },
    {
      "type": "rename",
      "old_id": "4b65a203731d5a249d0243390a2daa714da9a3d8",
      "old_mode": 33188,
      "old_path": "javatests/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginConfigSnapshotTest.java",
      "new_id": "f155572f790d7c6f734eb7eaad97a647487346d8",
      "new_mode": 33188,
      "new_path": "javatests/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginProjectConfigSnapshotTest.java",
      "score": 98
    },
    {
      "type": "modify",
      "old_id": "3e9b6140c5ee938a5e05aaf43fdd875865c5fce9",
      "old_mode": 33188,
      "old_path": "javatests/com/google/gerrit/plugins/codeowners/restapi/CodeOwnerProjectConfigJsonTest.java",
      "new_id": "9972afed03faaf55552b693a9b67bd98ed52c277",
      "new_mode": 33188,
      "new_path": "javatests/com/google/gerrit/plugins/codeowners/restapi/CodeOwnerProjectConfigJsonTest.java"
    }
  ]
}
