Repository navigation
ci: fix content api tests startup and auth - #19275
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Configure Valkey for Content API tests .github/workflows/main.yml |
The workflow description identifies Valkey as a rate-limiting startup dependency. The job starts Valkey 8 on port 6379 and checks it with valkey-cli ping. The Content API container receives RATE_LIMIT_VALKEY_URL and VALKEY_URL, both set to redis://localhost:6379. |
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Suggested reviewers: germanjablo
Merge Risk: 
Minimal · up to 3eb2b
-
The Content API test workflow has no identified merge-blocking risk.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖 |
|
🚀 This is included in version v4.0.0-beta.7 |
Port of #19275 from `main` to `3.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.local` when `NODE_ENV=development`. Two values in it do not match CI: - `RATE_LIMIT_VALKEY_URL` points to `localhost: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 - **Port of #19275** - Cherry-picked from `main` with no conflicts. Only `.github/workflows/main.yml` 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 defaults cannot change these values. 🤖 Written with AI
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.localwhenNODE_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_URLpoints tolocalhost:16379. The server needs this connection to start. CI has no Valkey, so newer images exit before they listen.Changes
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's dev defaults cannot change these values.🤖 Written with AI