feat: add DEFAULT_WORKSPACE_SLUGS instance config for auto-onboarding#8768
feat: add DEFAULT_WORKSPACE_SLUGS instance config for auto-onboarding#8768Quentin-M wants to merge 1 commit intomakeplane:previewfrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 Tip You can validate your CodeRabbit configuration file in your editor.If your editor has YAML language server, you can enable auto-completion and validation by adding |
Adds a new instance configuration key DEFAULT_WORKSPACE_SLUGS that automatically adds new users (with no existing workspace memberships) as Members to configured workspaces on first login, bypassing the onboarding flow entirely. This solves a common pain point for self-hosted single-organization deployments where manually inviting every user is impractical. ## Behavior - Accepts a comma-separated list of workspace slugs: `"my-org,my-org-dev"` - Accepts `"*"` as a wildcard to auto-join all workspaces on the instance - Only fires when the user has no workspace memberships (safe for existing users) - First slug (or oldest workspace for `*`) becomes the landing workspace - Marks `is_onboarded=True` so the user lands directly in the workspace ## Changes - `apps/api/plane/utils/instance_config_variables/core.py`: register key - `apps/api/plane/authentication/utils/workspace_project_join.py`: add `auto_join_default_workspaces(user)` function - `apps/api/plane/authentication/utils/user_auth_workflow.py`: call it - `packages/types/src/instance/workspace.ts`: add TS type - `apps/admin/app/(all)/(dashboard)/workspace/page.tsx`: God Mode UI text input
b0df947 to
8930c16
Compare
Problem
Self-hosted single-organization deployments have no way to automatically add new users to existing workspaces. Every new user hits the onboarding flow and is asked to create a workspace — even when workspace creation is disabled. The only workaround is manually inviting every user before they log in.
Solution
Add a new instance configuration key
DEFAULT_WORKSPACE_SLUGS. When set, new users with no workspace memberships are automatically added as Members to the configured workspaces on first login, and marked as onboarded, so they land directly in the workspace.Behavior
"my-org,my-org-dev"— joins specific workspaces; first slug is the landing workspace*: auto-joins all workspaces on the instance; oldest workspace is the landing workspaceis_onboarded=Trueand allonboarding_stepflags so the user goes straight to the workspaceDEFAULT_WORKSPACE_SLUGSenv var, same as all other instance configChanges
apps/api/plane/utils/instance_config_variables/core.pyDEFAULT_WORKSPACE_SLUGSinworkspace_management_config_variablesapps/api/plane/authentication/utils/workspace_project_join.pyauto_join_default_workspaces(user)apps/api/plane/authentication/utils/user_auth_workflow.pyauto_join_default_workspacesafter invite processingpackages/types/src/instance/workspace.ts"DEFAULT_WORKSPACE_SLUGS"toTInstanceWorkspaceConfigurationKeysapps/admin/app/(all)/(dashboard)/workspace/page.tsx*/slug hintTesting
DEFAULT_WORKSPACE_SLUGS=my-workspacein God Mode or envmy-workspace, no onboardingDEFAULT_WORKSPACE_SLUGS=*→ new user joins all workspaces