Skip to content

chore(e2e): pin anthropic for api e2e, servers, and ci#143

Merged
gaboesquivel merged 2 commits into
mainfrom
agent-default
Mar 23, 2026
Merged

chore(e2e): pin anthropic for api e2e, servers, and ci#143
gaboesquivel merged 2 commits into
mainfrom
agent-default

Conversation

@gaboesquivel
Copy link
Copy Markdown
Member

@gaboesquivel gaboesquivel commented Mar 23, 2026

Summary by CodeRabbit

Release Notes

  • Chores

    • Updated E2E testing infrastructure to use Anthropic as the designated AI provider.
  • Documentation

    • Updated E2E testing documentation to reflect Anthropic API key requirements.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
basilic-fastify Ready Ready Preview, Comment Mar 23, 2026 11:17pm
basilic-next Ready Ready Preview, Comment Mar 23, 2026 11:17pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
basilic-docs Ignored Ignored Preview Mar 23, 2026 11:17pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 23, 2026

Warning

Rate limit exceeded

@gaboesquivel has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 57 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 475315e0-9aff-45f3-b946-946963be288f

📥 Commits

Reviewing files that changed from the base of the PR and between a9b94a0 and c1786ab.

📒 Files selected for processing (4)
  • .github/workflows/api-e2e.yml
  • .github/workflows/web-e2e.yml
  • apps/api/scripts/run-e2e-local.mjs
  • apps/web/scripts/start-e2e-servers.mjs

Walkthrough

The changes standardize end-to-end test infrastructure to use Anthropic as the exclusive AI provider. Environment variables are updated in CI workflows and scripts to set AI_PROVIDER=anthropic, and alternative AI provider configurations (OPEN_ROUTER_API_KEY, OLLAMA_BASE_URL, AI_DEFAULT_MODEL) are removed from test environments. Documentation is also updated accordingly.

Changes

Cohort / File(s) Summary
CI Workflows
.github/workflows/api-e2e.yml, .github/workflows/web-e2e.yml
Added AI_PROVIDER=anthropic workflow environment variable to both E2E test workflows.
E2E Scripts
apps/api/scripts/run-e2e-local.mjs, apps/web/scripts/start-e2e-servers.mjs
Set AI_PROVIDER to 'anthropic' in spawned process environments and removed alternate AI provider configuration variables (OPEN_ROUTER_API_KEY, OLLAMA_BASE_URL, AI_DEFAULT_MODEL) to isolate test environments.
Documentation & Tests
apps/docu/content/docs/testing/frontend-testing.mdx, apps/web/e2e/chat-assistant.spec.ts
Updated documentation to reference ANTHROPIC_API_KEY instead of OPEN_ROUTER_API_KEY, and updated test skip reason message to generalize AI provider reference.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 Hop, hop! The tests now dance with Claude in hand,
Anthropic whispers secrets to our E2E land,
OpenRouter bows out, the stage is set,
One provider, one vision—the finest AI bet! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: pinning Anthropic as the AI provider across E2E tests, local scripts, CI workflows, and documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent-default

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
apps/api/scripts/run-e2e-local.mjs (1)

78-82: Mirror the existing JWT fail-fast pattern for ANTHROPIC_API_KEY.

This script forces Anthropic, so validating the key up front will make local E2E failures deterministic and easier to diagnose.

Suggested guard clause
   const env = {
     ...process.env,
     ...loaded,
     ALLOW_TEST: 'true',
     PGLITE: 'true',
     NODE_ENV: 'test',
     JWT_SECRET: jwtSecret,
     AI_PROVIDER: 'anthropic',
   }
   delete env.OPEN_ROUTER_API_KEY
   delete env.OLLAMA_BASE_URL
   delete env.AI_DEFAULT_MODEL
+  if (!env.ANTHROPIC_API_KEY) {
+    process.stderr.write(
+      'E2E local: ANTHROPIC_API_KEY is required when AI_PROVIDER=anthropic.\n',
+    )
+    process.exit(1)
+  }

As per coding guidelines, "Favor fail-fast/guard clauses and keep success path at top indentation if refactoring logic around env construction/filters."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/api/scripts/run-e2e-local.mjs` around lines 78 - 82, Add a fail-fast
guard that validates process.env.ANTHROPIC_API_KEY (same pattern used for the
JWT check) before continuing: if the env var is missing or empty, log a clear
error and exit non‑zero (e.g., console.error(...) and process.exit(1)). Place
this check near the other env deletions/assignments so the script fails
deterministically upfront and refer to the same env object/symbol (env /
ANTHROPIC_API_KEY) and use the same exit/logging approach as the existing JWT
guard.
apps/web/scripts/start-e2e-servers.mjs (1)

22-26: Add a startup guard for ANTHROPIC_API_KEY when forcing Anthropic.

Since this entrypoint hard-pins provider selection, fail fast if the key is missing to avoid opaque downstream failures.

Suggested guard clause
 const env = {
   ...process.env,
   ALLOW_TEST: 'true',
   PGLITE: 'true',
   NODE_ENV: 'test',
   NEXT_PUBLIC_API_URL: 'http://localhost:3001',
   AI_PROVIDER: 'anthropic',
 }
 delete env.OPEN_ROUTER_API_KEY
 delete env.OLLAMA_BASE_URL
 delete env.AI_DEFAULT_MODEL
+if (!env.ANTHROPIC_API_KEY) {
+  process.stderr.write(
+    'start-e2e-servers: ANTHROPIC_API_KEY is required when AI_PROVIDER=anthropic\n',
+  )
+  process.exit(1)
+}

As per coding guidelines, "Favor fail-fast/guard clauses and keep success path at top indentation if refactoring logic around env construction/filters."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/scripts/start-e2e-servers.mjs` around lines 22 - 26, Add a fail-fast
guard that checks for env.ANTHROPIC_API_KEY immediately after forcing
AI_PROVIDER: 'anthropic' (before the deletes of
OPEN_ROUTER_API_KEY/OLLAMA_BASE_URL/AI_DEFAULT_MODEL): if env.AI_PROVIDER ===
'anthropic' and env.ANTHROPIC_API_KEY is missing/empty, log a clear error (e.g.,
console.error or processLogger.error) and terminate the process (throw or
process.exit(1)) so startup fails fast with an explicit message.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/api-e2e.yml:
- Around line 26-27: Add a hard-fail guard to the CI workflow so that when
AI_PROVIDER is set to "anthropic" the job immediately errors if
ANTHROPIC_API_KEY is empty or unset: add a pre-step (before tests) that checks
the environment variables AI_PROVIDER and ANTHROPIC_API_KEY and exits non-zero
with a clear error message when AI_PROVIDER == "anthropic" and ANTHROPIC_API_KEY
is empty; reference the workflow env names AI_PROVIDER and ANTHROPIC_API_KEY
(and the job step that runs E2E) so the check runs before any API E2E execution
to enforce the non-empty secret requirement.

In @.github/workflows/web-e2e.yml:
- Around line 30-31: Add a fail-fast CI check before e2e tests that verifies the
ANTHROPIC_API_KEY secret when AI_PROVIDER is set to "anthropic": insert a
workflow step that reads the AI_PROVIDER and ANTHROPIC_API_KEY environment
variables (the symbols AI_PROVIDER and ANTHROPIC_API_KEY from the current job's
env) and exits non‑zero with a clear error if AI_PROVIDER == "anthropic" and
ANTHROPIC_API_KEY is empty or unset so the run fails fast instead of proceeding
with skip paths.

---

Nitpick comments:
In `@apps/api/scripts/run-e2e-local.mjs`:
- Around line 78-82: Add a fail-fast guard that validates
process.env.ANTHROPIC_API_KEY (same pattern used for the JWT check) before
continuing: if the env var is missing or empty, log a clear error and exit
non‑zero (e.g., console.error(...) and process.exit(1)). Place this check near
the other env deletions/assignments so the script fails deterministically
upfront and refer to the same env object/symbol (env / ANTHROPIC_API_KEY) and
use the same exit/logging approach as the existing JWT guard.

In `@apps/web/scripts/start-e2e-servers.mjs`:
- Around line 22-26: Add a fail-fast guard that checks for env.ANTHROPIC_API_KEY
immediately after forcing AI_PROVIDER: 'anthropic' (before the deletes of
OPEN_ROUTER_API_KEY/OLLAMA_BASE_URL/AI_DEFAULT_MODEL): if env.AI_PROVIDER ===
'anthropic' and env.ANTHROPIC_API_KEY is missing/empty, log a clear error (e.g.,
console.error or processLogger.error) and terminate the process (throw or
process.exit(1)) so startup fails fast with an explicit message.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bc5ea1ae-59b6-4475-ac38-fe2481ac7dc6

📥 Commits

Reviewing files that changed from the base of the PR and between 0687c1c and a9b94a0.

⛔ Files ignored due to path filters (1)
  • apps/api/.env.test.example is excluded by !**/.env*
📒 Files selected for processing (6)
  • .github/workflows/api-e2e.yml
  • .github/workflows/web-e2e.yml
  • apps/api/scripts/run-e2e-local.mjs
  • apps/docu/content/docs/testing/frontend-testing.mdx
  • apps/web/e2e/chat-assistant.spec.ts
  • apps/web/scripts/start-e2e-servers.mjs

Comment thread .github/workflows/api-e2e.yml
Comment thread .github/workflows/web-e2e.yml
@gaboesquivel gaboesquivel merged commit 4737c94 into main Mar 23, 2026
9 checks passed
@gaboesquivel gaboesquivel deleted the agent-default branch March 23, 2026 23:19
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