Closed jkoritzinsky closed 9 months ago
Attention: 69 lines
in your changes are missing coverage. Please review.
Comparison is base (
ffe3070
) 30.77% compared to head (6d906b9
) 30.76%. Report is 4 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Could you please add a test and fix the clippy warning? Thanks
I've fixed the clippy warning and added a few unit tests.
Sorry, I was talking about an integration test like https://github.com/mozilla/sccache/blob/ffe3070f77ef3301c8ff718316e4ab017ec83042/tests/sccache_cargo.rs#L318 thanks
@sylvestre I've added a test that validates (through the sccache log) that in a scenario where the underlying cache is detected as read-only, the ReadOnlyStorage handles the write requests and the requests never go to the underlying storage.
thanks!
Today, sccache can detect that a storage medium is read-only or read-write even if this capability was not specified by the config. However, it doesn't do anything with this information other than log it for diagnostics.
This PR changes sccache to use this information to avoid writing to a read-only storage. This is useful for cases where one might want to use sccache in a read-only configuration in some cases (e.g. public PR builds) while only updating the cache from a separate pipeline (that has write access) without using a separate configuration file.
Additionally, this change reduces the number of "access denied" errors that would be logged on the storage side when sccache detects that it only has read-only access (instead of continuing to attempt to write to the storage).
Fixes #1853