Skip to content

build: drive format and lint of proxy/ from the root - #1229

Merged
bpalermo merged 1 commit into
registry-modulefrom
proxy-lint-format
Oct 5, 2026
Merged

bpalermo merged 1 commit into
registry-modulefrom
proxy-lint-format

Conversation

@bpalermo

@bpalermo bpalermo commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

Stacked on #1228. The root now formats and lints proxy/.

Audit: what covered proxy/ before

proxy/ has 10 Starlark files and 4 shell scripts (including the extensionless bazel/get_workspace_status).

check proxy Starlark proxy shell
make format-check (//:format) none: .gitattributes marked proxy/** rules-lint-ignored, and every BUILD/BUILD.bazel is also linguist-generated, which the rules_lint format multirun skips as well none: same rules-lint-ignored
make lint (--config=lint) none: proxy/ is in //.bazelignore, and the buildifier aspect only visits bzl_library or tagged filegroups, of which the repo has none ShellCheck, only through the //bazel/lint/proxy_shell symlink bridge, kept complete by scripts/check-proxy-shell-lint.sh

Side finding, not changed here: because of linguist-generated, the root formatter also skips the root's own BUILD files (Gazelle formats them), and the root buildifier lint aspect visits no Starlark file anywhere.

Now

  • Format: proxy/ is no longer rules-lint-ignored. Its hand-written BUILD files are set to linguist-generated=false, since no Gazelle runs there. The root //:format multirun now covers proxy Starlark (buildifier) and shell (shfmt) in make format, make format-check, the ci format job, and a new format step in the proxy workflow's shell job.
  • Lint: new scripts/lint-proxy.sh runs buildifier's linter (-lint=warn -warnings=all, the aspects' default) and ShellCheck (same rules_lint binary and .shellcheckrc as the aspect) over the proxy files git ls-files lists. It exits 2 if it finds no files of either kind. It is wired into make lint (plus a new make lint-proxy), the proxy workflow's shell job, and the ci workflow's shell job. The ci job is there because a root change, such as a buildifier or ShellCheck bump, can newly flag a proxy file.
  • Bridge retired: a .bazelignored tree is invisible to aspects, but a direct run of the same binaries over the files git lists covers every proxy shell script with no mirror to maintain. So //bazel/lint/proxy_shell and scripts/check-proxy-shell-lint.sh are deleted, and the references to them in check-shell-lint.sh, bazel/BUILD.bazel, scripts/BUILD.bazel and the root MODULE.bazel comment are updated.

What the new coverage flagged (fixed, formatting only)

  • proxy/MODULE.bazel: buildifier argument order in single_version_override.
  • proxy/bazel/get_workspace_status: shfmt (spaces to tabs).
  • proxy/BUILD.bazel:68: make-location warning. Changed $(location) to $(execpath) in the image_metadata genrule; the expanded command line is byte-identical (aquery).
  • proxy/bazel/platforms/BUILD.bazel: unsorted-dict-items. Sorted the exec_properties keys; the action key under --config=rbe-buildbuddy-arm64 is unchanged (aquery before and after).
  • proxy/bazel/build_config/extensions_build_config.bzl: added a module docstring.

All 14,334 CppCompile/CppArchive/CppLink action keys in //:envoy's closure are still identical to main's, so the proxy release this PR triggers (it touches proxy/**) should be a cache hit.

Proof the coverage is live (introduced, observed red, reverted)

  • Bad formatting in proxy/bazel/build_config/extensions_build_config.bzl and proxy/bazel/BUILD: make format-check reports # reformat for both and fails. scripts/lint-proxy.sh also flags both, plus an unsorted-dict-items warning.
  • echo $UNQUOTED_VAR in proxy/integration/check_symtab.sh: scripts/lint-proxy.sh fails with SC2086.
  • Two-space indentation in the same script: make format-check fails with a shfmt diff.

Test plan

  • make format / make format-check clean; scripts/lint-proxy.sh clean (10 Starlark, 4 shell)
  • bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //...; scripts/check-shell-lint.sh (59 covered); make gazelle (no diff); root bazel build //...
  • proxy (Bazel 8.7.0): bazel build --nobuild //...
  • actionlint v1.7.7: no new findings; no new uses:

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

@bpalermo
bpalermo added this pull request to stack #1230 October 4, 2026 22:34
@bpalermo
bpalermo marked this pull request as ready for review October 4, 2026 22:34
Audit of what covered the //proxy workspace's 10 Starlark and 4 shell files:

- `make format-check` (//:format): nothing. .gitattributes marked
  `proxy/** rules-lint-ignored`, and every BUILD/BUILD.bazel is also
  `linguist-generated`, which the rules_lint format multirun skips too.
- `make lint` (--config=lint): no proxy Starlark at all (proxy/ is in
  //.bazelignore; the buildifier aspect only visits bzl_library or tagged
  filegroups, of which the repo has none). ShellCheck reached the 4 shell
  files only through the //bazel/lint/proxy_shell symlink bridge, kept
  complete by scripts/check-proxy-shell-lint.sh.

Now:
- Format: proxy/ leaves rules-lint-ignored and its hand-written BUILD files
  are unmarked linguist-generated (no Gazelle runs there), so the root
  formatter covers proxy Starlark (buildifier) and shell (shfmt) in
  `make format` / `make format-check` and the `format` CI jobs.
- Lint: scripts/lint-proxy.sh runs buildifier's linter (-warnings=all, the
  aspects' default) and ShellCheck (same binary and .shellcheckrc as the
  aspect) over the proxy files git lists, failing closed on an empty set.
  Wired into `make lint` (+ `make lint-proxy`), the proxy workflow's
  `shell` job (with a format check) and the ci workflow's `shell` job.
- The direct run covers every proxy shell script with no mirror to keep
  complete, so the symlink bridge and its guard are retired.

Fixes the new coverage flagged, all formatting/no-op:
- proxy/MODULE.bazel: buildifier argument order in single_version_override.
- proxy/bazel/get_workspace_status: shfmt (tabs).
- proxy/BUILD.bazel: $(location) -> $(execpath) in the image_metadata
  genrule; the expanded command line is byte-identical (aquery).
- proxy/bazel/platforms/BUILD.bazel: sorted exec_properties keys; the action
  key under --config=rbe-buildbuddy-arm64 is unchanged (aquery).
- proxy/bazel/build_config/extensions_build_config.bzl: module docstring.

All 14334 CppCompile/CppArchive/CppLink action keys in //:envoy's closure
are identical to main's.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo merged commit 8eafebb into main Oct 5, 2026
25 checks passed
@bpalermo
bpalermo deleted the proxy-lint-format branch October 5, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant