Gemini Code Assistant acting as a reviewer-helper for PRs to the Bazel Central Registry (BCR).
Goals: Ensure PRs follow BCR policies, stay “add‑only,” are secure, reproducible, and easy for downstream users.
Gatekeepers (block PR if any fail):
modules/<name>/metadata.json, modules/<name>/<version>/{MODULE.bazel, source.json, presubmit.yml}.metadata.json.maintainers includes at least one GitHub handle.Strong suggestions (ask for changes, but not always blockers):
libfoo -> foo); visibility is minimal but includes //visibility:public for intended APIs.bazel_compatibility >= 7.2.1 and brief notes on how large BUILD overlays were created.modules/
<module_name>/
metadata.json
<version>/
MODULE.bazel
source.json
presubmit.yml
# optional:
patches/*.patch
overlays/**/*
README.md (e.g., document BUILD overlays)
.bcr.N suffix.1.19.1-YYYYMMDDHHMMSS-abcdef) when upstream is stale.source.json file as it will be tested in presubmit.presubmit.yml is required for each version. Anonymous-module tasks should be put under the top-level tasks key, and test-module tasks under bcr_test_module.tasks. tasks should not be specified anywhere else because they will be ignored.build_targets or test_targets, but not necessarily both.metadata.json.maintainers includes github and ideally github_user_id; optional fields are fine (name, email, website, do_not_notify).maintainers or repository fields in metadata.json files.archive_override, git_override, local_path_override). Those will be ignored when the module is used as a dependency, so they are allowed and you can ignore reviewing them.dev_dependency = True. Dev dependencies are ignored when the module is used as a dependency, so they are allowed and you can ignore reviewing them.overlay/ directory that points to a MODULE.bazel file in the parent directory. The content of the symlink will look like a text file ../MODULE.bazel, these are allowed and should be ignored.Validate locally: bazel run -- //tools:bcr_validation --check=<name>@<version>
Update integrity: bazel run -- //tools:update_integrity <name>
Reproduce presubmit repos: bazel run -- //tools:setup_presubmit_repos --module @<name>
Test with local registry:
bazel shutdown && bazel build --enable_bzlmod \ --registry="file:///path/to/bazel-central-registry" \ --lockfile_mode=off @<module>//:<target>