Skip to content

Add URL-based build sources (GCS/HTTPS) to cvd fetch#2238

Open
larsers wants to merge 1 commit intogoogle:mainfrom
larsers:pr/gcs-url-fetch
Open

Add URL-based build sources (GCS/HTTPS) to cvd fetch#2238
larsers wants to merge 1 commit intogoogle:mainfrom
larsers:pr/gcs-url-fetch

Conversation

@larsers
Copy link

@larsers larsers commented Mar 9, 2026

Add support for GCS (gs://), HTTPS, and HTTP URLs as build sources in cvd fetch, alongside the existing Android CI and local directory build sources.

  • Add UrlBuildString and UrlBuild variant types to the build type system
    (BuildString/Build std::variant)
  • Add UrlDownloader class for GCS (via JSON API) and HTTP/HTTPS downloads,
    reusing existing HttpClient infrastructure
  • Scope OAuth2 auth headers to Google hosts only (*.googleapis.com,
    *.google.com) to prevent credential leakage to third-party servers
  • Handle automatic archive extraction (.zip, .tar.gz) and selective file
    extraction via {filepath} suffix syntax (e.g.,
    gs://bucket/images.zip{boot.img})
  • Add unit tests for URL parsing, filename extraction, and Google host validation

This change allows direct use of URLs in --default_build and other --*_build flags, e.g:

  cvd fetch --default_build=gs://my-bucket/aosp-images.zip
  cvd fetch --default_build=https://example.com/cvd-host_package.tar.gz

Integrate URL support into the existing --*_build flags
(--default_build, --kernel_build, etc.) so that gs://, https://,
and http:// URLs can be used as build sources alongside CI and
directory builds.

Key changes:
- Add UrlBuildString and UrlBuild variant types to the build
  type system (BuildString/Build std::variant)
- Add UrlDownloader class for GCS (via JSON API) and HTTP/HTTPS
  downloads, reusing existing HttpClient infrastructure
- Scope auth headers to Google hosts only (*.googleapis.com,
  *.google.com) to prevent credential leakage
- Handle automatic archive extraction (.zip, .tar.gz) and
  selective file extraction via {filepath} suffix syntax
- Add unit tests for URL parsing, filename extraction, and
  Google host validation
@google-cla
Copy link

google-cla bot commented Mar 9, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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.

2 participants