Skip to content

ci: fix content api tests startup and auth - #19275

Merged
denolfe merged 1 commit into
mainfrom
ci/content-api-issue
Nov 2, 2026
Merged

denolfe merged 1 commit into
mainfrom
ci/content-api-issue

Conversation

@denolfe

@denolfe denolfe commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

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

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between f4f5c5c and 3eb2bba.

Files selected for processing: 1
  • .github/workflows/main.yml

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The Content API test workflow now starts Valkey 8, checks its health, and provides its Redis URL to the Content API container for rate limiting.

Changes: Content API test setup

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: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the CI fix for Content API test startup and authentication failures. It is concise and matches the main changes.
Description check Passed The description directly explains the Content API test failures, their root causes, and the Valkey and environment-variable changes that address them.
Docstring Coverage Passed 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. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
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.

Share

@denolfe
denolfe marked this pull request as ready for review November 2, 2026 16:11
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

📦 esbuild Bundle Analysis for payload

This analysis was generated by esbuild-bundle-analyzer. 🤖
This PR introduced no changes to the esbuild bundle! 🙌

@denolfe
denolfe merged commit 3a3f2bb into main Nov 2, 2026
298 checks passed
@denolfe
denolfe deleted the ci/content-api-issue branch November 2, 2026 16:40
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🚀 This is included in version v4.0.0-beta.7

denolfe added a commit that referenced this pull request Nov 4, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants