)]}'
{
  "commit": "0854a750e54d398478b1a385a6df9b53dda05f53",
  "tree": "f01daf19ac46bb3c31088e9cb0a8a8d6ec2ecdde",
  "parents": [
    "a98785aa95c81505b9e73cedf56678bc140175fd"
  ],
  "author": {
    "name": "David Ostrovsky",
    "email": "david@ostrovsky.org",
    "time": "Sun Jun 21 11:00:12 2026 +0200"
  },
  "committer": {
    "name": "David Ostrovsky",
    "email": "david@ostrovsky.org",
    "time": "Sun Jun 21 23:31:28 2026 -0700"
  },
  "message": "gerrit_plugin_tests: stop implicitly creating Eclipse test deps\n\ngerrit_plugin_tests() currently creates \u003cplugin\u003e__plugin_test_deps\nwhenever ext_deps is passed. Repeated test macros for one plugin\nthen try to create the same java_library, which breaks BUILD files\nthat split tests across several gerrit_plugin_tests() calls.\n\nOne approach was to make this generated rule idempotent. That keeps\nthe old behavior working, but it introduces heavy Starlark lifting:\nexisting_rule() checks, label normalization, and validation of rule\nattributes generated by earlier macro calls.\n\nAnother approach is to make \u003cplugin\u003e__plugin_test_deps explicit and\nreuse that target from gerrit_plugin_tests(). That avoids the\nidempotency machinery, but it mixes two different concerns:\n\n1. Gerrit Eclipse classpath generation machinery expects a special\n   test-only export target named \u003cplugin\u003e__plugin_test_deps. Plugins\n   opt in through CUSTOM_PLUGINS_TEST_DEPS in tools/bzl/plugins.bzl.\n2. Plugin BUILD files need additional test dependencies for Bazel test\n   execution, also outside Eclipse.\n\nUse a compromise that keeps these concerns separate while allowing\nexplicit reuse. ext_deps continues to mean Maven coordinates for Bazel\ntest dependencies in gerrit_plugin_tests() and\ngerrit_plugin_test_util(), so existing plugin BUILD files keep working\nas-is.\n\nAdd gerrit_plugin_ext_test_deps() for projects that need the Eclipse\nclasspath helper. Add ext_deps_label to gerrit_plugin_tests() and\ngerrit_plugin_test_util() for projects that want to reuse that helper\nexplicitly as the dependency carrier. There is no implicit creation or\nauto-discovery of \u003cplugin\u003e__plugin_test_deps from\ngerrit_plugin_tests().\n\next_deps and ext_deps_label are mutually exclusive. Accepting both\nwould make the resulting classpath ambiguous and could hide a\ndivergence between the coordinate list and the reusable helper target.\n\nMigration path:\n* Keep gerrit_plugin_tests(ext_deps \u003d EXT_DEPS) and\n  gerrit_plugin_test_util(ext_deps \u003d EXT_DEPS) for normal test deps.\n* Add one gerrit_plugin_ext_test_deps() call when Eclipse needs the\n  \u003cplugin\u003e__plugin_test_deps classpath helper.\n* Optionally pass ext_deps_label \u003d \":\u003cplugin\u003e__plugin_test_deps\" to\n  gerrit_plugin_tests() and gerrit_plugin_test_util() when Bazel\n  targets should reuse that explicit helper target too.\n* Do not pass both ext_deps and ext_deps_label to the same macro call.\n* Keep skip_dependency_tests where repeated test macros would still\n  generate duplicate dependency-test targets.\n\nChange-Id: I899320915162828727ed8eaaf749c5bb94393514\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4e303d40b39344bd20dd3b8270535d2c29671bf1",
      "old_mode": 33188,
      "old_path": "gerrit_plugin.bzl",
      "new_id": "0859c91f8d94a05dbc4a1e299cc09f4fa8c9c1b0",
      "new_mode": 33188,
      "new_path": "gerrit_plugin.bzl"
    }
  ]
}
