← Back to Pull requests

Limit Depot cache writes on pull requests #3001

Closed
zaniebot closed this pull request without merging on Nov 03, 2026 17:26 UTC
View on GitHub
zaniebot zaniebot commented on Oct 27, 2026 19:49 UTC
Author

Depot runners share an Actions cache across branches of the same repository. Use save-if on the Depot Linux tests and benchmarks so the action restores the Rust cache on pull requests and saves it only on main.

Pull request review jobs use cache-mode: read. Depot jobs can still obtain an upload URL directly from the cache API.

Diff: 17 lines (+14 / -3) across 6 files Reviewer: zanieb Review duration: 9937m
All Vouch review confidence checks passed
Residual risk 0.04 = Change Risk (0.28) × (1 − Review Confidence (0.84)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.28 · 17 lines diff across 6 files
0.28
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.74 · 4 substantive comment(s)
0.74
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
84%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.173
Real PR Conversation Timeline
5 items
astral-automations-bot[bot] astral-automations-bot[bot] commented on code on Oct 27, 2026 20:01 UTC
Code Review
.github/workflows/test.yml:1
@@ -146,6 +150,13 @@ jobs:
           if-no-files-found: ignore
           retention-days: 14
 
+  cargo-test-linux-trusted:
+    name: "cargo test on linux (push or dispatch)"
+    if: github.event_name != 'pull_request'
+    runs-on: depot-ubuntu-24.04-16
+    timeout-minutes: 10
+    steps: *linux-test-steps

[P2] Share Rust cache keys across each split job pair

The pinned Rust cache actions include the job ID in both their primary and fallback restore keys by default. Main now saves under cargo-test-linux-trusted, while PRs restore under cargo-test-linux, so PRs cannot consume the newly warmed caches. With PR saves disabled, their caches become stale or disappear. The same mismatch affects both benchmark pairs and the publish pair. Give each pair a stable explicit cache key and disable add-job-id-key (or use shared-key for the direct Swatinem action), keeping unrelated jobs distinct.

zanieb zanieb commented on code on Oct 27, 2026 21:54 UTC
Code Review
.github/workflows/pull-request-code-quality-review.yml:1
@@ -9,6 +9,7 @@ env:
 jobs:
   review:
     name: "code quality review"
+    cache-mode: read # Depot jobs can still request upload URLs directly from the cache API.

    # N.B. despite setting this, Depot jobs allow cache writes directly through the API
    cache-mode: read 

astral-automations-bot[bot] astral-automations-bot[bot] commented on code on Oct 27, 2026 22:11 UTC
Code Review
.github/workflows/bench.yml:1
@@ -40,7 +40,7 @@ jobs:
           profile: |
             debug
             profiling
-          save-if: ${{ inputs.save-rust-cache == 'true' }}
+          save-if: ${{ github.ref == 'refs/heads/main' && inputs.save-rust-cache == 'true' }}

[P3] Retain a trusted cache writer for uv-dev benchmarks

Both benchmark jobs exclude astral-sh/uv-dev on main, and plan.yml only schedules benchmarks for labeled PRs there. This guard therefore leaves uv-dev's benchmark caches without a writer. Once existing entries expire, repeated benchmark runs cannot reuse cached Rust builds; importing CodSpeed profiles from uv does not populate these repository-local caches. Consider retaining a trusted main-branch build/cache-warming path while keeping benchmark measurements disabled there. The same issue applies to the simulated benchmark job.

astral-automations-bot[bot] astral-automations-bot[bot] commented on Nov 03, 2026 17:26 UTC
Bot

Promoted to #23079.

Reviewers
Assignees
zaniebot zaniebot
Labels
risk: low confidence: 84.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 27.6% (LOW) · Higher = larger blast radius
27.6%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 84.5% · Lower = rushed or shallow review
84.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 4.3% · Safe to merge
4.3%