fix: update tests to use new dev URL and signing secret#135
fix: update tests to use new dev URL and signing secret#135splindsay-92 merged 4 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughUpdates GitHub Actions workflows to use Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
test/e2e/web-cli/helpers/signing-helper.ts (1)
103-118:⚠️ Potential issue | 🟡 Minor
logSigningStatusstill referencesCI_BYPASS_SECRET, contradictinggetTestSecretbehavior.
getTestSecret()andisSigningAvailable()no longer considerCI_BYPASS_SECRET, butlogSigningStatus()still checks it (line 106) and can report"CI_BYPASS_SECRET"as the active secret (lines 115-116). When onlyCI_BYPASS_SECRETis set,getTestSecret()returns the fallback dev secret, yet the log would misleadingly claimCI_BYPASS_SECRETis in use. This will confuse anyone debugging signing issues.Proposed fix: remove stale CI_BYPASS_SECRET reference
export function logSigningStatus(): void { const hasTerminalSecret = !!process.env.TERMINAL_SERVER_SIGNING_SECRET; const hasSigningSecret = !!process.env.SIGNING_SECRET; - const hasCISecret = !!process.env.CI_BYPASS_SECRET; console.log("[Signing Helper] Configuration:", { TERMINAL_SERVER_SIGNING_SECRET: hasTerminalSecret ? "SET" : "NOT SET", SIGNING_SECRET: hasSigningSecret ? "SET" : "NOT SET", usingSecret: hasTerminalSecret ? "TERMINAL_SERVER_SIGNING_SECRET" : hasSigningSecret ? "SIGNING_SECRET" - : hasCISecret - ? "CI_BYPASS_SECRET" - : "fallback", + : "fallback (dev-test-secret)", }); }
🤖 Fix all issues with AI agents
In @.github/workflows/e2e-web-cli-parallel.yml:
- Around line 218-226: The rate-limit job is currently setting the environment
variable TERMINAL_SERVER_SIGNING_SECRET which causes test-rate-limiter.ts to
disable rate limiting (connectionsPerBatch: 1000, pauseDuration: 0), so remove
TERMINAL_SERVER_SIGNING_SECRET from the job's env block (the env that includes
NO_COLOR, E2E_ABLY_API_KEY, TEST_GROUP: rate-limit, etc.) so the rate-limit test
runs with real limits; also verify no other env or secrets in this job inject
TERMINAL_SERVER_SIGNING_SECRET.
In `@test/e2e/web-cli/domain-scoped-auth.test.ts`:
- Around line 252-254: The fallback assigned to actualDomain includes the scheme
("wss://") so the localStorage key check (k.includes(actualDomain)) never
matches; change the fallback to the bare host or always extract the host portion
so actualDomain holds "web-cli-terminal.ably-dev.com". Update the assignment of
actualDomain (where process.env.TERMINAL_SERVER_URL is checked) to parse the URL
and use .host for both code paths (or replace the literal
"wss://web-cli-terminal.ably-dev.com" with "web-cli-terminal.ably-dev.com") so
currentDomainKeys and the subsequent assertion operate on matching domain
strings.
🧹 Nitpick comments (4)
test/e2e/web-cli/test-rate-limiter.ts (1)
22-36: Stale log message: still references "CI bypass" after switching to signing secret.Line 29 logs
Rate limiting DISABLED - CI bypass enabledbut the condition now checksTERMINAL_SERVER_SIGNING_SECRET. The message should reflect the new semantics to avoid confusion when debugging CI logs.Suggested fix
- `[RateLimit Config] Rate limiting DISABLED - CI bypass enabled`, + `[RateLimit Config] Rate limiting DISABLED - server signing secret available`,test/e2e/web-cli/helpers/ci-auth.ts (1)
43-49: JSDoc refers to "bypass secret" but the implementation now checksTERMINAL_SERVER_SIGNING_SECRET.Minor doc inconsistency — the comment says "bypass secret is available" but the function now checks
TERMINAL_SERVER_SIGNING_SECRET. Consider updating the JSDoc to reflect the new env var name.📝 Suggested doc update
/** * Check if CI bypass mode should be used - * `@returns` true if CI mode is enabled and bypass secret is available + * `@returns` true if TERMINAL_SERVER_SIGNING_SECRET is available */test/e2e/web-cli/helpers/base-test.ts (1)
163-168:isProductionnow checks for a dev domain — consider renaming for clarity.The variable
isProductionis checking forweb-cli-terminal.ably-dev.com, which is a development environment. The name is misleading; this is really detecting "remote server" vs "local server." A rename likeisRemoteServerwould better convey intent.📝 Suggested rename
- const isProduction = + const isRemoteServer = !process.env.TERMINAL_SERVER_URL || process.env.TERMINAL_SERVER_URL.includes("web-cli-terminal.ably-dev.com"); - if (isProduction) { + if (isRemoteServer) { await page.waitForTimeout(1000); }test/e2e/web-cli/wait-helpers.ts (1)
16-20: SameisProductionnaming concern as inbase-test.ts.This
isProductionvariable now detectsweb-cli-terminal.ably-dev.com(a dev domain). Consider renaming toisRemoteServerfor consistency with the suggested change inbase-test.ts.
dabd169 to
809373a
Compare
1249011 to
bfeec97
Compare
bfeec97 to
7b4d224
Compare
…_SECRET dependency with TERMINAL_SERVER_SIGNING_SECRET
7b4d224 to
3f84606
Compare
12c9542 to
4c032ed
Compare
44756be to
8301dbb
Compare
8301dbb to
b5d0771
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
23732ff to
d4da846
Compare
d4da846 to
3f798c3
Compare
CI tests were failing since we switched to using website-signed config. This fixes the issues by using the new dev CLI and server signing secret (no longer uses CI bypass).
Note
Medium Risk
Touches CI auth/token injection and test rate-limit gating, so misconfiguration can cause broad CI/E2E failures; functional product logic impact is limited to default WebSocket URL selection in the example app.
Overview
CI and E2E test execution now uses
TERMINAL_SERVER_SIGNING_SECRET(and injected CI auth token) instead of the legacyCI_BYPASS_SECRET, with GitHub workflows updated accordingly (includingNO_COLOR=1for cleaner logs).Default WebSocket/HTTP endpoints used by the Web CLI app, unit tests, and Playwright E2E suites are switched from
web-cli.ably.comto the dev hosted terminalweb-cli-terminal.ably-dev.com, and shared helpers are refactored to centralize terminal URL selection and “remote server” detection for timeouts/delays/rate-limit behavior. Legacy browser CI auth utilities (packages/react-web-cli/src/lib/ci-auth.ts) are removed and signing-secret lookup fallbacks are tightened.Written by Cursor Bugbot for commit 3f798c3. This will update automatically on new commits. Configure here.