Dear Gerrit contributors and Maintainers,
After many years of using a mono-repo for the owners plugin, I would like to propose splitting the repository into three separate components. To demonstrate how this will work, I have prototyped the split into the following modules:
owners-common-api: Combines owners-common and owners-api. It provides the shared infrastructure for detecting and parsing OWNERS files, along with the API that allows extending it via Groovy scripts.
owners: Contains the legacy Prolog rules and the new Submit Requirements for enabling or disabling change submissions based on processing OWNERS files against incoming patch-sets.
owners-autoassign: Processes OWNERS files to automatically assign designated owners as reviewers or in CC.
There are five main reasons driving this architectural change:
Cross-Plugin Dependencies and Reuse: Gerrit now supports cross-plugin dependencies and communication. Splitting the repository allows these three modules to be independent and reused in different contexts. It also prevents the owners-common code from being included multiple times, ensuring it is loaded only once by Gerrit.
Standardized CI Verification: Gerrit plugins can now be verified alongside their dependencies thanks to the inclusion of cross-plugin dependencies in the YAML definitions.
Stepping Stone to ApiModule Evolution: By making owners-common-api a first-class citizen, it can be transformed into a dynamically loaded plugin. Subsequently, owners and owners-autoassign can be loaded as child injectors, cleanly reusing the classes of owners-common-api at runtime.
Leveraging bzlmod: Encapsulating the shared dependencies within owners-common-api drastically simplifies the Bazel definitions for owners and owners-autoassign, aiding the ongoing migration to bzlmod.
Easier Discovery and Setup: The three components will be clearly displayed in the plugin manager and installable with a single click, rather than being hidden inside the nested build structure of a mono-repo.
You can review the prototypes for the separated components here:
![]() | |
![]() | |
![]() | |
To move forward, I propose creating the two additional repositories under Gerrit-Review alongside the existing owners repo:
a) plugins/owners-common-api
b) plugins/owners-autoassign
Please let me know your thoughts and feedback on this proposal.
Thank you,
Luca
Thank you,
Luca