)]}'
{
  "commit": "39bd4d8fc0c793aea1ab6b8108ce6eca2bfa1140",
  "tree": "f9fc1110679b52585b9709829bed0a035a858ab9",
  "parents": [
    "cf594f780c91f13d48e77faad34df48ac57398da"
  ],
  "author": {
    "name": "yushan26",
    "email": "107004874+yushan26@users.noreply.github.com",
    "time": "Tue Oct 21 12:12:29 2025 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Oct 21 19:12:29 2025 +0000"
  },
  "message": "fix(gazelle) Delete python targets with invalid srcs (#3046)\n\nWhen running Gazelle, it generated the following target:\n```\npy_binary(\n    name \u003d \"remove_py_binary\",\n    srcs \u003d [\"__main__.py\"],\n    main \u003d \"__main__.py\",\n    visibility \u003d [\"//visibility:public\"],\n)\n```\nAfter `__main__.py` was deleted and the change committed, re-running\nGazelle did not remove the file from the srcs list.\nThis change introduces logic to check whether all entries in a Python\ntarget’s srcs attribute correspond to valid files. If none of them\nexist, the target is added to result.Empty to signal that it should be\ncleaned up. This cleanup behavior applies to when python_generation mode\nis package or file, as all `srcs` are expected to reside directly within\nthe current directory.\n\n---------\n\nCo-authored-by: yushan \u003cyushan@uber.com\u003e\nCo-authored-by: Douglas Thor \u003cdougthor42@users.noreply.github.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "23e05f02a5c071fd35cc4ce8dd0d755d422c3901",
      "old_mode": 33188,
      "old_path": "CHANGELOG.md",
      "new_id": "4576926406c511c86e352e15a7d6283e403f9321",
      "new_mode": 33188,
      "new_path": "CHANGELOG.md"
    },
    {
      "type": "modify",
      "old_id": "a180ec527dbb4e7919ac92d88e16ab3c9136ecfd",
      "old_mode": 33188,
      "old_path": "gazelle/python/generate.go",
      "new_id": "cbceea4693558c0bf19b4490c2325b37d1e08ebf",
      "new_mode": 33188,
      "new_path": "gazelle/python/generate.go"
    },
    {
      "type": "modify",
      "old_id": "a4ce572aaacf43b680cfed1e09a506abde9d80cd",
      "old_mode": 33188,
      "old_path": "gazelle/python/kinds.go",
      "new_id": "4fe8090445b5eaafd574e856015ef5dabfdef560",
      "new_mode": 33188,
      "new_path": "gazelle/python/kinds.go"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "87d357139b4a2c31ac695150d6a3ec07d140ddb3",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/remove_invalid_binary/BUILD.in"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "069188f5ca4ceb91ae7e0323a4d3a5a32f15be96",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/remove_invalid_binary/BUILD.out"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "be8a89442000cf38c3cbc59fb1af1454f647d1c3",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/remove_invalid_binary/README.md"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/remove_invalid_binary/WORKSPACE"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0036c6797a00001860dd0c40bbadd883bcc28793",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/remove_invalid_binary/keep_binary/BUILD.in"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0036c6797a00001860dd0c40bbadd883bcc28793",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/remove_invalid_binary/keep_binary/BUILD.out"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "d3b51eea8e00361d9c452aec57b79a102162ace8",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/remove_invalid_binary/keep_binary/foo.py"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/remove_invalid_binary/test.yaml"
    },
    {
      "type": "modify",
      "old_id": "6a0673762378342e19c80d840377ecc3e8b3d0a2",
      "old_mode": 33188,
      "old_path": "gazelle/python/testdata/respect_kind_mapping/BUILD.in",
      "new_id": "3c6ec07014f7a752fe1085b90c6e991e2228ac60",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/respect_kind_mapping/BUILD.in"
    },
    {
      "type": "modify",
      "old_id": "fa06e2af12dba77816b91730de4db508c5ed4ea9",
      "old_mode": 33188,
      "old_path": "gazelle/python/testdata/respect_kind_mapping/BUILD.out",
      "new_id": "eb6894f1c882f346f10e9d068c6705d9d643914f",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/respect_kind_mapping/BUILD.out"
    }
  ]
}
