fix: removes project references#7907
Conversation
WalkthroughThis pull request updates terminology and identifiers throughout the codebase to reflect a shift from "project" to "workspace" nomenclature. Changes include parameter renames in utility functions (e.g., 🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ 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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.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 (2)
docs/api-v2-reference/openapi.yml (2)
3104-3120:⚠️ Potential issue | 🟠 MajorRequire a workspace selector on create/update/delete.
These request shapes still allow clients to omit both
workspaceIdandprojectId, even though the association cannot be identified fromteamIdalone. That also drifts fromcomponents.schemas.workspaceTeam, which now treatsworkspaceIdas required.Also applies to: 3178-3194, 3246-3256
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/api-v2-reference/openapi.yml` around lines 3104 - 3120, Add the workspace selector as required on these request schemas: include "workspaceId" in the required list (in addition to "teamId" and "permission") for the create/update/delete request shapes shown (the blocks containing properties workspaceId, projectId, permission around the ranges referenced); keep projectId as a deprecated alias but do not rely on it—make workspaceId mandatory so the association can be identified (this should mirror components.schemas.workspaceTeam where workspaceId is required).
5544-5583:⚠️ Potential issue | 🟠 Major
projectOverwritesneeds a deprecation bridge, not a hard rename.In the v2 schema this is a public field. Replacing it outright with
workspaceOverwriteschanges the generated contract for existing clients, unlike theprojectIdmigration above where both names are documented. KeepprojectOverwritesas a deprecated alias for at least one version, or ship this as an explicit versioned breaking change.Also applies to: 5828-5828
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/api-v2-reference/openapi.yml` around lines 5544 - 5583, The schema replaced the public field projectOverwrites with workspaceOverwrites outright; instead restore projectOverwrites as a deprecated alias that keeps the same contract for one release: add a projectOverwrites property that either references the same schema as workspaceOverwrites (using $ref or allOf) or duplicates its type/enum/patterns, mark it deprecated (deprecated: true and update description to note deprecation and timeline), and ensure both properties are documented in the OpenAPI for backward compatibility; apply the same change where projectOverwrites appears (also around the other occurrence noted at line ~5828).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@apps/web/modules/ee/feedback-record-directory/lib/feedback-record-directory.ts`:
- Line 193: The change replaced the machine-facing error code expected by
callers; restore the original emitted value to avoid breaking consumers by
throwing InvalidInputError with the legacy code "DIRECTORY_PROJECTS_INVALID_ORG"
instead of "DIRECTORY_WORKSPACES_INVALID_ORG" (or add a compatibility mapping so
InvalidInputError still emits "DIRECTORY_PROJECTS_INVALID_ORG" while you
introduce a new constant for future use); update the throw site that currently
uses InvalidInputError("DIRECTORY_WORKSPACES_INVALID_ORG") to emit the legacy
string or to emit both (legacy first) so existing handlers continue to work.
In
`@apps/web/modules/ee/feedback-record-directory/types/feedback-record-directory.ts`:
- Around line 66-67: The new mapping replaced the legacy error code and can
break clients still sending DIRECTORY_PROJECTS_INVALID_ORG; restore backward
compatibility by keeping both cases: ensure the switch returns the same
translation
t("workspace.settings.feedback_record_directories.error_directory_workspaces_invalid_org")
for the legacy constant DIRECTORY_PROJECTS_INVALID_ORG as well as
DIRECTORY_WORKSPACES_INVALID_ORG so both error codes map to the identical
localized message.
---
Outside diff comments:
In `@docs/api-v2-reference/openapi.yml`:
- Around line 3104-3120: Add the workspace selector as required on these request
schemas: include "workspaceId" in the required list (in addition to "teamId" and
"permission") for the create/update/delete request shapes shown (the blocks
containing properties workspaceId, projectId, permission around the ranges
referenced); keep projectId as a deprecated alias but do not rely on it—make
workspaceId mandatory so the association can be identified (this should mirror
components.schemas.workspaceTeam where workspaceId is required).
- Around line 5544-5583: The schema replaced the public field projectOverwrites
with workspaceOverwrites outright; instead restore projectOverwrites as a
deprecated alias that keeps the same contract for one release: add a
projectOverwrites property that either references the same schema as
workspaceOverwrites (using $ref or allOf) or duplicates its type/enum/patterns,
mark it deprecated (deprecated: true and update description to note deprecation
and timeline), and ensure both properties are documented in the OpenAPI for
backward compatibility; apply the same change where projectOverwrites appears
(also around the other occurrence noted at line ~5828).
🪄 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: 1883908d-3e4e-44b5-be57-673639c23780
⛔ Files ignored due to path filters (12)
apps/web/locales/de-DE.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/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/tr-TR.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 (21)
apps/web/app/(app)/workspaces/[workspaceId]/actions.tsapps/web/lib/utils/templates.test.tsapps/web/modules/ee/analysis/charts/lib/charts.test.tsapps/web/modules/ee/analysis/dashboards/lib/dashboards.test.tsapps/web/modules/ee/feedback-record-directory/lib/feedback-record-directory.test.tsapps/web/modules/ee/feedback-record-directory/lib/feedback-record-directory.tsapps/web/modules/ee/feedback-record-directory/types/feedback-record-directory.tsapps/web/modules/ee/license-check/lib/utils.test.tsapps/web/modules/entitlements/lib/self-hosted-provider.test.tsapps/web/modules/response-pipeline/lib/telemetry.test.tsapps/web/modules/survey/components/template-list/lib/utils.test.tsapps/web/modules/survey/editor/components/survey-editor.tsxapps/web/modules/survey/list/lib/utils.test.tsapps/web/modules/survey/list/lib/utils.tsapps/web/modules/survey/multi-language-surveys/components/language-view.tsxdocker/formbricks.shdocs/api-v2-reference/openapi.ymldocs/development/standards/organization/naming-conventions.mdxpackages/database/README.mdpackages/surveys/README.mdpackages/surveys/src/components/general/survey.test.tsx
|



Fixes https://linear.app/formbricks/issue/ENG-709