Repository navigation
chore(lint): enable buf lint test, expand buildifier lint, and fix docs - #1673
VLukiantsev wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request integrates Protobuf linting by adding a buf_lint_test target to api/BUILD.bazel and configuring lint rules in api/buf.yaml. Additionally, it removes unused-variable warnings from the pre-commit buildifier check, updates documentation to note the deprecation of Cluster Toolkit Blueprint v1, and refactors oci.bzl to use $(execpath) and include docstrings. The review feedback correctly identifies that the paths specified in api/buf.yaml under ignore_only must be relative to the api/ directory (the Buf module root) rather than the workspace root, and that paths starting with xmanager_cloud/ cannot be resolved from this location.
3bf7271 to
4f09559
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request integrates Buf linting for protobuf files, updates Bazel build files to use
08f58d0 to
c345143
Compare
c345143 to
26329ad
Compare
26329ad to
ff7de7a
Compare
ff7de7a to
b9e3435
Compare
8b8fbc7 to
e4b9803
Compare
b704614 to
b147bd1
Compare
b147bd1 to
b8d1571
Compare
b8d1571 to
1585f04
Compare
1585f04 to
5a1b95d
Compare
5a1b95d to
f710acb
Compare
f710acb to
e8af856
Compare
e8af856 to
3abde37
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces Buf linting (buf_lint_test) for protobuf APIs, updates pre-commit linting tools (specifically buildifier integration to support Google-specific warnings and untracked files), refactors several Bazel BUILD files to use $(execpath) instead of $(location) and explicitly list certain files instead of globbing them, and updates documentation regarding deployment topologies and developer checks. I have no feedback to provide as there are no review comments.
3abde37 to
9d24eac
Compare
9d24eac to
1e93c68
Compare
1b72a67 to
6c754aa
Compare
6c754aa to
4b75d34
Compare
- Add `//api:protos_lint_test` (`buf_lint_test`) and `lint:` config (`STANDARD` with multi-directory package exceptions and descriptor-path `ignore_only` baseline) in `api/buf.yaml`. - Expand `buildifier` to `-lint=warn` in `tools/lint/precommit_runner.py` and `.github/workflows/lint.yml` with a runtime probe excluding Google-only `-LANG_proto_library-single-deps,-inline-deps` when supported, use `git ls-files` cleanly in `check_bazel`, fix `make-location` (`$(execpath)`) and `constant-glob` warnings across 9 `BUILD.bazel` files + `oci.bzl`, and add `oci.bzl` docstrings. - Replace dead `deploy/ctk_v1/README.md` link in `docs/design/topologies.md` and document `//api:protos_lint_test` and `buildifier -lint=warn` in `docs/developer.md`. TAG=agy CONV=ba8411ef-c093-4f45-950a-b3bc1899268c
4b75d34 to
944f1d9
Compare
Summary
Enable
//api:protos_lint_testviabuf_lint_test(api/buf.yaml), add docstrings and$(execpath ...)inoci.bzl, expandbuildifierfrom-warnings=unused-variableto-lint=warnintools/lint/precommit_runner.pyand CI (probing-warnings=-LANG_proto_library-single-deps,-inline-depsso both upstream OSSbuildifier v8.0.3and Google internalbuildifierpass cleanly), fix allmake-locationandconstant-globwarnings across activeBUILD.bazelfiles +oci.bzl, replace the removed Blueprint v1 link indocs/design/topologies.md, and syncdocs/developer.md.Motivation & Context
Enabling Buf protobuf lint (while leaving frozen
.protosources untouched), full Buildifier lint checks across Bazel files, and clean doc links prevents schema style drift and deprecated$(location)/constant-globBUILD bugs;docs/design/topologies.mdis updated alongside this check-enabling slice to purge an obsolete Blueprint v1 reference.Key Changes
Modified 22 file(s):
api/BUILD.bazel&api/buf.yaml: Add//api:protos_lint_test(buf_lint_test,error_format = "msvs"), updatebuf.yamlheader comment, and addlint:config (STANDARDminus 4 multi-directoryPACKAGE_*rules, descriptor-pathignore_onlylegacy baseline, and an inlineTODOtracking unusedstructured_message.protoimport cleanup inapi/protos/experiment/api.proto).tools/lint/precommit_gates.py,tools/lint/precommit_runner.py,tools/lint/precommit_runner_test.py, &.github/workflows/lint.yml: Addstdin_devnulltogates.exec_cmd, addinclude_untracked: bool = Falsetogates.git_ls_filesfor Bazel file discovery incheck_bazel(withgates.chunked(..., 500)batching), probe Google-only-LANG_proto_library-single-deps,-inline-depsexclusions for compatibility with CI OSSbuildifier v8.0.3, runbuildifier -lint=warnafterfix, and add unit tests covering both probe paths intest_check_bazel_invokes_buildifier.oci.bzl: Add module docstring andoci_image_for_serviceArgs:docstring, and switch$(location //tools/common:build_oci.py)to$(execpath //tools/common:build_oci.py)in the generated*_tarballgenrule (tarball_target).cmd/ui/BUILD.bazel,deploy/helm/BUILD.bazel,deploy/profiles/stable-2026a/components/{clickhouse,ingestion-gateway,redpanda}/BUILD.bazel,deploy/profiles/stable-2026b/components/{clickhouse,hpo,ingestion-gateway,redpanda,vizier}/BUILD.bazel,internal/storage/{postgres,spanner}/migrations/version/BUILD.bazel: Replace$(location ...)with$(execpath ...)and move explicit files (Chart.yaml,values.yaml,values-local.yaml,nginx.conf,generate_config.sh,karma.conf.js) out ofglob(...), dropping redundant"package-lock.json"already matched by"*.json".docs/design/topologies.md&docs/developer.md: Mark Blueprint v1 removed intopologies.md, and document//api:protos_lint_test,_PROTOScoverage (including//api/filter:filter_proto), andbuildifier -lint=warn -mode=checkindocs/developer.md.Assumptions
api/...and virtual-importxmanager_cloud/...) inapi/buf.yamlignore_onlymatches whatrules_buf'sbuf_lint_testfeeds toprotoc-gen-buf-lint—buf_lint_testpasses compiled descriptor names rather thanapi/-relative paths — running standalonebuf lintCLI directly againstapi/outside Bazel would mismatchignore_onlypaths without adjusting config.-warnings=-LANG_proto_library-single-deps,-inline-depsbefore passing-warnings=keeps CI (buildifier v8.0.3) and Google-internalbuildifiercompatible while retaining multi-depgo_proto_libraryrules (grpc-gatewaydeps) and DRY_KIND_3P_DEPSintest/e2e/BUILD.bazel— upstream OSSbuildtoolsrejects unrecognized-warnings=tokens whereas Googlebuildifierneeds them excluded — future default warnings added in newerbuildifierreleases could fail until addressed or suppressed, and unintended multi-depgo_proto_library/ deps-variable patterns are not flagged when excluded.//api:protos_lint_testtargets explicitly in_PROTOS(api/BUILD.bazel) covers active repository.protodefinitions exceptcloud_xmanager_v1_proto(excluded by design as a source-duplicate wrapper) —_PROTOSfeeds bothprotos_breaking_testand CI uncovered-proto verification — any newproto_libraryadded under//apiskips lint until added to_PROTOS.Chart.yaml,values.yaml,values-local.yaml,nginx.conf,generate_config.sh,karma.conf.js) out ofglob(...)requires checked-in inputs to remain present —glob(...)would silently omit accidentally deleted files — deleting or renaming any of those files will now fail Bazel loading loudly until the correspondingBUILD.bazellist is updated.Verification & Testing
./.githooks/pre-commit --check&./.githooks/pre-commiton#1673commit (Buildifier-lint=warn, Ruff, Mypy,helm lint,test/helm88 tests, Trivy, and Bazel tests),bazel build //deploy/profiles/stable-2026b/...,python3 tools/analyze_diff_size.py --base-ref chore/harden-ui-eslint-and-typecheck, andbazel test --test_output=errors //tools/lint:precommit_gates_test //tools/lint:precommit_runner_test //api:protos_lint_test.//api:protos_lint_test,//api:protos_breaking_test,//tools/lint:all,//deploy/profiles/stable-2026b/...(8targets), Buildifier-lint=warn,test/helm(88tests),test/helm/profiles/stable2026b:stable2026b_test, and321/321backend Bazel tests on#1673(149prod lines /41test lines,threshold_exceeded: false) passed locally. Upstream OSSbuildifier v8.0.3verified in CICode Quality & Linting.Related Issues / Bugs
N/A (tracked pre-existing unused
structured_message.protoimport inapi/protos/experiment/api.protovia inlineTODOinapi/buf.yaml).TAG=agy
CONV=ba8411ef-c093-4f45-950a-b3bc1899268c