)]}'
{
  "commit": "15a982f84093b14bb91c5849dabc957987079339",
  "tree": "329405bd093c7b0a516efbe955bb832983f04e81",
  "parents": [
    "6181ef2e0d89811328b1857bb86f0442009bb8dd"
  ],
  "author": {
    "name": "Edwin Kempin",
    "email": "ekempin@google.com",
    "time": "Wed Aug 07 14:43:35 2024 +0000"
  },
  "committer": {
    "name": "Edwin Kempin",
    "email": "ekempin@google.com",
    "time": "Mon Aug 12 09:40:06 2024 +0000"
  },
  "message": "PathCodeOwners: Flatten the return type (step 1/3)\n\nCurrently the path code owner computation returns\nOptionalResultWithMessages\u003cPathCodeOwnersResult\u003e:\n\n* OptionalResultWithMessages: arbitrary result (PathCodeOwnersResult in\n  this case) plus messages\n* PathCodeOwnersResult: the resolved CodeOwnerConfig plus\n  resolved/unresolved imports (PathCodeOwners resolves a CodeOwnerConfig\n  for the path for which code owners should be computed; resolving means\n  that non-matching per-file code owner sets are dropped, imported code\n  owner configs are loaded and replaced with the parts of them which\n  should be imported, global code owner sets are dropped if any matching\n  per-file code owner set has the ignoreGlobalAndParentCodeOwners flag\n  set to true and that the the ignoreParentCodeOwners flag is set to\n  true if any matching per-file code owner set has the\n  ignoreGlobalAndParentCodeOwners flag set to true; the result is called\n  a \"resolved\" CodeOwnerConfig)\n* CodeOwnerConfig: the resolved code owner config representing the\n  actual result of the path code owner resolution (relevant code owner\n  sets and the ignoreParentCodeOwners flag)\n\nThis unnecessarily complicated return type is the result of extending\nthe path code owners computation twice. Initially we just returned the\nresolved CodeOwnerConfig, but then we added OptionalResultWithMessages\nto return debug messages and then PathCodeOwnersResult to return\nresolved/unresolved imports.\n\nTo clean this up we want to include all return data in\nPathCodeOwnersResult and then just return PathCodeOwnersResult.\n\nTo make reviewing this refactoring easier, we do this cleanup in\nmultiple steps\n\n1. [this change] Drop usage of CodeOwnerConfig to return the relevant\n   code owner sets and the ignoreParentCodeOwners flag:\n\nAdd fields for the code owner sets and the ignoreParentCodeOwners flag\ndirectly to PathCodeOwnersResult. The other fields from CodeOwnerConfig\nare not used and also users of PathCodeOwnersResult never access the\nwrapped CodeOwnerConfig directly.\n\nNote, temporarily this adds more boiler-plate code for local vars that\ncollect the result data, but we will clean this up in a later step (see\nstep 3. below).\n\n2. [follow-up change] Drop usage of OptionalResultWithMessages:\n\nUsing OptionalResultWithMessages doesn\u0027t make sense since the path code\nowner computation always returns a result (i.e. the result is not\noptional).\n\nInstead include the debug messages directly into PathCodeOwnersResult.\n\n3. [follow-up change] Add a AutoValue builder for PathCodeOwnersResult:\n\nThis allows us to get rid of local vars to collect the result data.\n\nHaving an AutoValue builder for PathCodeOwnersResult also allows us to\nunify how results within PathCodeOwners are passed between methods. At\nthe moment the resolveImports method has a return value to return\nresolved/unresolved imports and the messages, and in addition it gets a\nCodeOwnerConfig.Builder passed in to write out relevant parts of the\nimported CodeOwnerConfig. Using 2 different approaches to return results\nis confusing. If we have an AutoValue builder for PathCodeOwnersResult\nwe can just use this builder to collect all the results.\n\nChange-Id: I304e66a4eee29d79c490ba1c6013c8a1f59338ed\nSigned-off-by: Edwin Kempin \u003cekempin@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "05af4e3f0da9f9af2d43159d0923dfd3e007bd9d",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/PathCodeOwners.java",
      "new_id": "29472a9bed52cea9fbc2e1cb356bbcaccaf1033b",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/PathCodeOwners.java"
    },
    {
      "type": "modify",
      "old_id": "5b262bf5650ed755a62ea09ed9dff19b43bcd523",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/PathCodeOwnersResult.java",
      "new_id": "0c80468bcc6632b999031263d8d5ed5389e58b9f",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/PathCodeOwnersResult.java"
    },
    {
      "type": "modify",
      "old_id": "2970d717fded357ec37cee706c27baa2b04878e3",
      "old_mode": 33188,
      "old_path": "javatests/com/google/gerrit/plugins/codeowners/backend/PathCodeOwnersResultTest.java",
      "new_id": "d9f650156c70976410c4841456f07525568b3e1c",
      "new_mode": 33188,
      "new_path": "javatests/com/google/gerrit/plugins/codeowners/backend/PathCodeOwnersResultTest.java"
    }
  ]
}
