fix: handle Bazel load statements in extension-check#7083
Conversation
|
😊 Welcome @immanuwell! This is either your first contribution to the Istio proxy repo, or it's been You can learn more about the Istio working groups, Code of Conduct, and contribution guidelines Thanks for contributing! Courtesy of your friendly welcome wagon. |
|
Hi @immanuwell. Thanks for your PR. I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What this PR does / why we need it:
tools/extension-checkblows up on normal Bazel config files because the embedded Starlark runner does not handleload(...).This strips top level
load(...)statements before evaluation, returns regular errors instead of panics, and removes the README workaround. Pretty small fix, but it makes the tool usable out of the box.Which issue this PR fixes:
N/A, this repo has issues disabled.
Special notes for your reviewer:
Repro before this patch:
go run ./tools/extension-check --envoy-extensions-build-config ./bazel/extension_config/extensions_build_config.bzl --proxy-extensions-build-config ./bazel/extension_config/extensions_build_config.bzl --ignore-extensions ./tools/extension-check/wellknown-extensionsBefore:
panic: load not implemented by this applicationAfter:
it loads the checked-in file and reaches the normal missing-extension output. so yeah, this is a real bug on a real file, not some weird edge case.
Checks:
go test ./tools/extension-checkgo test ./... -run '^$'