feat(edge): route PACKAGES requests to the per-R-minor slot

- add edge/rpkgs-router.ts, which redirects PACKAGES, PACKAGES.gz and
  PACKAGES.rds into …/src/contrib/<x.y>/ for slots listed in UNION_SLOTS
- leave tarballs alone: R keeps the pre-redirect contrib URL, so the union
  index steers per-minor tarballs with a Path field instead
- stop resolving an unidentifiable distro to a phantom linux-gnu/linux-musl
  slot and send those clients to CRAN
- mark every redirect no-store, since the target depends on the User-Agent
- cover the routing matrix in edge/rpkgs-router.test.ts, run by just edge-test
- correct the spec and plan: the union index carries Path: <x.y> on per-minor
  records, not Path: .. on flat ones
This commit is contained in:
Patrick Schratz 2026-08-07 14:00:14 +00:00
commit 628d19d650
No known key found for this signature in database
GPG key ID: 62050D5BC68AB6DC

View file

@ -73,3 +73,17 @@ rebuild os tag arch package *versions:
--build-arg CACHEBUST="$(date +%s)" \
-f docker/build-one.Dockerfile \
local
# run the edge middleware routing matrix (uses a local deno, else the deno image)
edge-test:
#!/usr/bin/env bash
set -euo pipefail
if command -v deno >/dev/null 2>&1; then
deno test -A edge/rpkgs-router.test.ts
else
docker run --rm \
-v "$PWD:/w" -w /w \
-v deno-cache:/deno-dir \
denoland/deno:latest \
deno test -A edge/rpkgs-router.test.ts
fi