Skip to content

refactor: rename apps/connections to apps/gateway#446

Merged
jeevanpillay merged 2 commits intomainfrom
refactor/rename-connections-to-gateway
Mar 2, 2026
Merged

refactor: rename apps/connections to apps/gateway#446
jeevanpillay merged 2 commits intomainfrom
refactor/rename-connections-to-gateway

Conversation

@jeevanpillay
Copy link
Copy Markdown
Member

Summary

  • Renames apps/connections/apps/gateway/, completing the second half of the two-step rename (first: apps/gatewayapps/relay in refactor: rename apps/gateway to apps/relay #445)
  • Updates package name (@lightfast/connections@lightfast/gateway), Vercel project refs (lightfast-connectionslightfast-gateway), URL paths (/services/connections//services/gateway/), all imports, test aliases, service tags, and comments
  • Preserves domain-concept naming: tRPC connectionsRouter, gw_ DB tables, gw: Redis prefix, and GATEWAY_API_KEY env var are all unchanged

What's NOT changed

  • tRPC router key connections (domain concept, not app name)
  • @repo/gateway-types package (already correct)
  • Database tables (gw_installations, gw_resources) and Redis prefix (gw:)
  • GATEWAY_API_KEY env var (already correct)
  • Port 4110

Post-merge manual steps

  • Rename Vercel project lightfast-connectionslightfast-gateway in dashboard
  • Configure gateway.lightfast.ai DNS in Vercel
  • Update OAuth callback URLs in provider dashboards (GitHub App, Vercel Integration, Linear App, Sentry App) to use /services/gateway/ paths

Test plan

  • pnpm typecheck passes (148/148)
  • pnpm lint passes (131/131)
  • pnpm test passes (75/75)
  • No stale apps/connections, @lightfast/connections, or lightfast-connections references in source files
  • pnpm dev:app starts gateway on port 4110
  • OAuth flows work through /services/gateway/ proxy path

🤖 Generated with Claude Code

Complete the second half of the two-step rename (first: gateway → relay).
Updates package name, Vercel project references, URL paths
(/services/connections → /services/gateway), all imports, test aliases,
comments, and service tags across the monorepo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 2, 2026

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

Project Deployment Actions Updated (UTC)
lightfast-backfill Ready Ready Preview, Comment Mar 2, 2026 1:50am
lightfast-connections Error Error Mar 2, 2026 1:50am
lightfast-console Ready Ready Preview, Comment Mar 2, 2026 1:50am
lightfast-relay Ready Ready Preview, Comment Mar 2, 2026 1:50am
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
lightfast-auth Ignored Ignored Preview Mar 2, 2026 1:50am
lightfast-chat Ignored Ignored Preview Mar 2, 2026 1:50am
lightfast-gateway Ignored Ignored Preview Mar 2, 2026 1:50am
lightfast-docs Skipped Skipped Mar 2, 2026 1:50am
lightfast-www Skipped Skipped Mar 2, 2026 1:50am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 2, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Consolidated the Connections service into the Gateway service: routes, callbacks, and service-to-service endpoints now use the Gateway naming and paths.
    • Build/dev scripts and test suites updated to target the Gateway service, preserving existing behavior and integrations.

Walkthrough

This PR systematically renames the "connections" service to "gateway" across the repository, updating package names, API routes, environment comments, import aliases, URL constants, service labels, rewrites, and integration tests. No functional logic or public API signatures were intentionally changed.

Changes

Cohort / File(s) Summary
Package & Build Configuration
package.json, packages/integration-tests/package.json, apps/gateway/package.json, apps/gateway/vercel.json
Renamed package identifiers and scripts from connections → gateway (package name, build/dev scripts, integration-test devDependency).
Environment & Console Config
api/console/src/env.ts, api/console/src/router/org/connections.ts, apps/console/next.config.ts, apps/console/src/middleware.ts
Updated GATEWAY_API_KEY comments, proxy/rewrite targets and router constants to point at gateway URLs and gateway service paths; adjusted OAuth callback comments.
Gateway Service Core & Routes
apps/gateway/src/app.ts, apps/gateway/src/routes/..., apps/gateway/src/routes/workflows.ts
Rewrote route paths and route bindings from /services/connections/* → /services/gateway/*; updated service labels and doc comments to "gateway".
Gateway Providers & OAuth Redirects
apps/gateway/src/providers/impl/*.ts, apps/gateway/src/providers/impl/*.test.ts
Switched imports and usage from connectionsBaseUrl → gatewayBaseUrl; updated redirect URIs and User-Agent/header strings to reference gateway; updated corresponding tests/mocks.
Gateway Libs & Middleware
apps/gateway/src/lib/urls.ts, apps/gateway/src/lib/cache.ts, apps/gateway/src/middleware/*.ts, apps/gateway/src/lib/github-jwt.ts, apps/gateway/src/middleware/sentry.ts
Renamed exported URL constant(s) to gatewayBaseUrl, updated comments and middleware service tags/fields from connections → gateway, and adjusted User-Agent strings.
Backfill Service & Workflows
apps/backfill/src/lib/related-projects.ts, apps/backfill/src/workflows/*.ts, apps/backfill/src/routes/trigger.ts
Renamed related-project constant to gatewayUrl and updated imports; changed token/installation fetch paths and related error strings to use /services/gateway/* (no control-flow changes).
Console/Integration Rewrites & Tests Setup
packages/integration-tests/vitest.config.ts, packages/integration-tests/tsconfig.json, packages/integration-tests/harness.ts
Replaced path aliases and test config from @connections/* → @gateway/*; updated ServiceApps interface and installServiceRouter wiring to expose gatewayApp on port 4110.
Integration Tests (many)
packages/integration-tests/src/*.integration.test.ts, packages/integration-tests/src/*.test.ts, packages/integration-tests/src/harness.ts
Swapped test imports, mocks and request targets from connectionsApp/URLs → gatewayApp/URLs, updated endpoint paths and expectations to /services/gateway/* and adjusted cache/provider mock module paths.
Console & Backfill Tests
apps/backfill/src/workflows/*.test.ts, apps/gateway/src/routes/*.test.ts, apps/gateway/src/providers/impl/*.test.ts
Updated mocks and expectations to provide gatewayUrl/gatewayBaseUrl instead of connectionsUrl/connectionsBaseUrl; adjusted error-message assertions and test URLs accordingly.
Integration Specs & Manifest Edits
apps/gateway/integration-specs.json, various package scripts
Updated integration-spec callback/setup/redirect URLs from /services/connections/* → /services/gateway/*; updated scripts referencing connections → gateway.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title follows conventional commits format (refactor:) and clearly summarizes the main change of renaming apps/connections to apps/gateway, staying well under the 70-character limit at 49 characters.
Description check ✅ Passed The description is directly related to the changeset, providing comprehensive details about the renaming of apps/connections to apps/gateway, what was changed, what was preserved, post-merge steps, and test plan results.

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


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

Copy link
Copy Markdown
Contributor

@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: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
packages/integration-tests/src/connections-browser-oauth-flow.integration.test.ts (1)

4-8: ⚠️ Potential issue | 🟡 Minor

Update stale route docs to match the gateway route base.

Line 4 says this suite tests gateway flow, but Lines 5-7 still document /connections/... endpoints, which conflicts with Line 128 (/services/gateway...).

✏️ Suggested doc fix
- *   - GET /connections/:provider/authorize (URL + state for browser redirect)
- *   - GET /connections/:provider/callback (browser redirect, not inline)
- *   - GET /connections/oauth/status (polling for completion)
+ *   - GET /services/gateway/:provider/authorize (URL + state for browser redirect)
+ *   - GET /services/gateway/:provider/callback (browser redirect, not inline)
+ *   - GET /services/gateway/oauth/status (polling for completion)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/integration-tests/src/connections-browser-oauth-flow.integration.test.ts`
around lines 4 - 8, Update the stale route docs at the top of the test file to
match the gateway route base used elsewhere (see the /services/gateway base
referenced at line 128): change the documented endpoints from
/connections/:provider/... to /services/gateway/connections/:provider/... so the
comment lists GET /services/gateway/connections/:provider/authorize, GET
/services/gateway/connections/:provider/callback, GET
/services/gateway/connections/oauth/status and the state token lifecycle note,
ensuring the comment in the test suite matches the actual gateway routes
exercised by the tests.
packages/integration-tests/src/full-stack-connection-lifecycle.integration.test.ts (1)

393-393: ⚠️ Potential issue | 🟡 Minor

Test description text is stale after endpoint rename.

Line [393] and the step comment still say /connections/..., but the exercised route is /services/gateway/.... Rename these strings so test intent matches behavior.

✏️ Suggested text-only fix
-  it("DELETE /connections/:provider/:id triggers teardown workflow", async () => {
+  it("DELETE /services/gateway/:provider/:id triggers teardown workflow", async () => {
...
-    // ── 2. DELETE /connections/:provider/:id → teardown_initiated ──
+    // ── 2. DELETE /services/gateway/:provider/:id → teardown_initiated ──

As per coding guidelines, **/*.test.ts: Test files should use descriptive test names.

Also applies to: 470-472

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

In
`@packages/integration-tests/src/full-stack-connection-lifecycle.integration.test.ts`
at line 393, Update the stale test description and inline step comments that
reference the old "/connections/:provider/:id" route so they reflect the actual
exercised route "/services/gateway/:provider/:id"; specifically rename the "it"
description that currently reads "DELETE /connections/:provider/:id triggers
teardown workflow" and any other assertions/comments around the test (including
the blocks at the later occurrence around lines 470-472) to use
"/services/gateway/:provider/:id" so the test name and comments match the
implemented route and clearly describe the behavior being verified.
packages/integration-tests/src/contract-snapshots.test.ts (1)

227-234: 🧹 Nitpick | 🔵 Trivial

Align test titles with the new /services/gateway paths.

The request paths were migrated, but the test names still mention /connections/:id, which is now misleading.

Also applies to: 249-254

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

In `@packages/integration-tests/src/contract-snapshots.test.ts` around lines 227 -
234, Update the two test case titles that still reference `/connections/:id` to
reflect the migrated endpoint `/services/gateway/:id`; specifically edit the
it() descriptions that currently read "GET /connections/:id/token response" (and
the similar title at the later occurrence) so they mention
`/services/gateway/:id` instead, keeping the rest of the test logic (the connReq
calls and assertions) unchanged; look for the test blocks containing the strings
"Shape 2: GET /connections/:id/token response" and the later similar title and
update those titles accordingly.
apps/backfill/src/workflows/backfill-orchestrator.ts (1)

53-63: ⚠️ Potential issue | 🟡 Minor

Fix stale “Connections” wording in timeout/failure errors.

Lines 55 and 62 still report “Connections …” even though this call is now Gateway-bound, which degrades operational clarity.

Suggested fix
-            `Connections getConnection request timed out for ${installationId}`,
+            `Gateway getConnection request timed out for ${installationId}`,
...
-          `Connections getConnection failed: ${response.status} for ${installationId}`,
+          `Gateway getConnection failed: ${response.status} for ${installationId}`,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/backfill/src/workflows/backfill-orchestrator.ts` around lines 53 - 63,
Error messages still say "Connections" but the call is Gateway-bound; update the
thrown Error texts in the timeout and non-ok response paths to reference
"Gateway" instead of "Connections". Specifically change the Error thrown inside
the DOMException timeout branch (where it currently reads `Connections
getConnection request timed out for ${installationId}`) and the Error thrown
when `!response.ok` (currently `Connections getConnection failed:
${response.status} for ${installationId}`) to use "Gateway getConnection" or
similar consistent "Gateway" phrasing while keeping `installationId` and
`response.status` intact.
apps/backfill/src/workflows/entity-worker.ts (1)

84-87: ⚠️ Potential issue | 🟡 Minor

Update stale error label from “Connections” to “Gateway”.

Line 86 now logs the wrong service name after the endpoint migration, which can mislead debugging.

Suggested fix
-            `Connections getToken failed: ${response.status} for ${installationId}`,
+            `Gateway getToken failed: ${response.status} for ${installationId}`,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/backfill/src/workflows/entity-worker.ts` around lines 84 - 87, The
thrown Error message currently says "Connections getToken failed" which is
stale; update the error string in the response.ok failure branch (the Error
thrown where response, installationId are in scope) to say "Gateway getToken
failed" so logs reflect the migrated endpoint/service; ensure the template
remains `Gateway getToken failed: ${response.status} for ${installationId}` and
update any identical occurrences in the same function or surrounding
token-fetching logic (e.g., in entity-worker's token retrieval block) to keep
messages consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@api/console/src/router/org/connections.ts`:
- Around line 22-23: Update deployment sequence and documentation to ensure
runtime lookup succeeds: coordinate the Vercel project rename to
"lightfast-gateway" before merging the change that sets gatewayUrl via
withRelatedProject({ projectName: "lightfast-gateway" }). Add an explicit PR
checklist item and a brief inline comment next to the withRelatedProject usage
so reviewers know the Vercel rename must be completed (or a fallback config/env
used) prior to rollout.

In `@apps/console/next.config.ts`:
- Around line 184-185: Add a temporary legacy rewrite that maps the old ingress
path "/services/connections/:path*" to the new backend destination
`${gatewayUrl}/services/connections/:path*` so OAuth callbacks that still hit
the old path succeed during rollout; add this alongside the existing rewrite for
"/services/gateway/:path*" (use the same pattern as the gateway rewrite), place
the connections rewrite before/above any catch-all rewrites to ensure it
matches, and mark it with a TODO comment to remove after the manual dashboard
updates are complete.

In
`@packages/integration-tests/src/connections-cli-oauth-flow.integration.test.ts`:
- Around line 4-10: Update the file header docblock to match the actual gateway
endpoints used in the tests: replace references to "/connections/..." with the
real routes the tests call under the gateway prefix, e.g. "GET
/services/gateway/connections/:provider/authorize", "GET
/services/gateway/connections/oauth/status", and "GET
/services/gateway/connections/:provider/callback?redirect_to=inline"; ensure the
documented list (the header comment block at the top of
packages/integration-tests/src/connections-cli-oauth-flow.integration.test.ts)
exactly mirrors the test flow: authorize → callback → poll and notes that
gatewayApp.request() is used (no tRPC/service mesh).

---

Outside diff comments:
In `@apps/backfill/src/workflows/backfill-orchestrator.ts`:
- Around line 53-63: Error messages still say "Connections" but the call is
Gateway-bound; update the thrown Error texts in the timeout and non-ok response
paths to reference "Gateway" instead of "Connections". Specifically change the
Error thrown inside the DOMException timeout branch (where it currently reads
`Connections getConnection request timed out for ${installationId}`) and the
Error thrown when `!response.ok` (currently `Connections getConnection failed:
${response.status} for ${installationId}`) to use "Gateway getConnection" or
similar consistent "Gateway" phrasing while keeping `installationId` and
`response.status` intact.

In `@apps/backfill/src/workflows/entity-worker.ts`:
- Around line 84-87: The thrown Error message currently says "Connections
getToken failed" which is stale; update the error string in the response.ok
failure branch (the Error thrown where response, installationId are in scope) to
say "Gateway getToken failed" so logs reflect the migrated endpoint/service;
ensure the template remains `Gateway getToken failed: ${response.status} for
${installationId}` and update any identical occurrences in the same function or
surrounding token-fetching logic (e.g., in entity-worker's token retrieval
block) to keep messages consistent.

In
`@packages/integration-tests/src/connections-browser-oauth-flow.integration.test.ts`:
- Around line 4-8: Update the stale route docs at the top of the test file to
match the gateway route base used elsewhere (see the /services/gateway base
referenced at line 128): change the documented endpoints from
/connections/:provider/... to /services/gateway/connections/:provider/... so the
comment lists GET /services/gateway/connections/:provider/authorize, GET
/services/gateway/connections/:provider/callback, GET
/services/gateway/connections/oauth/status and the state token lifecycle note,
ensuring the comment in the test suite matches the actual gateway routes
exercised by the tests.

In `@packages/integration-tests/src/contract-snapshots.test.ts`:
- Around line 227-234: Update the two test case titles that still reference
`/connections/:id` to reflect the migrated endpoint `/services/gateway/:id`;
specifically edit the it() descriptions that currently read "GET
/connections/:id/token response" (and the similar title at the later occurrence)
so they mention `/services/gateway/:id` instead, keeping the rest of the test
logic (the connReq calls and assertions) unchanged; look for the test blocks
containing the strings "Shape 2: GET /connections/:id/token response" and the
later similar title and update those titles accordingly.

In
`@packages/integration-tests/src/full-stack-connection-lifecycle.integration.test.ts`:
- Line 393: Update the stale test description and inline step comments that
reference the old "/connections/:provider/:id" route so they reflect the actual
exercised route "/services/gateway/:provider/:id"; specifically rename the "it"
description that currently reads "DELETE /connections/:provider/:id triggers
teardown workflow" and any other assertions/comments around the test (including
the blocks at the later occurrence around lines 470-472) to use
"/services/gateway/:provider/:id" so the test name and comments match the
implemented route and clearly describe the behavior being verified.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c2528d5 and f180660.

⛔ Files ignored due to path filters (2)
  • packages/integration-tests/src/__snapshots__/contract-snapshots.test.ts.snap is excluded by !**/*.snap
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !**/pnpm-lock.yaml
📒 Files selected for processing (71)
  • api/console/src/env.ts
  • api/console/src/router/org/connections.ts
  • apps/backfill/src/lib/related-projects.ts
  • apps/backfill/src/routes/trigger.ts
  • apps/backfill/src/workflows/backfill-orchestrator.test.ts
  • apps/backfill/src/workflows/backfill-orchestrator.ts
  • apps/backfill/src/workflows/entity-worker.test.ts
  • apps/backfill/src/workflows/entity-worker.ts
  • apps/backfill/src/workflows/step-replay.test.ts
  • apps/backfill/src/workflows/workflow-contracts.test.ts
  • apps/console/next.config.ts
  • apps/console/src/middleware.ts
  • apps/gateway/.gitignore
  • apps/gateway/.vercelignore
  • apps/gateway/eslint.config.js
  • apps/gateway/integration-specs.json
  • apps/gateway/package.json
  • apps/gateway/src/app.ts
  • apps/gateway/src/env.ts
  • apps/gateway/src/index.ts
  • apps/gateway/src/integration.test.ts
  • apps/gateway/src/lib/cache.ts
  • apps/gateway/src/lib/github-jwt.ts
  • apps/gateway/src/lib/token-store.ts
  • apps/gateway/src/lib/urls.ts
  • apps/gateway/src/middleware/auth.ts
  • apps/gateway/src/middleware/error-sanitizer.ts
  • apps/gateway/src/middleware/lifecycle.ts
  • apps/gateway/src/middleware/request-id.ts
  • apps/gateway/src/middleware/sentry.ts
  • apps/gateway/src/middleware/tenant.ts
  • apps/gateway/src/providers/impl/github.test.ts
  • apps/gateway/src/providers/impl/github.ts
  • apps/gateway/src/providers/impl/linear.test.ts
  • apps/gateway/src/providers/impl/linear.ts
  • apps/gateway/src/providers/impl/sentry.test.ts
  • apps/gateway/src/providers/impl/sentry.ts
  • apps/gateway/src/providers/impl/vercel.test.ts
  • apps/gateway/src/providers/impl/vercel.ts
  • apps/gateway/src/providers/index.test.ts
  • apps/gateway/src/providers/index.ts
  • apps/gateway/src/providers/schemas.ts
  • apps/gateway/src/providers/types.ts
  • apps/gateway/src/routes/connections.integration.test.ts
  • apps/gateway/src/routes/connections.test.ts
  • apps/gateway/src/routes/connections.ts
  • apps/gateway/src/routes/workflows.ts
  • apps/gateway/src/sentry-init.ts
  • apps/gateway/src/workflows/connection-teardown.test.ts
  • apps/gateway/src/workflows/connection-teardown.ts
  • apps/gateway/tsconfig.build.json
  • apps/gateway/tsconfig.json
  • apps/gateway/tsup.config.ts
  • apps/gateway/turbo.json
  • apps/gateway/vercel.json
  • apps/gateway/vitest.config.ts
  • package.json
  • packages/integration-tests/package.json
  • packages/integration-tests/src/api-console-connections.integration.test.ts
  • packages/integration-tests/src/backfill-connections-api.integration.test.ts
  • packages/integration-tests/src/cli-oauth-full-flow.integration.test.ts
  • packages/integration-tests/src/connections-backfill-trigger.integration.test.ts
  • packages/integration-tests/src/connections-browser-oauth-flow.integration.test.ts
  • packages/integration-tests/src/connections-cli-oauth-flow.integration.test.ts
  • packages/integration-tests/src/connections-relay-cache.integration.test.ts
  • packages/integration-tests/src/contract-snapshots.test.ts
  • packages/integration-tests/src/event-ordering.integration.test.ts
  • packages/integration-tests/src/full-stack-connection-lifecycle.integration.test.ts
  • packages/integration-tests/src/harness.ts
  • packages/integration-tests/tsconfig.json
  • packages/integration-tests/vitest.config.ts

- Add inline comment about Vercel project rename dependency on
  withRelatedProject usage
- Add temporary legacy rewrite for /services/connections/:path* so
  OAuth callbacks still work during rollout
- Update error messages in backfill-orchestrator and entity-worker
  from "Connections" to "Gateway" (+ matching test assertions)
- Update docblocks in CLI and browser OAuth test files to use full
  /services/gateway/ paths
- Update test titles in contract-snapshots and full-stack lifecycle
  tests to reflect actual route paths
- Update stale snapshots

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
packages/integration-tests/src/full-stack-connection-lifecycle.integration.test.ts (1)

1-15: 🧹 Nitpick | 🔵 Trivial

Consider updating the file header to reflect the gateway service rename.

The docblock still references "Connections" as a service name in lines 5-7 (e.g., "Connections writes cache", "Connections notifies Backfill", "Backfill fetches from Connections HTTP API"). While the PR preserves domain-concept names like the tRPC router key, these comments describe the service layer rather than the domain concept. Update them to say "Gateway" for consistency with the renamed service.

Suggested docblock update
 * End-to-end integration tests that wire all three services together:
-*   - Connections writes cache → Relay reads it
-*   - Connections notifies Backfill via QStash
-*   - Backfill fetches from Connections HTTP API
+*   - Gateway writes cache → Relay reads it
+*   - Gateway notifies Backfill via QStash
+*   - Backfill fetches from Gateway HTTP API
 *   - Backfill dispatches events to Relay
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/integration-tests/src/full-stack-connection-lifecycle.integration.test.ts`
around lines 1 - 15, Update the file header docblock to replace service-layer
references to "Connections" with the new service name "Gateway" so the comments
match the rename; specifically edit the sentences that currently read like
"Connections writes cache", "Connections notifies Backfill via QStash", and
"Backfill fetches from Connections HTTP API" in the top-of-file comment block in
full-stack-connection-lifecycle.integration.test.ts (the docblock containing
"Suite 5: Full Stack Connection Lifecycle") to use "Gateway" instead of
"Connections" while keeping domain-concept names (like any tRPC router keys)
unchanged.
apps/backfill/src/workflows/entity-worker.test.ts (1)

100-101: ⚠️ Potential issue | 🟡 Minor

Update stale test titles that still reference Connections.

Assertions target Gateway, but two test names still say “Connections API”, which makes failures misleading.

✏️ Suggested rename
-  it("fetches token from Connections API and proceeds", async () => {
+  it("fetches token from Gateway API and proceeds", async () => {
...
-  it("throws when Connections API returns 401", async () => {
+  it("throws when Gateway API returns 401", async () => {

As per coding guidelines: **/*.test.ts: Test files. Review for: - Descriptive test names.

Also applies to: 120-120

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

In `@apps/backfill/src/workflows/entity-worker.test.ts` around lines 100 - 101,
The two test titles within the describe("get-token step") block are stale—rename
the it() descriptions that mention "Connections API" (e.g., "fetches token from
Connections API and proceeds" and the other similar test at the same block) to
reference the Gateway (e.g., "fetches token from Gateway and proceeds") so the
test names match the actual assertions against Gateway; update both it() strings
in the entity-worker.test.ts file to clear, descriptive titles reflecting
Gateway.
apps/backfill/src/workflows/backfill-orchestrator.test.ts (1)

134-134: ⚠️ Potential issue | 🟡 Minor

Rename the test case title to Gateway for consistency.

The assertion now checks a Gateway error, so keeping “Connections API” in the title is outdated.

✏️ Suggested rename
-  it("throws when Connections API returns 404", async () => {
+  it("throws when Gateway API returns 404", async () => {

As per coding guidelines: **/*.test.ts: Test files. Review for: - Descriptive test names.

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

In `@apps/backfill/src/workflows/backfill-orchestrator.test.ts` at line 134, The
test case title is outdated: update the it(...) string in
backfill-orchestrator.test.ts from "throws when Connections API returns 404" to
a Gateway-focused description (e.g., "throws when Gateway returns 404") so it
matches the assertion checking for a Gateway error; locate the it(...)
invocation in the file (the test for backfill orchestrator) and change only the
test name string to reflect "Gateway" for consistency.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@apps/backfill/src/workflows/backfill-orchestrator.test.ts`:
- Line 134: The test case title is outdated: update the it(...) string in
backfill-orchestrator.test.ts from "throws when Connections API returns 404" to
a Gateway-focused description (e.g., "throws when Gateway returns 404") so it
matches the assertion checking for a Gateway error; locate the it(...)
invocation in the file (the test for backfill orchestrator) and change only the
test name string to reflect "Gateway" for consistency.

In `@apps/backfill/src/workflows/entity-worker.test.ts`:
- Around line 100-101: The two test titles within the describe("get-token step")
block are stale—rename the it() descriptions that mention "Connections API"
(e.g., "fetches token from Connections API and proceeds" and the other similar
test at the same block) to reference the Gateway (e.g., "fetches token from
Gateway and proceeds") so the test names match the actual assertions against
Gateway; update both it() strings in the entity-worker.test.ts file to clear,
descriptive titles reflecting Gateway.

In
`@packages/integration-tests/src/full-stack-connection-lifecycle.integration.test.ts`:
- Around line 1-15: Update the file header docblock to replace service-layer
references to "Connections" with the new service name "Gateway" so the comments
match the rename; specifically edit the sentences that currently read like
"Connections writes cache", "Connections notifies Backfill via QStash", and
"Backfill fetches from Connections HTTP API" in the top-of-file comment block in
full-stack-connection-lifecycle.integration.test.ts (the docblock containing
"Suite 5: Full Stack Connection Lifecycle") to use "Gateway" instead of
"Connections" while keeping domain-concept names (like any tRPC router keys)
unchanged.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f180660 and 705bb0a.

⛔ Files ignored due to path filters (1)
  • packages/integration-tests/src/__snapshots__/contract-snapshots.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (10)
  • api/console/src/router/org/connections.ts
  • apps/backfill/src/workflows/backfill-orchestrator.test.ts
  • apps/backfill/src/workflows/backfill-orchestrator.ts
  • apps/backfill/src/workflows/entity-worker.test.ts
  • apps/backfill/src/workflows/entity-worker.ts
  • apps/console/next.config.ts
  • packages/integration-tests/src/connections-browser-oauth-flow.integration.test.ts
  • packages/integration-tests/src/connections-cli-oauth-flow.integration.test.ts
  • packages/integration-tests/src/contract-snapshots.test.ts
  • packages/integration-tests/src/full-stack-connection-lifecycle.integration.test.ts

@jeevanpillay jeevanpillay merged commit ff7306a into main Mar 2, 2026
17 checks passed
@jeevanpillay jeevanpillay deleted the refactor/rename-connections-to-gateway branch March 2, 2026 01:53
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