)]}'
{
  "commit": "9d2aab0a3a6c0b094366720acdbabcac71a5b9b0",
  "tree": "b24c21b33fbbff45ad9803bfda4d286f5a890532",
  "parents": [
    "7bf7837120b194ff653c4b269d9ea28ee5678df4"
  ],
  "author": {
    "name": "Edwin Kempin",
    "email": "ekempin@google.com",
    "time": "Thu Aug 01 11:14:46 2024 +0000"
  },
  "committer": {
    "name": "Edwin Kempin",
    "email": "ekempin@google.com",
    "time": "Fri Aug 02 07:03:37 2024 +0000"
  },
  "message": "Return web links for OWNERS files when listing code owners\n\nWhen listing code owners the response contains the code owner config\nfiles (e.g. OWNERS files) that have been inspected to gather the code\nowners. Knowing the inspected code owner config files is important if\nyou want to verify that the correct code owners have been returned or if\nyou want to understand why a certain expected code owner was not\nincluded, as in this case you want to look into these code owner config\nfiles to see which code owners and rules they define. So far, we\nreturned the project, branch and path for the code owner config files,\nwhich is sufficient to locate the code owner config files, but\nassembling the links to the code owner config files from this\ninformation is cumbersome and can take significant time, especially if\nyou need to inspect multiple code owner config files. To save this\neffort we now return file web links for the code owner config files.\nHaving file web links available makes the lookup of code owner config\nfiles much easier, as they contain the direct URLs to the code owner\nconfig files.\n\nNote that file web links are only available if they are configured.\n\nCodeOwnerConfigFileJson is the class that writes the JSON for the\nreturned code owner config files. In this class we need to set the new\nCodeOwnerConfigFileInfo.webLinks field. To create the file web links we\nneed the project, branch and path of the code owner config file, but\nalso the revision from which it was read. The revision was not available\nin CodeOwnerConfigFileJson since it only got the CodeOwnerConfig.Key as\ninput which doesn\u0027t contain the revision. To make the revision available\nwe have to provide CodeOwnerConfig instead of CodeOwnerConfig.Key.\n\nCodeOwnerConfigFileJson also gets imported code owner config files as\ninput which are formatted in the same way as the importing code owner\nconfig file. To include web links for them too CodeOwnerConfigImport\nneeds to be extended to contain CodeOwnerConfig, which contains the\nrevision, instead of only CodeOwnerConfig.Key.\n\nSince some imports can be unresolved (e.g. an import that references an\nnon-existing code owner config file) the imported CodeOwnerConfig in\nCodeOwnerConfigImport is optional (i.e. it is not set for unresolved\nimports). This means, if an import is unresolved no web links are\nreturned for it.\n\nDue to CodeOwnerConfigImport needing the imported CodeOwnerConfig for\nresolved imports now, we need to provide it in PathCodeOwners which is\nresponsible for resolving the imports and also in quite some tests.\n\nBug: Google b/345161989\nChange-Id: If7efad1ffaf456a192ccea2e09d76b19d8f3b4fa\nSigned-off-by: Edwin Kempin \u003cekempin@google.com\u003e\nReviewed-on: https://gerrit-review.googlesource.com/c/plugins/code-owners/+/434337\nReviewed-by: Kamil Musin \u003ckamilm@google.com\u003e\nTested-by: Zuul \u003czuul-63@gerritcodereview-ci.iam.gserviceaccount.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "41fa62b42ccbfee0fa821212bf1170547148ac7a",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/api/CodeOwnerConfigFileInfo.java",
      "new_id": "4e9863b642462fa0442735aca333f07671e93fac",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/api/CodeOwnerConfigFileInfo.java"
    },
    {
      "type": "modify",
      "old_id": "a75c15b9215ec4fdcfa56e31e63d38ee79f6e09c",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerConfigImport.java",
      "new_id": "fc1b521a7ee03e1daa1fcd6a975df20b395051fc",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerConfigImport.java"
    },
    {
      "type": "modify",
      "old_id": "5e7a11fb76812183a27c07ebcc9101b475fdfd28",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/PathCodeOwners.java",
      "new_id": "ac4f4eb714f59d5ce94db5cb518adcb60bbdff7d",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/PathCodeOwners.java"
    },
    {
      "type": "modify",
      "old_id": "794646868cd48f5192da851c88a0ac725d07c9af",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/UnresolvedImportFormatter.java",
      "new_id": "9f96afca894c5327abc7f7a67ecc1de295e8f485",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/UnresolvedImportFormatter.java"
    },
    {
      "type": "modify",
      "old_id": "0fbb01d3eec2a5945c2594bb73deaba231ec7138",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/restapi/AbstractGetCodeOwnersForPath.java",
      "new_id": "1ddaa9ba81f8fc1bf246ade4db33ae972a9fa858",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/restapi/AbstractGetCodeOwnersForPath.java"
    },
    {
      "type": "modify",
      "old_id": "fe17a3fba2a76974c85e4bf13aa5294d5bbeaf24",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/restapi/CodeOwnerConfigFileJson.java",
      "new_id": "ed59a8ee33ff621a1d45c81a7e51c9bafd2306b8",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/restapi/CodeOwnerConfigFileJson.java"
    },
    {
      "type": "modify",
      "old_id": "b6efbc64da7b105983d4b0d270a1521e4f358cbc",
      "old_mode": 33188,
      "old_path": "javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnerConfigImportTest.java",
      "new_id": "85e7eb57a05b3b7c374efc7ca890793a20910cd4",
      "new_mode": 33188,
      "new_path": "javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnerConfigImportTest.java"
    },
    {
      "type": "modify",
      "old_id": "deab8177bb3ce81a9e8e83c7a12f4bb28df1d072",
      "old_mode": 33188,
      "old_path": "javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolverResultTest.java",
      "new_id": "febdf6b160b5ba858b01a1b87354c96495ff4a04",
      "new_mode": 33188,
      "new_path": "javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolverResultTest.java"
    },
    {
      "type": "modify",
      "old_id": "a33835d8e361917dcd57da820d7509f5acae2a24",
      "old_mode": 33188,
      "old_path": "javatests/com/google/gerrit/plugins/codeowners/backend/PathCodeOwnersResultTest.java",
      "new_id": "2970d717fded357ec37cee706c27baa2b04878e3",
      "new_mode": 33188,
      "new_path": "javatests/com/google/gerrit/plugins/codeowners/backend/PathCodeOwnersResultTest.java"
    },
    {
      "type": "modify",
      "old_id": "73d1e3d05ad1a5b2c6c70369f8575409501e478f",
      "old_mode": 33188,
      "old_path": "javatests/com/google/gerrit/plugins/codeowners/backend/PathCodeOwnersTest.java",
      "new_id": "8c6716173f7a65b1cf98708e56049d55001c70e2",
      "new_mode": 33188,
      "new_path": "javatests/com/google/gerrit/plugins/codeowners/backend/PathCodeOwnersTest.java"
    },
    {
      "type": "modify",
      "old_id": "ed0b301229dfb5cd2ef8bd4bc1e383df4ef96c99",
      "old_mode": 33188,
      "old_path": "javatests/com/google/gerrit/plugins/codeowners/restapi/CodeOwnerConfigFileJsonIT.java",
      "new_id": "fa1d9c8300e5cd542df57d489f9fb7f6de42e27d",
      "new_mode": 33188,
      "new_path": "javatests/com/google/gerrit/plugins/codeowners/restapi/CodeOwnerConfigFileJsonIT.java"
    },
    {
      "type": "modify",
      "old_id": "ace28a0584b6c35ef7ef1998d53bc34903b1d21d",
      "old_mode": 33188,
      "old_path": "resources/Documentation/rest-api.md",
      "new_id": "d694667e3f526babe819a975e9f399da5ece9ed5",
      "new_mode": 33188,
      "new_path": "resources/Documentation/rest-api.md"
    }
  ]
}
