Repository navigation
perf(ci): run the semgrep-devex passes as parallel legs - #131450
fuziontech wants to merge 2 commits into
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Hey @fuziontech! 👋 It looks like your git author email on this PR isn't your
You can fix it for this repo with: git config user.email "you@posthog.com"Or set it globally with |
|
Risk: No findings This increment merges master into the semgrep-devex matrix PR: master's restructuring (diff-scoped blocking Errors scan via the shared semgrep-ci action, PR-only "New sleeps" gate, informational passes moved off pull requests, desktop sparse checkout, the devex-rules full-scan trigger) plus the branch's matrix-leg split. I traced every blocking gate end to end and found no weakening a pull request can exploit: each step's condition only gains a Sentinel reviewed |
|
✅ Security review complete — No findings above the confidence threshold, in 3 min. Add the |
🤖 CI report🚨 Trunk lane — universal laneThis PR is assigned to the universal lane. It cannot merge in parallel with other PRs, so it can take longer to merge. Ask dev-ex if you think this is wrong. |
The three devex passes scan the same tree with different severities and share nothing, but they ran one after another on one runner, so the job wall was their sum. Measured on 11 merged PRs: 301s of whole-tree WARNING scan, 265s of ERROR scan, 110s of ratchet and 22s of new-warning diffing. They now run as a three-way matrix, so the wall is the slowest leg rather than the sum: 705s -> 356s median. The Security lane ends on this job for 19 of 40 merged PRs, so the lane drops 12.0 -> 6.2 min for those. Every command, severity and scan target is unchanged; only the grouping moves. The legs stay on GitHub-hosted runners, which are unmetered on a public repository, so the two extra runners cost nothing, and the checkout still runs PR-controlled code on a host with no Depot credentials. 'Semgrep Checks Pass' needs no change: a matrix job reports failure when any leg fails, which is what its needs.semgrep-devex.result check reads. Co-authored-by: Shelley <shelley@exe.dev>
5151bca to
9de7392
Compare
Nightly CI Speed ReviewReviewed against the production runs and historical baseline data. 1. Verification of Timing & Queue NumbersRecomputed queue times (
2. Required Check & Graph Integrity
3. Security & Side Effects
4. Local Test Results
ConclusionThe change is sound, safe to land, and delivers the claimed speedup. No fix commit required. |
|
Lane replay, to size what this is worth. Not a review, just a number a reviewer can use. I replayed 45 recently merged pull requests through the
That is 46% off the median pull request, because The p90 does not move, which is the honest limit of the number: it is set by the pull requests where something other than Security runs long (MCP Two notes on the replay, since it is a model rather than a production A/B:
|
Master moved the devex job twice while this branch split it into matrix legs: the two informational passes now run on pushes and the hourly schedule only, and the blocking ERROR pass now goes through the shared `semgrep-ci` action. Both changes are orthogonal to the legs, so the resolution keeps both sides. - The informational steps keep their leg guard and gain master's event guard, so they run on the `warnings`/`ratchet` leg of a push only. - The blocking ERROR step keeps `matrix.leg == 'errors'` and takes master's action and `--include` arguments. - "New sleeps in Python tests" arrived from master without a leg guard. With three legs it would have scanned the same changed files three times, so it joins the ratchet leg with the other diff-based passes. On a pull request the warnings leg now has no steps left to run; the split there is errors against ratchet. Co-authored-by: Shelley <shelley@exe.dev>
Problem
Code PRs wait on the
semgrep-devexjob, and on 19 of the last 40 merged PRs it is the Security job that finishes last, so its wall sets when the PR can merge. Its passes share nothing but ran one after another on one runner: 301s of whole-tree WARNING scan, 265s of ERROR scan, 110s of ratchet and 22s of new-warning diffing, 705s median all told.Changes
semgrep-devexnow runs as a three-waymatrix(warnings,errors,ratchet), so its wall is the slowest leg instead of the sum: 705s -> 389s.if:gate is unchanged. Only the grouping moves, so no finding changes verdict.Semgrep Checks Passneeds no edit: a matrix job reports failure when any leg fails, which is what itsneeds.semgrep-devex.resultread already checks.flowchart LR A[changes]:::phYellow --> B[semgrep-devex]:::phBlue B --> B1[Warnings 301s]:::phGray B1 --> B2[Errors 265s]:::phGray B2 --> B3[Ratchet 132s]:::phGray B --> C[Semgrep Checks Pass]:::phRed classDef phBlue fill:#1d4aff,stroke:#1d4aff,color:#fff; classDef phRed fill:#f54e00,stroke:#f54e00,color:#fff; classDef phYellow fill:#f9bd2b,stroke:#f9bd2b,color:#000; classDef phGray fill:#e5e7eb,stroke:#c7ccd1,color:#000;flowchart LR A[changes]:::phYellow --> B{semgrep-devex matrix}:::phBlue B --> B1[Warnings 389s]:::phGray B --> B2[Errors 361s]:::phGray B --> B3[Ratchet 226s]:::phGray B1 --> C[Semgrep Checks Pass]:::phRed B2 --> C B3 --> C classDef phBlue fill:#1d4aff,stroke:#1d4aff,color:#fff; classDef phRed fill:#f54e00,stroke:#f54e00,color:#fff; classDef phYellow fill:#f9bd2b,stroke:#f9bd2b,color:#000; classDef phGray fill:#e5e7eb,stroke:#c7ccd1,color:#000;Before is the median of 11 merged PRs (2026-11-05..07), replayed from each PR's own step durations. After is two production runs of this PR — 42457221509 and 42459349854 — where the three legs ran concurrently and finished at warnings 389s / 371s, errors 361s / 264s, ratchet 226s / 218s, so the wall is 389s and 371s.
semgrep-devexjob wallThe last row is the whole-PR number and is smaller, because the Security lane is the last check for only half of PRs; the other half lose nothing. Hosted runner-seconds go 705s -> 976s per PR (+38% compute for -45% wall), which is free on a public repository.
Note
The lane has a second long pole, unaffected here: a PR that edits
ci-security.yamlmakes thechangesjob forcesemgrep-python's whole-tree scan. This PR is that case, so its own Security lane ended onsemgrep-python, not on the devex legs.How did you test this code?
Test rationale: no new test. The change is a scheduling edit to one workflow and the existing gates are the test.
hogli lint:workflows(15 checks, 144 workflows) andtools/workflow-plannpx vitest run(491 tests) pass. This PR's own Security run is the production check: all three legs ran their own step and nothing else, and all three concluded success.Release status
Docs update
docs/internal/ci-things-already-tried.mdhas no entry for splitting this job; the measurement lives in the workflow comment.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Shelley, DeepSeek V4 Pro (platform API)
Skills:
/authoring-ci-workflows,/writing-pr-descriptionsMore context for AI agents
actions/runs,commits/<sha>/check-runs).ratchet(226s), not with the 389s WARNING scan, so the slowest leg stays the ERROR one.if:on each pass step. A leg that loses its condition silently runs every pass on every runner.