fix(ci): pin local Semgrep to semgrep.yml image tag - #1794
Merged
Conversation
Parse the engine version from the workflow instead of floating uvx semgrep, and fail closed if the tag is unreadable. Closes #1793.
There was a problem hiding this comment.
FabioLeitao has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
Strix is installed on this repository, but we couldn't run this PR security review because this workspace's trial has ended. Add a card to resume code reviews here. So far, Strix has reviewed 36 pull requests, surfaced 5 security issues (1 critical/high) and blocked 1 risky merge across this workspace. |
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
--enforcedSemgrep now usesuvx semgrep@X.Y.Zwhere X.Y.Z is parsed from thesemgrep/semgrep:image tag in.github/workflows/semgrep.yml(single pin; no duplicated version in the scripts).uvx semgrep.uvx zizmor): CI runszizmor-action(different artifact). Documented in scripts + QUALITY docs.tests/test_scripts.pyassert the pin is derived from the workflow, not hardcoded.Closes #1793.
Local
--enforcednote (not a regression of this fix)On this Linux primary workstation,
./scripts/check-all.sh --enforcedcan still fail after a successful pin (Semgrep pin: 1.117.0was printed anduvxinstalled that package). Semgrep 1.117.0 viauvxuses the host Python (here 3.14); protobuf/OpenTelemetry in that wheel crash withTypeError: Metaclasses with custom tp_new are not supported. CI Semgrep runs inside the pinned container, not hostuvx. That host-runtime mismatch is known and out of scope for #1793.Pre-push gate here:
./scripts/check-all.sh(without--enforced) — pre-commit, pytest, Bandit, Zizmor — OK.Test plan
uv run pytest tests/test_scripts.py -q./scripts/check-all.sh(no--enforced)--enforcedon a host whose Python can import Semgrep 1.117.0, or accept container-only parity for the engine runtime