)]}'
{
  "commit": "d26439932150d87b3a8f56309a14d9ead2526c33",
  "tree": "8b87610bffb3d8ea53e217919d52afbff9ce1e54",
  "parents": [
    "4ff70fa7dd82619332affcbf608d673ba142f378"
  ],
  "author": {
    "name": "David Ostrovsky",
    "email": "david@ostrovsky.org",
    "time": "Thu Sep 10 05:22:23 2026 +0200"
  },
  "committer": {
    "name": "David Ostrovsky",
    "email": "david@ostrovsky.org",
    "time": "Thu Sep 10 05:28:39 2026 +0200"
  },
  "message": "Add gerrit_plugin_library() for splitting a plugin into internal layers\n\ngerrit_plugin() bundles a plugin from a single srcs glob, which keeps\nthe whole plugin in one java_library (`\u003cname\u003e__plugin`) with no way to\nexpress or enforce dependency edges between its own packages. For larger\nplugins it is useful to split production code into per-package libraries\nso the internal DAG is explicit -- for example to keep a native/protocol\nlayer from importing a dependency the rest of the plugin uses, enforced\nby Bazel rather than by convention.\n\nIn-tree, Gerrit does this with tools/bzl:plugin.bzl\u0027s\nPLUGIN_DEPS_NEVERLINK constant. bazlets dropped its\nPLUGIN_DEPS/PLUGIN_DEPS_NEVERLINK/PLUGIN_TEST_DEPS constants as\nWORKSPACE-era dead code, leaving only the lower-level\ngerrit_api_neverlink() function, so today an internal library must\nhand-roll `deps \u003d gerrit_api_neverlink(name) + _artifacts(...)` and\nrepeat the standalone/in-tree handling per library.\n\nAdd gerrit_plugin_library() to encapsulate that once, mirroring\ngerrit_plugin_test_util() but for production code:\n\n - puts the Gerrit plugin API on the compile-only (neverlink) classpath\n   via gerrit_api_neverlink(), so the API is not bundled twice and both\n   build modes (Gerrit in-tree and standalone plugin) work;\n - resolves Maven ext_deps against the plugin\u0027s rules_jvm_external repo\n   (`\u003cplugin\u003e_plugin_deps` by default) -- the same repo gerrit_plugin()\n   and gerrit_plugin_tests() use -- so a split library sees the same\n   artifacts in both modes;\n - supports the same ext_deps / ext_deps_label / ext_repo options as the\n   sibling helpers.\n\nUnlike gerrit_plugin_test_util() the result is not testonly, does not\npull in the acceptance framework, and does not prepend\n`:\u003cplugin\u003e__plugin`: an internal library is a lower layer than the\nplugin wiring, so depending on the plugin would invert the DAG and,\nsince gerrit_plugin() depends back on the library, create a cycle. The\naggregating gerrit_plugin() references these libraries with a\npackage-relative label (no leading `//`) so it resolves under both the\n//plugins/\u003cname\u003e in-tree mount and the standalone repo root.\n\nNo behavior change for existing plugins; this only adds a new helper.\n\nChange-Id: Ib15033c455e75366458e117dcd89cf451ed4e805\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5bef560f09aac950faf2f6f282ab350b9b3cd247",
      "old_mode": 33188,
      "old_path": "gerrit_plugin.bzl",
      "new_id": "3d76788438468ab0521842b776498224fe5adadc",
      "new_mode": 33188,
      "new_path": "gerrit_plugin.bzl"
    }
  ]
}
