Repository navigation
fix(code-risk): treat Semgrep partial parse errors as warnings - #496
Closed
lucas-saldanha-werneck wants to merge 1 commit into
Closed
lucas-saldanha-werneck wants to merge 1 commit into
lucas-saldanha-werneck wants to merge 1 commit into
Conversation
Any nonempty Semgrep "errors" list marked the scan incomplete, even when Semgrep recovered from a parse error and scanned the rest of the file. Valid bash such as exec 3<>"/dev/tcp/127.0.0.1/$PORT" makes Semgrep's bash parser report a PartialParsing error, so such skills got an incomplete Code Risk check. A PartialParsing error (the type is a string or a list like ["PartialParsing", [spans]]) is now a warning naming the file and the line/column, and no longer makes the scan incomplete. Every other error type still does. All errors are reported, not only the first three truncated to 100 characters. Refs NVIDIA#463 Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01U8VQWLhJZuJqs6TK49GfjT Signed-off-by: Lucas Saldanha Werneck <[email protected]>
lucas-saldanha-werneck
requested review from
chrisknvidia,
mosheabr,
rmalani-nv and
rng1995
as code owners
November 13, 2026 09:40
Contributor
Author
8 tasks done
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.
Summary
Refs #463. Any nonempty Semgrep
errorslist made Code Risk Analysis mark Semgrep incomplete, and only the first three errors were shown, each cut at 100 characters.Semgrep reports a file it could only parse in part as a
PartialParsingerror:leveliswarn,typeis a list such as["PartialParsing", [spans]], and the rest of the file is still scanned. A second public repro besides those in the issue: valid bash such asexec 3<>"/dev/tcp/127.0.0.1/$PORT"(accepted bybash -nand ShellCheck) triggers one with Semgrep 1.182.0; I reported the parser bug upstream at semgrep/semgrep#12084.This change:
PartialParsingerror (string or listtype) as a warning that names the file, relative to the skill, and the line and column; the scan stays complete and the success message says how many files were only partly parsed;type;Whether an unparsed part of a file is acceptable is a judgment call, as the issue notes, so the warning says that Semgrep did not check that code. I used "Refs" because the issue's third point (documenting how to resolve parse errors) is only partly covered by a short note in
docs/tier1-validation.mdx.Verification
tests/validators/test_security_validators.py; the shapes come from real Semgrep 1.182.0 output)make lintmake test(30418 passed, 37 skipped, 4 failed: the 2test_harbor_secure_docker_environment.py::test_sidecar_retains_*tests also fail on unmodifiedmain, and the 2tests/ci/test_run_tier1.pyCtrl-C tests pass when rerun alone)make buildRelease Impact
CHANGELOG.md🤖 Generated with Claude Code