Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: remove branch management flag (#29607)

Alaister Youngf5dd70d42585
diff --git a/apps/studio/components/interfaces/BranchManagement/EmptyStates.tsx b/apps/studio/components/interfaces/BranchManagement/EmptyStates.tsx
index cd0f99a35dd..4432578919c 100644
--- a/apps/studio/components/interfaces/BranchManagement/EmptyStates.tsx
+++ b/apps/studio/components/interfaces/BranchManagement/EmptyStates.tsx
@@ -5,14 +5,12 @@ import Link from 'next/link'
import ProductEmptyState from 'components/to-be-cleaned/ProductEmptyState'
import { ButtonTooltip } from 'components/ui/ButtonTooltip'
import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
-import { useFlag } from 'hooks/ui/useFlag'
import { useAppStateSnapshot } from 'state/app-state'
import { Button } from 'ui'
export const BranchingEmptyState = () => {
const snap = useAppStateSnapshot()
- const hasAccessToBranching = useFlag<boolean>('branchManagement')
const canEnableBranching = useCheckPermissions(PermissionAction.CREATE, 'preview_branches', {
resource: { is_default: true },
})
@@ -20,26 +18,24 @@ export const BranchingEmptyState = () => {
return (
<ProductEmptyState title="Database Branching">
<p className="text-sm text-light">
- {hasAccessToBranching
- ? 'Create preview branches to experiment changes to your database schema in a safe, non-destructible environment.'
- : 'Database Branching is currently in early access and not available publicly yet.'}
+ Create preview branches to experiment changes to your database schema in a safe,
+ non-destructible environment.
</p>
<div className="flex items-center space-x-2 !mt-4">
- {hasAccessToBranching && (
- <ButtonTooltip
- disabled={!canEnableBranching}
- icon={<GitBranch strokeWidth={1.5} />}
- onClick={() => snap.setShowEnableBranchingModal(true)}
- tooltip={{
- content: {
- side: 'bottom',
- text: 'You need additional permissions to enable branching',
- },
- }}
- >
- Enable branching
- </ButtonTooltip>
- )}
+ <ButtonTooltip
+ disabled={!canEnableBranching}
+ icon={<GitBranch strokeWidth={1.5} />}
+ onClick={() => snap.setShowEnableBranchingModal(true)}
+ tooltip={{
+ content: {
+ side: 'bottom',
+ text: 'You need additional permissions to enable branching',
+ },
+ }}
+ >
+ Enable branching
+ </ButtonTooltip>
+
<Button type="default" icon={<ExternalLink strokeWidth={1.5} />} asChild>
<a
target="_blank"
diff --git a/apps/studio/components/interfaces/Organization/IntegrationSettings/IntegrationSettings.tsx b/apps/studio/components/interfaces/Organization/IntegrationSettings/IntegrationSettings.tsx
index 0ca40f95c45..6a37b721024 100644
--- a/apps/studio/components/interfaces/Organization/IntegrationSettings/IntegrationSettings.tsx
+++ b/apps/studio/components/interfaces/Organization/IntegrationSettings/IntegrationSettings.tsx
@@ -19,7 +19,6 @@ import { useGitHubConnectionsQuery } from 'data/integrations/github-connections-
import type { IntegrationProjectConnection } from 'data/integrations/integrations.types'
import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
-import { useFlag } from 'hooks/ui/useFlag'
import { BASE_PATH } from 'lib/constants'
import {
GITHUB_INTEGRATION_INSTALLATION_URL,
@@ -42,7 +41,6 @@ const IntegrationImageHandler = ({ title }: { title: 'vercel' | 'github' }) => {
const IntegrationSettings = () => {
const org = useSelectedOrganization()
- const hasAccessToBranching = useFlag<boolean>('branchManagement')
const canReadGithubConnection = useCheckPermissions(
PermissionAction.READ,
@@ -149,29 +147,16 @@ The GitHub app will watch for changes in your repository such as file changes, b
/>
))}
</ul>
- {hasAccessToBranching ? (
- <EmptyIntegrationConnection
- onClick={onAddGitHubConnection}
- orgSlug={org?.slug}
- showNode={false}
- disabled={!canCreateGitHubConnection}
- >
- Add new project connection
- </EmptyIntegrationConnection>
- ) : (
- <p className="text-sm text-foreground-light">
- Access to{' '}
- <a
- href="https://supabase.com/docs/guides/platform/branching"
- target="_blank"
- rel="noreferrer"
- className="text-foreground"
- >
- branching
- </a>{' '}
- is required to add GitHub connections.
- </p>
- )}
+
+ <EmptyIntegrationConnection
+ onClick={onAddGitHubConnection}
+ orgSlug={org?.slug}
+ showNode={false}
+ disabled={!canCreateGitHubConnection}
+ >
+ Add new project connection
+ </EmptyIntegrationConnection>
+
{GitHubContentSectionBottom && (
<Markdown
extLinks
diff --git a/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GithubSection.tsx b/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GithubSection.tsx
index 55cf42d8c07..43f1c74139a 100644
--- a/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GithubSection.tsx
+++ b/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GithubSection.tsx
@@ -22,7 +22,6 @@ import type {
import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProject } from 'hooks/misc/useSelectedProject'
-import { useFlag } from 'hooks/ui/useFlag'
import { useSidePanelsStateSnapshot } from 'state/side-panels'
import { IntegrationImageHandler } from '../IntegrationsSettings'
import GitHubIntegrationConnectionForm from './GitHubIntegrationConnectionForm'
@@ -68,8 +67,6 @@ const GitHubSection = () => {
},
})
- const hasAccessToBranching = useFlag<boolean>('branchManagement')
-
const isBranch = project?.parent_project_ref !== undefined
const connections =
@@ -168,7 +165,7 @@ const GitHubSection = () => {
</div>
))}
</ul>
- ) : hasAccessToBranching ? (
+ ) : (
<EmptyIntegrationConnection
onClick={onAddGitHubConnection}
orgSlug={org?.slug}
@@ -177,19 +174,6 @@ const GitHubSection = () => {
>
Add new project connection
</EmptyIntegrationConnection>
- ) : (
- <p className="text-sm text-foreground-light">
- Access to{' '}
- <a
- href="https://supabase.com/docs/guides/platform/branching"
- target="_blank"
- rel="noreferrer"
- className="text-foreground"
- >
- branching
- </a>{' '}
- is required to add GitHub connections.
- </p>
)}
</>
)}
diff --git a/apps/studio/components/layouts/AppLayout/EnableBranchingButton/BranchingWaitListPopover.tsx b/apps/studio/components/layouts/AppLayout/EnableBranchingButton/BranchingWaitListPopover.tsx
deleted file mode 100644
index de32e026f93..00000000000
--- a/apps/studio/components/layouts/AppLayout/EnableBranchingButton/BranchingWaitListPopover.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import { GitBranch, ExternalLink } from 'lucide-react'
-import { useState } from 'react'
-
-import { Badge, Button, PopoverContent_Shadcn_, PopoverTrigger_Shadcn_, Popover_Shadcn_ } from 'ui'
-
-interface BranchingWaitListPopoverProps {
- isNewNav?: boolean
-}
-
-const BranchingWaitListPopover = ({ isNewNav = false }: BranchingWaitListPopoverProps) => {
- const [open, setOpen] = useState(false)
-
- return (
- <Popover_Shadcn_ open={open} onOpenChange={setOpen} modal={false}>
- <PopoverTrigger_Shadcn_ asChild>
- <Button type={isNewNav ? 'default' : 'text'} icon={<GitBranch strokeWidth={1.5} />}>
- Enable branching
- </Button>
- </PopoverTrigger_Shadcn_>
- <PopoverContent_Shadcn_ align="start" side="bottom" className="flex flex-col gap-4 w-80">
- <div>
- <Badge>Alpha Testing</Badge>
- </div>
- <div className="flex items-center gap-2">
- <GitBranch strokeWidth={2} />
- <p>Database Branching</p>
- </div>
- <p className="text-xs text-foreground-light">
- Database Branching is currently in early access and not available publicly yet.
- </p>
- <div className="flex items-center gap-2">
- <Button type="default" icon={<ExternalLink strokeWidth={1.5} />} asChild>
- <a
- target="_blank"
- rel="noreferrer"
- href="https://supabase.com/docs/guides/platform/branching"
- >
- View the docs
- </a>
- </Button>
- </div>
- </PopoverContent_Shadcn_>
- </Popover_Shadcn_>
- )
-}
-
-export default BranchingWaitListPopover
diff --git a/apps/studio/components/layouts/AppLayout/EnableBranchingButton/EnableBranchingButton.tsx b/apps/studio/components/layouts/AppLayout/EnableBranchingButton/EnableBranchingButton.tsx
index 7bb33d167e5..f4f54c96bd4 100644
--- a/apps/studio/components/layouts/AppLayout/EnableBranchingButton/EnableBranchingButton.tsx
+++ b/apps/studio/components/layouts/AppLayout/EnableBranchingButton/EnableBranchingButton.tsx
@@ -4,9 +4,7 @@ import { GitBranch } from 'lucide-react'
import { ButtonTooltip } from 'components/ui/ButtonTooltip'
import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedProject } from 'hooks/misc/useSelectedProject'
-import { useFlag } from 'hooks/ui/useFlag'
import { useAppStateSnapshot } from 'state/app-state'
-import BranchingWaitListPopover from './BranchingWaitListPopover'
interface EnableBranchingButtonProps {
isNewNav?: boolean
@@ -16,16 +14,11 @@ const EnableBranchingButton = ({ isNewNav = false }: EnableBranchingButtonProps)
const snap = useAppStateSnapshot()
const project = useSelectedProject()
- const hasAccessToBranching = useFlag<boolean>('branchManagement')
const canEnableBranching = useCheckPermissions(PermissionAction.CREATE, 'preview_branches', {
resource: { is_default: true },
})
const isDisabled = !canEnableBranching || project?.status !== 'ACTIVE_HEALTHY'
- if (!hasAccessToBranching) {
- return <BranchingWaitListPopover isNewNav={isNewNav} />
- }
-
return (
<ButtonTooltip
disabled={isDisabled}