Skip to content

feat: add DEFAULT_WORKSPACE_SLUGS instance config for auto-onboarding#8768

Open
Quentin-M wants to merge 1 commit intomakeplane:previewfrom
Quentin-M:feat/default-workspace-slugs
Open

feat: add DEFAULT_WORKSPACE_SLUGS instance config for auto-onboarding#8768
Quentin-M wants to merge 1 commit intomakeplane:previewfrom
Quentin-M:feat/default-workspace-slugs

Conversation

@Quentin-M
Copy link

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

  • Comma-separated slugs: "my-org,my-org-dev" — joins specific workspaces; first slug is the landing workspace
  • Wildcard *: auto-joins all workspaces on the instance; oldest workspace is the landing workspace
  • Safe for existing users: only fires when the user has zero workspace memberships
  • Skips onboarding: sets is_onboarded=True and all onboarding_step flags so the user goes straight to the workspace
  • Configurable via God Mode: text input under Workspace Management settings
  • Env var fallback: DEFAULT_WORKSPACE_SLUGS env var, same as all other instance config

Changes

File Change
apps/api/plane/utils/instance_config_variables/core.py Register DEFAULT_WORKSPACE_SLUGS in workspace_management_config_variables
apps/api/plane/authentication/utils/workspace_project_join.py Add auto_join_default_workspaces(user)
apps/api/plane/authentication/utils/user_auth_workflow.py Call auto_join_default_workspaces after invite processing
packages/types/src/instance/workspace.ts Add "DEFAULT_WORKSPACE_SLUGS" to TInstanceWorkspaceConfigurationKeys
apps/admin/app/(all)/(dashboard)/workspace/page.tsx God Mode UI: text input with */slug hint

Testing

  1. Set DEFAULT_WORKSPACE_SLUGS=my-workspace in God Mode or env
  2. New user logs in → lands directly in my-workspace, no onboarding
  3. Existing user with memberships logs in → unaffected
  4. Set DEFAULT_WORKSPACE_SLUGS=* → new user joins all workspaces
  5. Unset → standard onboarding flow restored

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 17, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6e34a11e-4f1b-43e1-9343-0fcbebe84f79

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

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 # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json at the top of your CodeRabbit configuration file.

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
@Quentin-M Quentin-M force-pushed the feat/default-workspace-slugs branch from b0df947 to 8930c16 Compare March 18, 2026 01:18
@Quentin-M Quentin-M changed the base branch from develop to preview March 18, 2026 01:18
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