Skip to content

fix(gcs): support authorized user ADC credentials#2733

Open
vladpetric wants to merge 1 commit into
mozilla:mainfrom
vladpetric:gcs-authorized-user-adc
Open

fix(gcs): support authorized user ADC credentials#2733
vladpetric wants to merge 1 commit into
mozilla:mainfrom
vladpetric:gcs-authorized-user-adc

Conversation

@vladpetric

Copy link
Copy Markdown

Summary

  • support Google authorized_user ADC JSON files for GCS by exchanging the refresh token for an access token and passing that token to OpenDAL
  • keep non-authorized_user GCS credential files on the existing credential_path path
  • report multilevel storage as writable when at least one configured level is writable, so a writable L0 disk cache can still accept writes when a remote L1 is read-only

Motivation

Local Google ADC files created by gcloud auth application-default login use type: authorized_user. The existing OpenDAL credential-path path rejects those files and falls back to metadata-server auth, which fails on normal developer machines.

This lets local sccache users authenticate GCS via their existing user ADC file while preserving the existing service-account behavior.

Testing

  • cargo fmt --manifest-path /home/vlad/build/sccache/Cargo.toml --check
  • cargo test --manifest-path /home/vlad/build/sccache/Cargo.toml cache::multilevel
  • cargo build --manifest-path /home/vlad/build/sccache/Cargo.toml --release
  • local smoke test with disk L0 + GCS L1 using an authorized_user ADC file:
    • sccache daemon starts with both levels
    • GCS L1 is readable
    • read-only GCS L1 does not prevent writes to disk L0
    • repeated C compile hits disk L0 on the second invocation

@codecov-commenter

codecov-commenter commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 7.69231% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.96%. Comparing base (5d52f91) to head (f709805).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/cache/gcs.rs 0.00% 60 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (5d52f91) and HEAD (f709805). Click for more details.

HEAD has 10 uploads less than BASE
Flag BASE (5d52f91) HEAD (f709805)
14 4
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2733       +/-   ##
===========================================
- Coverage   74.51%   60.96%   -13.55%     
===========================================
  Files          70       69        -1     
  Lines       39652    37944     -1708     
===========================================
- Hits        29546    23133     -6413     
- Misses      10106    14811     +4705     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sylvestre

Copy link
Copy Markdown
Collaborator

a bunch of jobs are failing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants