Skip to content

fix: (Depr Env QA) Surface legacy env var on Connection page#7773

Merged
jobenjada merged 2 commits into
epic/v5from
fix/surface-legacy-id
Apr 27, 2026
Merged

fix: (Depr Env QA) Surface legacy env var on Connection page#7773
jobenjada merged 2 commits into
epic/v5from
fix/surface-legacy-id

Conversation

@jobenjada
Copy link
Copy Markdown
Member

Screenshot 2026-04-19 at 13 03 18

…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.
@jobenjada jobenjada changed the base branch from main to epic/v5 April 19, 2026 11:04
@jobenjada jobenjada requested a review from Dhruwang April 20, 2026 08:35
@jobenjada jobenjada marked this pull request as ready for review April 20, 2026 08:36
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

Walkthrough

This pull request introduces support for legacy environment IDs on workspaces as part of a migration strategy from environmentId to workspaceId. The changes include: adding a legacyEnvironmentId field to the ZWorkspace schema and workspace service queries, updating the app connection settings page to display legacy environment IDs with migration guidance, reversing alert conditional logic on the same page, and adding comprehensive migration documentation. Documentation updates cover the deprecation notice, migration workflow, and integration details across the migration and SDK setup guides.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description contains only a screenshot with no structured explanation, missing required sections like 'What does this PR do?', 'How should this be tested?', and the checklist. Complete the PR description template by adding 'What does this PR do?', 'How should this be tested?', and the required/appreciated checklist items.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: surfacing a legacy environment variable on the Connection page.
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.


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
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: 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 | 🟡 Minor

Settings module's selectWorkspace is missing legacyEnvironmentId, causing inconsistency with the main service.

The settings module's selectWorkspace (apps/web/modules/workspaces/settings/lib/workspace.ts:12-30) does not include legacyEnvironmentId, while the main service's selectWorkspace (apps/web/lib/workspace/service.ts:11-30) does. This affects updateWorkspace, createWorkspace, and deleteWorkspace which return incomplete workspace objects missing this field, inconsistent with the TWorkspace schema that includes legacyEnvironmentId: 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 getWorkspaceAuth from modules/workspaces/lib/utils, which calls the main service's getWorkspace and thus receives the full workspace object with legacyEnvironmentId.

🤖 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

📥 Commits

Reviewing files that changed from the base of the PR and between 9d2e988 and 79309dc.

⛔ Files ignored due to path filters (15)
  • apps/web/i18n.lock is excluded by !**/*.lock
  • apps/web/locales/de-DE.json is excluded by !apps/web/locales/**
  • apps/web/locales/en-US.json is excluded by !apps/web/locales/**
  • apps/web/locales/es-ES.json is excluded by !apps/web/locales/**
  • apps/web/locales/fr-FR.json is excluded by !apps/web/locales/**
  • apps/web/locales/hu-HU.json is excluded by !apps/web/locales/**
  • apps/web/locales/ja-JP.json is excluded by !apps/web/locales/**
  • apps/web/locales/nl-NL.json is excluded by !apps/web/locales/**
  • apps/web/locales/pt-BR.json is excluded by !apps/web/locales/**
  • apps/web/locales/pt-PT.json is excluded by !apps/web/locales/**
  • apps/web/locales/ro-RO.json is excluded by !apps/web/locales/**
  • apps/web/locales/ru-RU.json is excluded by !apps/web/locales/**
  • apps/web/locales/sv-SE.json is excluded by !apps/web/locales/**
  • apps/web/locales/zh-Hans-CN.json is excluded by !apps/web/locales/**
  • apps/web/locales/zh-Hant-TW.json is excluded by !apps/web/locales/**
📒 Files selected for processing (6)
  • apps/web/lib/workspace/service.ts
  • apps/web/modules/workspaces/settings/(setup)/app-connection/page.tsx
  • docs/docs.json
  • docs/self-hosting/advanced/migration.mdx
  • docs/xm-and-surveys/surveys/website-app-surveys/workspace-id-migration.mdx
  • packages/types/workspace.ts

@jobenjada jobenjada enabled auto-merge (squash) April 20, 2026 09:02
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 27, 2026

CLA assistant check
All committers have signed the CLA.

@jobenjada jobenjada merged commit 016e14d into epic/v5 Apr 27, 2026
4 of 10 checks passed
@jobenjada jobenjada deleted the fix/surface-legacy-id branch April 27, 2026 14:20
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.

3 participants