Skip to content

refactor: remove SOURCEBOT_TENANCY_MODE and multi-tenancy code paths#1075

Merged
brendan-kellam merged 2 commits intomainfrom
brendan/remove-tenancy-mode
Apr 2, 2026
Merged

refactor: remove SOURCEBOT_TENANCY_MODE and multi-tenancy code paths#1075
brendan-kellam merged 2 commits intomainfrom
brendan/remove-tenancy-mode

Conversation

@brendan-kellam
Copy link
Copy Markdown
Contributor

@brendan-kellam brendan-kellam commented Apr 2, 2026

Summary

  • Removes the SOURCEBOT_TENANCY_MODE env var, tenancyModeSchema, and TenancyMode type
  • Removes multi-tenancy init logic and org selector UI from the navigation menu
  • Deletes the tenancy docs page (docs/docs/configuration/tenancy.mdx)

Test plan

  • Verify app starts correctly in single-tenant mode
  • Verify navigation menu renders without org selector
  • Verify no remaining references to SOURCEBOT_TENANCY_MODE

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • Removed multi-tenancy support and related configurations from the application.
  • Documentation

    • Removed multi-tenancy configuration guide documentation.
  • Features Removed

    • Removed organization selector dropdown from the navigation menu. The application now operates in single-tenant mode only.

Single tenancy is now the only mode. Removes the tenancy mode env var,
schema, multi-tenancy init logic, org selector UI, and tenancy docs page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mintlify
Copy link
Copy Markdown

mintlify bot commented Apr 2, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
sourcebot 🟢 Ready View Preview Apr 2, 2026, 3:11 AM

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

@brendan-kellam your pull request is missing a changelog!

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f254797d-4aae-47f8-8537-420c5973f749

📥 Commits

Reviewing files that changed from the base of the PR and between 81419b2 and 5bd4318.

📒 Files selected for processing (11)
  • .env.development
  • docs/docs/configuration/tenancy.mdx
  • packages/shared/src/env.server.ts
  • packages/shared/src/index.server.ts
  • packages/shared/src/types.ts
  • packages/web/src/app/[domain]/components/navigationMenu/index.tsx
  • packages/web/src/app/[domain]/components/orgSelector/index.tsx
  • packages/web/src/app/[domain]/components/orgSelector/orgIcon.tsx
  • packages/web/src/app/[domain]/components/orgSelector/orgSelectorDropdown.tsx
  • packages/web/src/initialize.ts
  • packages/web/src/lib/types.ts

Walkthrough

This PR removes all multi-tenancy support from the application, including the SOURCEBOT_TENANCY_MODE environment variable, type schema, organization selector UI components, and associated initialization logic that dispatched between single and multi-tenant modes.

Changes

Cohort / File(s) Summary
Configuration & Environment
.env.development, packages/shared/src/env.server.ts, packages/shared/src/types.ts, packages/shared/src/index.server.ts, packages/web/src/lib/types.ts
Removed SOURCEBOT_TENANCY_MODE environment variable declaration, tenancyModeSchema Zod enum, and TenancyMode type alias from env schema, types, exports, and public type declarations.
Documentation
docs/docs/configuration/tenancy.mdx
Deleted multi-tenancy configuration documentation page covering prerequisites, mode switching, organization isolation, and UI flows.
Organization Selector Components
packages/web/src/app/[domain]/components/orgSelector/index.tsx, packages/web/src/app/[domain]/components/orgSelector/orgIcon.tsx, packages/web/src/app/[domain]/components/orgSelector/orgSelectorDropdown.tsx
Removed OrgSelector async component, OrgIcon component, and OrgSelectorDropdown client component that enabled organization switching via dropdown UI.
Navigation Menu
packages/web/src/app/[domain]/components/navigationMenu/index.tsx
Removed conditional rendering of OrgSelector component and separator; navigation menu now unconditionally renders base menu items.
Initialization Logic
packages/web/src/initialize.ts
Refactored initialization from tenancy-mode dispatch pattern (initSingleTenancy/initMultiTenancy) to unified init() function; removed multi-tenancy entitlement validation, startup termination logic, and support email import.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch brendan/remove-tenancy-mode

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.

@brendan-kellam brendan-kellam merged commit 05bb0c7 into main Apr 2, 2026
7 of 8 checks passed
@brendan-kellam brendan-kellam deleted the brendan/remove-tenancy-mode branch April 2, 2026 03:12
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