[History Server] Cover GetContent object paths for the s3 and azureblob backends #5075
All Vouch review confidence checks passed
Residual risk 0.32 = Change Risk (0.57) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.57 · 619 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.385
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #5075"
general
weight: 0.35
KunWuLuan
Why are these changes needed?
GetContentbuilds its object path from three pieces,rootDir, the cluster path prefix, and the file name. Neither the s3 nor the azureblob backend had a single test touching that.pkg/storage/s3/s3_test.goandpkg/storage/azureblob/azureblob_test.gocontained onlyTestTrimandTestWalk, which never construct a handler, never call a storage method, and contain no assertion that can fail.This is not a hypothetical gap. The aliyunoss backend shipped without the root dir in that path, which is #4820: on a deployment started with
--ray-root-dir, listing the log tree worked and every fetch from it returnedNoSuchKey. The same mistake in s3 or azureblob would produce the same silent breakage, and nothing in the suite would notice.This PR adds two tests per backend. There is no production change.
How the tests work
Each test drives the real SDK against an
httptestserver, so the assertion is on the object path that actually reaches the wire rather than on a helper's return value. For s3 that means path style addressing, which the backend already supports for MinIO. For azureblob the container client is pointed at the test server with no credential.The first test in each pair pins the full object path. The second covers the list-and-retry fallback, whose listing prefix has to be rooted as well, otherwise the retry has nothing to find.
The two backends need slightly different fallback setups because their matching rules differ. s3 matches a listed candidate by base name, so the test puts the object one directory deeper. azureblob matches on the full path, so its test misses the first download instead. That one uses
BlobNotFoundrather than a server error on purpose: the SDK retries server errors, which would satisfy the download before the fallback ever ran.Related issue number
None. The gap was found while investigating #4820. It is not part of the #5065 follow-up epic, whose six items are all something else.
Labels
doc-updates-requiredlabel.breaking-changelabel.Checks
- [x] Unit tests
Evidence
New tests pass on both backends:
A passing test against already correct code proves nothing on its own, so both backends were mutation tested. The production file was swapped in via
go test -overlay, leaving the tree untouched.Mutation A, drop the root dir and cluster prefix from the object path. Both tests go red on both backends:
Mutation B, leave the object path correct and break only the fallback listing prefix. Only the fallback test goes red, on both backends:
Mutation B is the useful one: it shows the two tests in each pair are not redundant, since the second catches a defect the first cannot see.
Rest of the module.
go vet ./...is clean and every non e2e package passes. The one failure,TestGetSessionDir_FatalError_FailsFastinpkg/utils, fails identically on a cleanorigin/mastercheckout on this machine and is unrelated to this change: it depends on symlink behavior this Windows host does not provide.What was not tested
delimiterparameter, so flat versus hierarchical listing is not covered. Changing the s3 fallback from_listFiles(dirPath, "", false)to_listFiles(dirPath, "/", false)still passes. These tests are scoped to the object path, not to listing behavior.go test -race, whichmake testruns in CI, needs a C toolchain this machine does not have. Shared state in the tests is behind a mutex, since the servers handle requests on their own goroutines.---
_This change was developed with AI assistance from Claude. I reviewed and verified it before submitting._