feat: set user agent in webdav requests#2284
Conversation
src/cache/webdav.rs
Outdated
| } | ||
|
|
||
| /// Set the user agent (helps with monitoring on the server side) | ||
| fn set_user_agent() -> HttpClient { |
There was a problem hiding this comment.
I recall that we already have similar code that builds an HTTP client. Would you like to check the codebase again?
There was a problem hiding this comment.
You're right! I've removed the copied code and referenced set_user_agent from src/cache/s3.rs.
Xuanwo
left a comment
There was a problem hiding this comment.
Others look good to me. Thank you @lukevmorris for working for this.
Xuanwo
left a comment
There was a problem hiding this comment.
Thank you @lukevmorris for working on this!
|
Could you please document this ? https://github.com/mozilla/sccache/?tab=readme-ov-file |
|
thanks. (your patch is conflicting) |
|
@sylvestre not a dumb question at all. I had considered that but wasn't sure what scope of change would be appreciated. I can try and make that change if you'd like? |
|
yeah, i think it makes sense :) |
|
Ok I ended up moving Let me know what you think! |
|
facepalm I didn't check in the new file. Hopefully that addresses the test failures. |
docs/Azure.md
Outdated
|
|
||
| You can also define a prefix that will be prepended to the keys of all cache objects created and read within the container, effectively creating a scope. To do that use the `SCCACHE_AZURE_KEY_PREFIX` environment variable. This can be useful when sharing a bucket with another application. | ||
|
|
||
| Requests sent to Azure Blob Storage will have a user agent header indicating the current sccache version, e.g. `sccache/0.8.2`. |
There was a problem hiding this comment.
i don't think we should duplicate it
just declare it once :)
There was a problem hiding this comment.
Ok sorry! I centralized it in one section at the bottom of the README. What do you think?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2284 +/- ##
==========================================
- Coverage 30.91% 0 -30.92%
==========================================
Files 53 0 -53
Lines 20112 0 -20112
Branches 9755 0 -9755
==========================================
- Hits 6217 0 -6217
+ Misses 7922 0 -7922
+ Partials 5973 0 -5973 ☔ View full report in Codecov by Sentry. |
I have a WebDAV server that I use as a backend remote cache for multiple build tools. Many of these build tools (e.g.
bazel,gradle) differentiate themselves in their user agent header, whereassccachedoes not. This PR configures the WebdavCache service with an http client preconfigured with a user agent header like so:sccache/0.8.2. These changes are nearly identical to those in #2137. Happy to make whatever changes you feel may be necessary. Thanks!