cache-control to no-store for metadata uploads to S3#1728
Conversation
gated by env P_S3_CACHE_CONTROL_NO_STORE (default false) this is as per the current behaviour if set to true, for all non parquet uploads to S3 (gcs/azure-blob no impact) Cache-Control header is set to true
WalkthroughAdds configurable ChangesConditional object cache control
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/storage/metrics_layer.rs (1)
344-383: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExercise the wrapper upload methods in tests.
These tests call
set_cache_controldirectly, so a regression input_optsorput_multipart_optscould leave real uploads without the header while all tests still pass. Add a recording-store or request-level test covering both methods for JSON and Parquet paths.object_storeexposes attributes through both option types, and S3 mapsAttribute::CacheControlto the request header. (docs.rs)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/storage/metrics_layer.rs` around lines 344 - 383, Add request-level tests that exercise MetricLayer’s put_opts and put_multipart_opts methods for both JSON and Parquet paths, using a recording or inspecting store to verify propagated attributes. Confirm JSON uploads include Attribute::CacheControl set to no-store while Parquet uploads omit it, covering both wrapper methods rather than calling set_cache_control directly.Source: MCP tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/storage/metrics_layer.rs`:
- Around line 344-383: Add request-level tests that exercise MetricLayer’s
put_opts and put_multipart_opts methods for both JSON and Parquet paths, using a
recording or inspecting store to verify propagated attributes. Confirm JSON
uploads include Attribute::CacheControl set to no-store while Parquet uploads
omit it, covering both wrapper methods rather than calling set_cache_control
directly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 25503237-a455-4c7c-a224-eb193b790edc
📒 Files selected for processing (2)
src/storage/metrics_layer.rssrc/storage/s3.rs
gated by env P_S3_CACHE_CONTROL_NO_STORE (default false)
this is as per the current behaviour
if set to true, for all non parquet uploads to S3 (gcs/azure-blob no impact)
Cache-Control header is set to true
before
after
Summary by CodeRabbit
New Features
Tests