Repository navigation
Make sbt Docker e2e jar fetch survive Central 403/404s - #1291
Conversation
agent_sbt_versions_patch_in_place failed in 0.05s on PR run 37948228245 when Maven Central answered 404 for the pinned commons-text-1.9.jar. fetch_from_central retried only transport errors, 429 and 5xx, so a single stale CDN negative entry failed the cell before docker run. Every URL the helper fetches is a pinned, released artifact Central never deletes, so a 404 is the same CDN blip sbt-warm-seed.sh already retries; treat it the same way. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CfAQ1cTuWfH3kKiCi6pPR4
|
bugbot run Generated by Claude Code |
|
Generated by Claude Code |
On this PR's own run (37954180751) the sbt 1.9.9 agent leg failed both tests in 0.07s with 403 Forbidden for the pinned commons-text-1.9.jar, while the other seven agent legs fetched the same jar fine. Like the 404, it is one runner's CDN edge rejecting a public, released artifact, so retry it the same way. Also identify the client with a User-Agent: reqwest sends none by default. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CfAQ1cTuWfH3kKiCi6pPR4
|
bugbot run Generated by Claude Code |
coverage-docker (sbt) on this PR (run 37957095405) got 403 Forbidden from repo1.maven.org on all five tries in both agent tests, about 15s of backoff each, so retrying the same edge cannot ride it out. Alternate attempts between Central and Google's official Central mirror and check the jar against Central's published sha1, now pinned, instead of fetching the .sha1 from the same origin. Whichever mirror answers, the test patches the exact released bytes. Verified locally: a scratch test fetching through jars() passes, and with the Central URL broken (Central answers 403) the second attempt gets the jar from the mirror and the sha1 matches. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CfAQ1cTuWfH3kKiCi6pPR4
|
bugbot run Generated by Claude Code |
With the User-Agent from d63015a, every Linux agent, mill and scala-cli leg of run 37957095379 and coverage-docker (sbt) got 403 from repo1.maven.org on all five tries. On the commit before it, without the header, seven of eight agent legs fetched the jar fine. The header is the likeliest trigger, so go back to reqwest's default request; the Google mirror fallback still covers a 403 from Central. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CfAQ1cTuWfH3kKiCi6pPR4
|
bugbot run Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 2f52f2f. Configure here.
|
Ready for review (burn-down agent).
Generated by Claude Code |
|
[final reviewer] I disarmed auto-merge. Tanmay Singla (@Tanmay182003), three commits that aren't merges from
All three are confined to the sbt Docker e2e fetch (test infra, no product code). Once you re-approve, auto-merge can be re-armed. Generated by Claude Code |
Problem
sbt / Mill / scala-cli compatibilityfailed on an unrelated PR (refactor/crate-bloat-cleanup, run 37948228245, jobsbt 2.0.9 / jdk 17 / agent):The cell died before
docker run, on the test's own download of the pristine jar. That jar has been on Central since 2020. It was 1 of the 7 failedpull_requestruns in the last 8h, and the only one with an infra cause that no open PR already covers. The BunrefusalCodesExactcell is the other candidate, but #1244 already changesscripts/backtest-bun.py.Update: 403 seen too
This PR's own run 37954180751 failed
sbt 1.9.9 / jdk 17 / agent: both tests failed in 0.07s withcommons-text-1.9.jar: 403 Forbidden. The other 7 agent legs in the same run fetched the jar fine, so it is the same per-runner edge blip as the 404. The second commit also retries 403 and sets aUser-Agent(reqwest sends none by default).Update 2: a 403 that outlasted the retries, so add a mirror fallback
coverage-docker (sbt)(run 37957095405, required byci-ok) got403 Forbiddenfrom repo1.maven.org on all 5 tries in both agent tests. Retrying the same edge can't ride that out. The third commit:repo1.maven.organd Google's official Central mirror (maven-central.storage-download.googleapis.com/maven2);ba6ac8c2…e2, identical from all three hosts) and checks the jar against it, so whichever mirror answers, the test patches the exact released bytes. It also drops the separate.sha1request.Local proof: a scratch test calling
jars()passes. With the Central base URL deliberately broken (Central answers 403), attempt 2 gets the jar from the mirror and the sha1 matches. I removed the scratch test afterwards.Update 3: User-Agent removed
On
d63015a, every Linux agent, mill and scala-cli leg of run 37957095379, pluscoverage-docker (sbt), got 403 from repo1.maven.org on all 5 tries. On the commit before it, 7 of 8 legs fetched the jar fine. The customUser-Agentis the likeliest trigger, so2f52f2fdrops it and goes back to reqwest's default request. The pinned-sha1 Google-mirror fallback stays.Root cause
fetch_from_centralretries only transport errors, 429 and 5xx. A 404 failed on the first attempt. Central's CDN sometimes serves a stale negative entry for an artifact that exists.scripts/sbt-warm-seed.shalready lists "a CDN 429, 404 or reset" as a blip it retries.Fix
Also retry
404 Not Foundinfetch_from_central, with the same 5 attempts and backoff. Every URL the helper fetches is a pinned, released artifact (CENTRAL_JARand its.sha1), so a 404 can't be a real "artifact gone" signal that a retry would hide. If one ever were, the finalpanic!still fails the test, now with the attempt history. This doesn't change test coverage, and there are no workflow changes.Proof
cargo clippy -p socket-patch-cli --features docker-e2e --test docker_e2e_sbt -- -D warnings: clean.rustfmt --checkon the touched file: clean.Where tests run
Unchanged. No tests were removed or moved.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CfAQ1cTuWfH3kKiCi6pPR4
Generated by Claude Code
Note
Low Risk
Test-only changes to HTTP retry and mirror selection for a fixed fixture jar; no production or workflow behavior.
Overview
Hardens the sbt Docker e2e fixture so CI no longer flakes when
repo1.maven.orgreturns 403/404 for the pinnedcommons-text-1.9.jarbefore containers even start.fetch_from_centralnow takes a Maven path (not a full URL), alternates between Maven Central and Google’s official Central mirror across up to six retries, and treats 403, 404, 429, and 5xx (plus transport errors) as transient. Backoff is capped; failure logs include the mirror URL.jars()drops the live.sha1fetch and asserts the downloaded bytes against a pinned Central SHA1, so either mirror can serve the artifact without changing test semantics.Reviewed by Cursor Bugbot for commit 2f52f2f. Configure here.
Generated by Claude Code