Skip to content

server: serve Bazel over HTTP on organization hosts - #44

Merged
Uzaaft merged 2 commits into
masterfrom
org-host/bazel-http
Nov 18, 2026
Merged

Uzaaft merged 2 commits into
masterfrom
org-host/bazel-http

Conversation

@Uzaaft

@Uzaaft Uzaaft commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Second of three stacked PRs for Polymath-AS/snowstead-service#20. Stacked on #43.

Serves Bazel's HTTP cache at <org>.<suffix>/<cache>/bazel. /_api/v1/bazel/<org>/<cache> keeps working and reads the same entries.

  • The Bazel router is split so only the HTTP route joins the organization-host dispatch; gRPC stays unreachable there (pinned by a test).
  • Tests cover auth, cross-organization isolation, a cache with Bazel disabled, digest and path edge cases, and the CDN no-store override on an anonymous public read. An ignored test runs real Bazel through the organization host.

pnpm check passes.

An organization host answered every request as a Nix read, so the Go
and sccache caches were reachable only under /_api/v1/<product>/<org>/
<cache> on the shared host. Customers should configure one address
shape, <org>.<suffix>/<cache>/<product>.

The cache router now registers /{cache}/go and /{cache}/sccache with
their trailing forms. On an organization host their handler rewrites
the path to the canonical protocol route and dispatches it into a
router holding only the Go and sccache routes, so authorization, limits,
and storage are the existing handlers' and management or upload routes
stay unreachable from an organization host. On any other host the same
shape remains a path-based Nix read, which keeps caches named go or
sccache working. PROPFIND answers with the path the client used.

Two things change shape. On an organization host, a product path with a
method the protocol rejects now gets the protocol's JSON 404 or 405
instead of the Nix read's 405. Requests matching the new routes are
labelled with them in metrics rather than as cache reads.
Organization hosts served Go and sccache at /<cache>/<product>, but
Bazel's HTTP cache was still reachable only under /_api/v1/bazel/<org>/
<cache> on the shared host.

Bazel joins the product list. Its router is split so the HTTP route can
be dispatched from an organization host on its own: the gRPC services
stay out of the organization-host router and remain unreachable there.
The handler, limits, and store are unchanged, and both addresses read
the same entries.

Responses on an organization host keep their own Cache-Control but are
marked no-store for the CDN, like every other response there, so only
anonymous reads of public caches on the shared host are edge-cached.
@Uzaaft
Uzaaft changed the base branch from org-host/go-sccache to master November 18, 2026 15:24
@Uzaaft
Uzaaft merged commit b3269ca into master Nov 18, 2026
1 check passed
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.

1 participant