Skip to content

build: fix crash in pre-commit-hooks#16505

Merged
phlax merged 1 commit intoenvoyproxy:mainfrom
greymatter-io:build_tools
May 17, 2021
Merged

build: fix crash in pre-commit-hooks#16505
phlax merged 1 commit intoenvoyproxy:mainfrom
greymatter-io:build_tools

Conversation

@justincely
Copy link
Copy Markdown
Contributor

Signed-off-by: Justin Ely justincely@gmail.com

Commit Message: add defensive coding against None in pre-commit hook
Additional Description: Fixes #16504
Risk Level: low
Testing: After fixing, was able to run git push and have the pre-commit hook spit out the right errors rather than python stacktrace.

Running pre-push check; to skip this step use 'push --no-verify'
  Checking format for tools/code_format/check_format.py - ERROR: Command clang-format-11 not found. If you have clang-format in version 10.x.x installed, but the binary name is different or it's not available in PATH, please use CLANG_FORMAT environment variable to specify the path. Examples:
    export CLANG_FORMAT=clang-format-11.0.1
    export CLANG_FORMAT=/opt/bin/clang-format-11
    export CLANG_FORMAT=/usr/local/opt/llvm@11/bin/clang-format
ERROR: Command None not found. If you have buildifier installed, but the binary name is different or it's not available in $GOPATH/bin, please use BUILDIFIER_BIN environment variable to specify the path. Example:
    export BUILDIFIER_BIN=`which buildifier`
If you don't have buildifier installed, you can install it by:
    go get -u github.com/bazelbuild/buildtools/buildifier
ERROR: Command None not found. If you have buildozer installed, but the binary name is different or it's not available in $GOPATH/bin, please use BUILDOZER_BIN environment variable to specify the path. Example:
    export BUILDOZER_BIN=`which buildozer`
If you don't have buildozer installed, you can install it by:
    go get -u github.com/bazelbuild/buildtools/buildozer

Docs Changes: None
Release Notes: None
Platform Specific Features: None
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Deprecated:]
[Optional API Considerations:]

Signed-off-by: Justin Ely <justincely@gmail.com>
@repokitteh-read-only
Copy link
Copy Markdown

Hi @justincely, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #16505 was opened by justincely.

see: more, trace.

@phlax phlax self-assigned this May 14, 2021
@phlax
Copy link
Copy Markdown
Member

phlax commented May 14, 2021

hi @justincely i have a longer PR to address this here #15811 - ill check this PR over in the meantime as its pretty annoying atm

@justincely
Copy link
Copy Markdown
Contributor Author

@phlax thanks! I didn't realize someone else was working on anything similar, so just let me know if i'm on the wrong track or if this is superfluous considering yours. Just seemed low hanging fruit

Copy link
Copy Markdown
Member

@phlax phlax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - it does the same thing as now in terms of pushing but is more likely to provide info on how to resolve and not python stacktrace

thanks @justincely

@phlax
Copy link
Copy Markdown
Member

phlax commented May 15, 2021

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #16505 (comment) was created by @phlax.

see: more, trace.

@phlax phlax merged commit 43e9711 into envoyproxy:main May 17, 2021
@justincely justincely deleted the build_tools branch May 17, 2021 14:25
ntgsx92 pushed a commit to ntgsx92/envoy that referenced this pull request May 18, 2021
…mit hook (envoyproxy#16505)

Signed-off-by: Justin Ely <justincely@gmail.com>
Signed-off-by: Sixiang Gu <sgu@twitter.com>
leyao-daily pushed a commit to leyao-daily/envoy that referenced this pull request Sep 30, 2021
…mit hook (envoyproxy#16505)

Signed-off-by: Justin Ely <justincely@gmail.com>
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.

build: check_format.py crashes if executables don't exist

2 participants