Content API Tests fail on PRs and on main. On PRs, the Content API
server does not start. On main, the server starts but rejects every
request with a 401. The job is non-blocking, and main shows green with
13 of 2732 tests passing.
## Root Cause
The Content API image loads a bundled `.env.local` when
`NODE_ENV=development`. Recent upstream changes set two values there
that CI does not override:
- `JWKS_URI` (the URL where the server fetches its token-verification
keys) points to port 18088. CI serves the API on 8080. The key fetch
fails, and the server rejects the tokens it issued from `/dev/jwt`.
- `RATE_LIMIT_VALKEY_URL` points to `localhost:16379`. The server needs
this connection to start. CI has no Valkey, so newer images exit before
they listen.
## Changes
- **Valkey service container**
- Adds `valkey/valkey:8` on port 6379 with a `valkey-cli ping` health
check.
- **Explicit Content API env**
- CI sets `JWKS_URI`, `RATE_LIMIT_VALKEY_URL`, and `VALKEY_URL` on
`docker run`.
- Node's `loadEnvFile` does not override variables that are already set.
The image's dev defaults cannot change these values.
🤖 Written with AI
(cherry picked from commit 3a3f2bb)
Port of #19275 from
mainto3.x. Content API Tests fail on 3.x PRs because the Content API server does not start.On #19300, the server exits with "Failed to connect to Content API rate-limit Valkey after 3 attempts". #19300 needs this port before its Content API job can pass.
Root Cause
The Content API image loads a bundled
.env.localwhenNODE_ENV=development. Two values in it do not match CI:RATE_LIMIT_VALKEY_URLpoints tolocalhost:16379. The server needs this connection to start. CI has no Valkey (a Redis-compatible key-value store), so the server exits before it listens.JWKS_URI(the URL where the server fetches its token-verification keys) points to port 18088. CI serves the API on 8080. The key fetch fails, and the server rejects the tokens it issued from/dev/jwt.Changes
mainwith no conflicts. Only.github/workflows/main.ymlchanges.valkey/valkey:8on port 6379 with avalkey-cli pinghealth check.JWKS_URI,RATE_LIMIT_VALKEY_URL, andVALKEY_URLondocker run.loadEnvFiledoes not override variables that are already set. The image defaults cannot change these values.🤖 Written with AI