[VL] Run clang-tidy in the native build job and narrow its check list - #12729
Open
philo-he wants to merge 5 commits into
Open
[VL] Run clang-tidy in the native build job and narrow its check list#12729philo-he wants to merge 5 commits into
philo-he wants to merge 5 commits into
Conversation
philo-he
force-pushed
the
fix-security-issue
branch
from
August 8, 2026 18:41
acced7c to
998965c
Compare
This reverts commit a2d7505.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR relocates clang-tidy execution into the existing Velox native build CI job (so it runs in the same workspace that produced compile_commands.json and headers) and centralizes/tightens the enabled check set via cpp/.clang-tidy, removing the separate downstream workflow_run clang-tidy workflow.
Changes:
- Run clang-tidy inside
Velox Backend (x86)native build job (and remove the priorworkflow_run-based clang-tidy workflow). - Move the clang-tidy checks allow-list into
cpp/.clang-tidy(and stop passing--checksfromdev/run-clang-tidy.py). - Pin clang-tidy availability in the CentOS 9 build image by installing
clang-tools-extra.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| dev/run-clang-tidy.py | Stop overriding checks via CLI; add support for forwarding extra toolchain args via env var. |
| dev/docker/Dockerfile.centos9-dynamic-build | Install clang-tools-extra in the image to make clang-tidy available/pinned. |
| cpp/.clang-tidy | Define the allow-listed clang-tidy checks and header filtering behavior as the single source of truth. |
| .github/workflows/velox_backend_x86.yml | Execute clang-tidy in the native build job workspace and ensure checkout depth supports HEAD^..HEAD diffing. |
| .github/workflows/cpp_clang_tidy.yml | Remove the prior downstream clang-tidy workflow that relied on incomplete artifacts. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+86
to
+89
| # Checks come from 'cpp/.clang-tidy'; passing '--checks' here would override it. | ||
| # CLANG_TIDY_EXTRA_ARGS forwards toolchain details the compilation database omits. | ||
| extra_args = os.environ.get("CLANG_TIDY_EXTRA_ARGS", "").strip() | ||
|
|
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (2)
dev/run-clang-tidy.py:93
CLANG_TIDY_EXTRA_ARGSis parsed withshlex.split(...)without error handling. If the environment value contains unmatched quotes (or other shlex parse errors), this will raiseValueErrorand crash the script with a traceback instead of a clear message / non-zero exit code.
extra_args = " ".join(
shlex.quote(arg) for arg in shlex.split(os.environ.get("CLANG_TIDY_EXTRA_ARGS", ""))
)
dev/run-clang-tidy.py:86
- If
run-clang-tidy.pyis invoked with no file arguments and empty stdin,filescan be empty andxargsmay still executeclang-tidyonce with no inputs (leading to a spurious failure). Adding an early return makes the script robust when called directly (and avoids confusing CI logs).
fix = "--fix" if args.fix == "fix" else ""
files = args.files
Member
Author
|
cc @zhouyuan |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes are proposed in this pull request?
The clang-tidy check ran in cpp_clang_tidy.yml, a workflow_run job that consumed the native build artifact from another workflow. That could not work: only cpp/build/ is uploaded, so the compilation database's -I paths into ep/build-velox/ and dev/vcpkg/vcpkg_installed/ did not exist in the downstream job.
The check now runs in the existing
cpp-test-udf-testjob, which builds the native libraries in the same container and workspace, so the database and full header tree are already present.Please note:
clang-tidy is newly enabled and runs with
continue-on-error: true, so its findings are advisory. The check is diff-scoped, so it surfaces pre-existing findings in touched files; continue-on-error can be dropped once those are cleared.How was this patch tested?
Depends on CI.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 5