fix: (Depr Env QA) Surface legacy env var on Connection page#7773
Conversation
jobenjada
commented
Apr 19, 2026
…onnection settings - Introduced new translations for legacy environment ID and migration alerts in multiple languages. - Updated the app connection page to display legacy environment ID and relevant migration information. - Added legacy environment ID field in the workspace type definition. - Updated documentation to include migration guidance for transitioning from environment IDs to workspace IDs.
WalkthroughThis pull request introduces support for legacy environment IDs on workspaces as part of a migration strategy from 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/web/lib/workspace/service.ts (1)
11-30:⚠️ Potential issue | 🟡 MinorSettings module's
selectWorkspaceis missinglegacyEnvironmentId, causing inconsistency with the main service.The settings module's
selectWorkspace(apps/web/modules/workspaces/settings/lib/workspace.ts:12-30) does not includelegacyEnvironmentId, while the main service'sselectWorkspace(apps/web/lib/workspace/service.ts:11-30) does. This affectsupdateWorkspace,createWorkspace, anddeleteWorkspacewhich return incomplete workspace objects missing this field, inconsistent with theTWorkspaceschema that includeslegacyEnvironmentId: z.string().nullable().optional(). The impact is most visible in audit logging where the saved newObject lacks this field.Note: The app-connection page itself is unaffected since it uses
getWorkspaceAuthfrom modules/workspaces/lib/utils, which calls the main service'sgetWorkspaceand thus receives the full workspace object withlegacyEnvironmentId.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/web/lib/workspace/service.ts` around lines 11 - 30, The settings module's selectWorkspace omits legacyEnvironmentId causing updateWorkspace/createWorkspace/deleteWorkspace to return workspace objects missing that field; fix by adding legacyEnvironmentId: true to the selectWorkspace object in the settings module so its selects match the main service's selectWorkspace (ensure the property name matches the TWorkspace schema and will be returned as nullable/optional as before), which will restore consistency for functions like updateWorkspace, createWorkspace, deleteWorkspace and for audit logging.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/xm-and-surveys/surveys/website-app-surveys/workspace-id-migration.mdx`:
- Around line 14-70: Convert all headings to the project's Camel Case guideline:
change title-case headings like "Why This Changed", "Terms To Know", "What Still
Works", "Recommended Migration", "SDK Example", and the FAQ subheadings ("Do I
Need To Rotate IDs Immediately?", "Do Test And Production Workflows Change?",
"Where Can I Find Detailed Setup Guides?") to sentence-style/camel case with
only product/feature nouns capitalized (e.g., "Why this changed" → "Why this
changed", "Terms to know" → "Terms to know", "Recommended migration" →
"Recommended migration", "SDK example" → "SDK example", and FAQ items to "Do I
need to rotate IDs immediately?", "Do test and production workflows change?",
"Where can I find detailed setup guides?"); also ensure the document does not
start with an H1 by keeping the first heading level appropriate and only
capitalizing feature nouns like "Workspace ID", "SDK", and "FAQ".
---
Outside diff comments:
In `@apps/web/lib/workspace/service.ts`:
- Around line 11-30: The settings module's selectWorkspace omits
legacyEnvironmentId causing updateWorkspace/createWorkspace/deleteWorkspace to
return workspace objects missing that field; fix by adding legacyEnvironmentId:
true to the selectWorkspace object in the settings module so its selects match
the main service's selectWorkspace (ensure the property name matches the
TWorkspace schema and will be returned as nullable/optional as before), which
will restore consistency for functions like updateWorkspace, createWorkspace,
deleteWorkspace and for audit logging.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: a805a96d-4d55-4860-88fe-c583315c9496
⛔ Files ignored due to path filters (15)
apps/web/i18n.lockis excluded by!**/*.lockapps/web/locales/de-DE.jsonis excluded by!apps/web/locales/**apps/web/locales/en-US.jsonis excluded by!apps/web/locales/**apps/web/locales/es-ES.jsonis excluded by!apps/web/locales/**apps/web/locales/fr-FR.jsonis excluded by!apps/web/locales/**apps/web/locales/hu-HU.jsonis excluded by!apps/web/locales/**apps/web/locales/ja-JP.jsonis excluded by!apps/web/locales/**apps/web/locales/nl-NL.jsonis excluded by!apps/web/locales/**apps/web/locales/pt-BR.jsonis excluded by!apps/web/locales/**apps/web/locales/pt-PT.jsonis excluded by!apps/web/locales/**apps/web/locales/ro-RO.jsonis excluded by!apps/web/locales/**apps/web/locales/ru-RU.jsonis excluded by!apps/web/locales/**apps/web/locales/sv-SE.jsonis excluded by!apps/web/locales/**apps/web/locales/zh-Hans-CN.jsonis excluded by!apps/web/locales/**apps/web/locales/zh-Hant-TW.jsonis excluded by!apps/web/locales/**
📒 Files selected for processing (6)
apps/web/lib/workspace/service.tsapps/web/modules/workspaces/settings/(setup)/app-connection/page.tsxdocs/docs.jsondocs/self-hosting/advanced/migration.mdxdocs/xm-and-surveys/surveys/website-app-surveys/workspace-id-migration.mdxpackages/types/workspace.ts
…to fix/surface-legacy-id