Skip to content

fix(ci): pin local Semgrep to semgrep.yml image tag - #1794

Merged
FabioLeitao merged 1 commit into
mainfrom
fix/1793-semgrep-pin-from-workflow
Aug 28, 2026
Merged

fix(ci): pin local Semgrep to semgrep.yml image tag#1794
FabioLeitao merged 1 commit into
mainfrom
fix/1793-semgrep-pin-from-workflow

Conversation

@FabioLeitao

Copy link
Copy Markdown
Collaborator

Summary

  • Local --enforced Semgrep now uses uvx semgrep@X.Y.Z where X.Y.Z is parsed from the semgrep/semgrep: image tag in .github/workflows/semgrep.yml (single pin; no duplicated version in the scripts).
  • Fail-closed if that tag cannot be read — never falls back to floating uvx semgrep.
  • Zizmor stays unpinned CLI (uvx zizmor): CI runs zizmor-action (different artifact). Documented in scripts + QUALITY docs.
  • Tests in tests/test_scripts.py assert the pin is derived from the workflow, not hardcoded.

Closes #1793.

Local --enforced note (not a regression of this fix)

On this Linux primary workstation, ./scripts/check-all.sh --enforced can still fail after a successful pin (Semgrep pin: 1.117.0 was printed and uvx installed that package). Semgrep 1.117.0 via uvx uses the host Python (here 3.14); protobuf/OpenTelemetry in that wheel crash with TypeError: Metaclasses with custom tp_new are not supported. CI Semgrep runs inside the pinned container, not host uvx. 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)
  • CI Semgrep job on this PR (container pin)
  • Optional: --enforced on a host whose Python can import Semgrep 1.117.0, or accept container-only parity for the engine runtime

Parse the engine version from the workflow instead of floating uvx
semgrep, and fail closed if the tag is unreadable. Closes #1793.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

FabioLeitao has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@strix-security

Copy link
Copy Markdown

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.

@FabioLeitao
FabioLeitao merged commit acc97e2 into main Aug 28, 2026
26 checks passed
@FabioLeitao
FabioLeitao deleted the fix/1793-semgrep-pin-from-workflow branch August 28, 2026 11:55
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.

[P2][ci][gate] Gate local afirma paridade com o CI mas usa Semgrep flutuante (1.167.0 local × 1.117.0 pinado no CI)

1 participant