)]}'
{
  "commit": "f5792baf84e064cc7b2d4c6397bc6ae177f8035a",
  "tree": "8814d979b268761a0ebc159f1b1de12141cb10e2",
  "parents": [
    "d6bdde50af78e0d45af4b891f0883ce8b9c41585"
  ],
  "author": {
    "name": "Ewout Maertens",
    "email": "ewoutm@arista.com",
    "time": "Fri Sep 12 15:50:08 2025 +1000"
  },
  "committer": {
    "name": "Ewout Maertens",
    "email": "ewoutm@arista.com",
    "time": "Fri Sep 12 16:05:32 2025 +1000"
  },
  "message": "chatgpt: clean up temporary files during uploadRepoFiles\n\nWe noticed our gerrit instance running out of disk space and found a\nseries of json files generated under `/tmp`. The structure looked like:\n/tmp/\u003crepository_name\u003e\u003chash\u003e.json\n\nWe notice these temp files would get generated upon a CR change-merged\nevent:\n\"\u003ctimestamp \u0026 user\u003e INFO  com.googlesource.gerrit.plugins.aicodereview\n.listener.GerritListener : Processing event: com.google.gerrit.server\n.events.ChangeMergedEvent@commit-hash\"\n\nThe timestamp of this event would always match the timestamp of the\njson file created under `tmp`. These files also only get created for\nCRs merged in a repo where ai-code-review is created.\n\nWe pin-pointed the issue to createTempFileWithContent in this plugin.\nThere is a deleteOnExit() clause for this, but it does not seem to\ndelete the files in all situations.\n\nSome of these files are quite large, as they contain the whole content\nof a CR.\n\nThis change is a proposed fix for deleting a file in a finally clause\nin case it has not been removed yet and still exists.\n\nChange-Id: I1fb62f95c20b509cc756a0702d112e5eb44cc20a\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "495481445ef205b42c6140f64342bbd4a8df652b",
      "old_mode": 33188,
      "old_path": "src/main/java/com/googlesource/gerrit/plugins/aicodereview/mode/stateful/client/api/chatgpt/ChatGptAssistant.java",
      "new_id": "ed969457c53f96f2235fb0843d37c5cf4c2db5cc",
      "new_mode": 33188,
      "new_path": "src/main/java/com/googlesource/gerrit/plugins/aicodereview/mode/stateful/client/api/chatgpt/ChatGptAssistant.java"
    }
  ]
}
