Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: remove more feature guard (#16430)

Danny Xu18ce06348f85
diff --git a/backend/base/plan.go b/backend/base/plan.go
index e530b89f93..41c1e311da 100644
--- a/backend/base/plan.go
+++ b/backend/base/plan.go
@@ -105,16 +105,6 @@ const (
// - Developers can't create database.
// - Developers can't query and export data directly. They must request corresponding permissions first.
FeatureDBAWorkflow FeatureType = "bb.feature.dba-workflow"
- // FeatureMultiTenancy allows user to enable batch mode for the project.
- //
- // Batch mode allows user to track a group of homogeneous database changes together.
- // e.g. A game studio may deploy many servers, each server is fully isolated with its
- // own database. When a new game version is released, it may require to upgrade the
- // underlying database schema, then batch mode will help the studio to track the
- // schema change across all databases.
- FeatureMultiTenancy FeatureType = "bb.feature.multi-tenancy"
- // FeatureOnlineMigration allows user to perform online-migration.
- FeatureOnlineMigration FeatureType = "bb.feature.online-migration"
// FeatureSchemaDrift detects if there occurs schema drift.
// See https://bytebase.com/docs/features/drift-detection
FeatureSchemaDrift FeatureType = "bb.feature.schema-drift"
@@ -123,7 +113,6 @@ const (
// e.g. One can configure rules for database schema or SQL query.
FeatureSQLReview FeatureType = "bb.feature.sql-review"
// FeatureTaskScheduleTime allows user to run task at a scheduled time.
- FeatureTaskScheduleTime FeatureType = "bb.feature.task-schedule-time"
// FeatureEncryptedSecrets is a feature that allows user to setting the encrypted secrets for the database.
FeatureEncryptedSecrets FeatureType = "bb.feature.encrypted-secrets"
// FeatureDatabaseGrouping allows user to create database/schema groups.
@@ -222,16 +211,10 @@ func (e FeatureType) Name() string {
// Change Workflow
case FeatureDBAWorkflow:
return "DBA workflow"
- case FeatureMultiTenancy:
- return "Multi-tenancy"
- case FeatureOnlineMigration:
- return "Online schema migration"
case FeatureSchemaDrift:
return "Schema drift"
case FeatureSQLReview:
return "SQL review"
- case FeatureTaskScheduleTime:
- return "Task schedule time"
case FeatureEncryptedSecrets:
return "Encrypted secrets"
case FeatureDatabaseGrouping:
@@ -311,11 +294,8 @@ var FeatureMatrix = map[FeatureType][3]bool{
FeatureBranding: {false, false, true},
// Change Workflow
FeatureDBAWorkflow: {false, false, true},
- FeatureMultiTenancy: {false, false, true},
- FeatureOnlineMigration: {false, true, true},
FeatureSchemaDrift: {false, false, true},
FeatureSQLReview: {true, true, true},
- FeatureTaskScheduleTime: {false, true, true},
FeatureEncryptedSecrets: {false, true, true},
FeatureDatabaseGrouping: {false, true, true},
FeatureSchemaTemplate: {false, false, true},
@@ -345,16 +325,12 @@ var InstanceLimitFeature = map[FeatureType]bool{
// Change Workflow
FeatureSchemaDrift: true,
FeatureEncryptedSecrets: true,
- FeatureTaskScheduleTime: true,
- FeatureOnlineMigration: true,
// Database management
FeatureReadReplicaConnection: true,
FeatureCustomInstanceSynchronization: true,
- FeatureDatabaseGrouping: true,
FeatureSyncSchemaAllVersions: true,
// Policy Control
FeatureSensitiveData: true,
- FeatureRolloutPolicy: true,
}
// Feature returns whether a particular feature is available in a particular plan.
diff --git a/backend/enterprise/api/limit.go b/backend/enterprise/api/limit.go
index 8859e51aa9..b8366e8f7f 100644
--- a/backend/enterprise/api/limit.go
+++ b/backend/enterprise/api/limit.go
@@ -15,30 +15,22 @@ var planConfigStr string
type PlanLimit int
const (
- // PlanLimitMaximumTask is the key name for maximum number of tasks for a plan.
- PlanLimitMaximumTask PlanLimit = iota
- // PlanLimitMaximumEnvironment is the key name for maximum number of environments for a plan.
- PlanLimitMaximumEnvironment
// PlanLimitMaximumInstance is the key name for maximum number of instance for a plan.
- PlanLimitMaximumInstance
+ PlanLimitMaximumInstance = iota
// PlanLimitMaximumUser is the key name for maximum number of user for a plan.
PlanLimitMaximumUser
)
// PlanLimitValues is the plan limit value mapping.
var PlanLimitValues = map[PlanLimit]map[base.PlanType]int{
- PlanLimitMaximumTask: {},
- PlanLimitMaximumEnvironment: {},
- PlanLimitMaximumInstance: {},
- PlanLimitMaximumUser: {},
+ PlanLimitMaximumInstance: {},
+ PlanLimitMaximumUser: {},
}
type planLimitConfig struct {
- Type base.PlanType `yaml:"type"`
- MaximumInstanceCount int `yaml:"maximumInstanceCount"`
- MaximumSeatCount int `yaml:"maximumSeatCount"`
- MaximumTaskCount int `yaml:"maximumTaskCount"`
- MaximumEnvironmentCount int `yaml:"maximumEnvironmentCount"`
+ Type base.PlanType `yaml:"type"`
+ MaximumInstanceCount int `yaml:"maximumInstanceCount"`
+ MaximumSeatCount int `yaml:"maximumSeatCount"`
}
type planConfg struct {
@@ -50,8 +42,6 @@ func init() {
_ = yaml.Unmarshal([]byte(planConfigStr), conf)
for _, limitConfig := range conf.PlanList {
- PlanLimitValues[PlanLimitMaximumTask][limitConfig.Type] = limitConfig.MaximumTaskCount
- PlanLimitValues[PlanLimitMaximumEnvironment][limitConfig.Type] = limitConfig.MaximumEnvironmentCount
PlanLimitValues[PlanLimitMaximumInstance][limitConfig.Type] = limitConfig.MaximumInstanceCount
PlanLimitValues[PlanLimitMaximumUser][limitConfig.Type] = limitConfig.MaximumSeatCount
}
diff --git a/backend/enterprise/api/plan.yaml b/backend/enterprise/api/plan.yaml
index 70bac9e46f..65da22863e 100644
--- a/backend/enterprise/api/plan.yaml
+++ b/backend/enterprise/api/plan.yaml
@@ -66,8 +66,6 @@ planList:
freeInstanceCount: 10
maximumInstanceCount: 10
maximumSeatCount: 20
- maximumTaskCount: -1
- maximumEnvironmentCount: -1
pricePerSeatPerMonth: 0
pricePerInstancePerMonth: 0
featureList:
@@ -134,8 +132,6 @@ planList:
freeInstanceCount: 10
maximumInstanceCount: 10
maximumSeatCount: 20
- maximumTaskCount: -1
- maximumEnvironmentCount: -1
pricePerSeatPerMonth: 20
pricePerInstancePerMonth: 0
featureList:
@@ -207,8 +203,6 @@ planList:
freeInstanceCount: 0
maximumInstanceCount: -1
maximumSeatCount: -1
- maximumTaskCount: -1
- maximumEnvironmentCount: -1
pricePerSeatPerMonth: 0
pricePerInstancePerMonth: 300
featureList:
diff --git a/frontend/src/components/CreateDatabasePrepForm/CreateDatabasePrepForm.vue b/frontend/src/components/CreateDatabasePrepForm/CreateDatabasePrepForm.vue
index b34e72af3d..a88650e528 100644
--- a/frontend/src/components/CreateDatabasePrepForm/CreateDatabasePrepForm.vue
+++ b/frontend/src/components/CreateDatabasePrepForm/CreateDatabasePrepForm.vue
@@ -142,11 +142,6 @@
</template>
</div>
- <FeatureModal
- feature="bb.feature.multi-tenancy"
- :open="state.showFeatureModal"
- @cancel="state.showFeatureModal = false"
- />
<div
v-if="state.creating"
class="absolute inset-0 z-10 bg-white/70 flex items-center justify-center"
@@ -156,18 +151,12 @@
</template>
<script lang="ts" setup>
-import { isEmpty } from "lodash-es";
-import { NInput } from "naive-ui";
-import { v4 as uuidv4 } from "uuid";
-import { computed, reactive } from "vue";
-import { useI18n } from "vue-i18n";
-import { useRouter } from "vue-router";
import { BBSpin } from "@/bbkit";
import InstanceRoleSelect from "@/components/InstanceRoleSelect.vue";
import {
- ProjectSelect,
EnvironmentSelect,
InstanceSelect,
+ ProjectSelect,
} from "@/components/v2";
import {
experimentalCreateIssueByPlan,
@@ -189,10 +178,15 @@ import { Issue, Issue_Type } from "@/types/proto/v1/issue_service";
import type { Plan_CreateDatabaseConfig } from "@/types/proto/v1/plan_service";
import { Plan, Plan_Spec } from "@/types/proto/v1/plan_service";
import {
- instanceV1HasCollationAndCharacterSet,
enginesSupportCreateDatabase,
+ instanceV1HasCollationAndCharacterSet,
} from "@/utils";
-import { FeatureModal } from "../FeatureGuard";
+import { isEmpty } from "lodash-es";
+import { NInput } from "naive-ui";
+import { v4 as uuidv4 } from "uuid";
+import { computed, reactive } from "vue";
+import { useI18n } from "vue-i18n";
+import { useRouter } from "vue-router";
const INTERNAL_RDS_INSTANCE_USER_LIST = ["rds_ad", "rdsadmin", "rds_iam"];
@@ -206,7 +200,6 @@ interface LocalState {
characterSet: string;
collation: string;
cluster: string;
- showFeatureModal: boolean;
creating: boolean;
}
@@ -233,7 +226,6 @@ const state = reactive<LocalState>({
characterSet: "",
collation: "",
cluster: "",
- showFeatureModal: false,
creating: false,
});
const { project } = useProjectByName(
diff --git a/frontend/src/components/Plan/components/Sidebar/GhostSection/GhostSection.vue b/frontend/src/components/Plan/components/Sidebar/GhostSection/GhostSection.vue
index b3fb8f19ed..d068a70d00 100644
--- a/frontend/src/components/Plan/components/Sidebar/GhostSection/GhostSection.vue
+++ b/frontend/src/components/Plan/components/Sidebar/GhostSection/GhostSection.vue
@@ -25,10 +25,6 @@
</i18n-t>
</template>
</NTooltip>
- <FeatureBadge
- feature="bb.feature.online-migration"
- :instance="instance"
- />
</div>
<GhostSwitch />
</div>
@@ -56,21 +52,16 @@
</template>
<script lang="ts" setup>
+import LearnMoreLink from "@/components/LearnMoreLink.vue";
import { WrenchIcon } from "lucide-vue-next";
import { NButton, NTooltip } from "naive-ui";
-import { computed, ref } from "vue";
-import { FeatureBadge } from "@/components/FeatureGuard";
-import LearnMoreLink from "@/components/LearnMoreLink.vue";
+import { ref } from "vue";
import GhostFlagsPanel from "./GhostFlagsPanel.vue";
import GhostSwitch from "./GhostSwitch.vue";
import { useGhostSettingContext } from "./context";
const showFlagsPanel = ref(false);
-const { allowChange, enabled, databases } = useGhostSettingContext();
+const { allowChange, enabled } = useGhostSettingContext();
-const instance = computed(() => {
- return databases.value.find((db) => !db.instanceResource.activation)
- ?.instanceResource;
-});
</script>
diff --git a/frontend/src/types/plan.ts b/frontend/src/types/plan.ts
index 9a694bf1a2..68e1566987 100644
--- a/frontend/src/types/plan.ts
+++ b/frontend/src/types/plan.ts
@@ -27,11 +27,8 @@ export type FeatureType =
| "bb.feature.branding"
// Change Workflow
| "bb.feature.dba-workflow"
- | "bb.feature.multi-tenancy"
- | "bb.feature.online-migration"
| "bb.feature.schema-drift"
| "bb.feature.sql-review"
- | "bb.feature.task-schedule-time"
| "bb.feature.encrypted-secrets"
| "bb.feature.database-grouping"
| "bb.feature.schema-template"
@@ -61,8 +58,6 @@ export const instanceLimitFeature = new Set<FeatureType>([
// Change Workflow
"bb.feature.schema-drift",
"bb.feature.encrypted-secrets",
- "bb.feature.task-schedule-time",
- "bb.feature.online-migration",
// Database Management
"bb.feature.read-replica-connection",
"bb.feature.custom-instance-synchronization",
diff --git a/frontend/src/views/project/ProjectIssueDetail.vue b/frontend/src/views/project/ProjectIssueDetail.vue
index aef1d78397..9960eed5f6 100644
--- a/frontend/src/views/project/ProjectIssueDetail.vue
+++ b/frontend/src/views/project/ProjectIssueDetail.vue
@@ -9,20 +9,9 @@
<NSpin />
</div>
</div>
- <FeatureModal
- :open="state.showFeatureModal"
- feature="bb.feature.multi-tenancy"
- @cancel="state.showFeatureModal = false"
- />
</template>
<script lang="ts" setup>
-import { useTitle } from "@vueuse/core";
-import Emittery from "emittery";
-import { NSpin } from "naive-ui";
-import { computed, onMounted, reactive, toRef } from "vue";
-import { useI18n } from "vue-i18n";
-import { FeatureModal } from "@/components/FeatureGuard";
import {
DataExportIssueDetailPage,
GrantRequestIssueDetailPage,
@@ -38,14 +27,15 @@ import {
import { useBodyLayoutContext } from "@/layouts/common";
import { projectNamePrefix, useProjectByName, useUIStateStore } from "@/store";
import {
- isGrantRequestIssue,
isDatabaseDataExportIssue,
+ isGrantRequestIssue,
isValidIssueName,
} from "@/utils";
-
-interface LocalState {
- showFeatureModal: boolean;
-}
+import { useTitle } from "@vueuse/core";
+import Emittery from "emittery";
+import { NSpin } from "naive-ui";
+import { computed, onMounted, toRef } from "vue";
+import { useI18n } from "vue-i18n";
defineOptions({
inheritAttrs: false,
@@ -58,9 +48,6 @@ const props = defineProps<{
const { t } = useI18n();
-const state = reactive<LocalState>({
- showFeatureModal: false,
-});
const { project, ready: projectReady } = useProjectByName(
computed(() => `${projectNamePrefix}${props.projectId}`)
);
diff --git a/frontend/src/views/project/ProjectPlanDetail.vue b/frontend/src/views/project/ProjectPlanDetail.vue
index 5d2bd2d788..f2bf18da3f 100644
--- a/frontend/src/views/project/ProjectPlanDetail.vue
+++ b/frontend/src/views/project/ProjectPlanDetail.vue
@@ -7,20 +7,9 @@
<NSpin />
</div>
</div>
- <FeatureModal
- :open="state.showFeatureModal"
- feature="bb.feature.multi-tenancy"
- @cancel="state.showFeatureModal = false"
- />
</template>
<script lang="ts" setup>
-import { useTitle } from "@vueuse/core";
-import Emittery from "emittery";
-import { NSpin } from "naive-ui";
-import { computed, reactive, toRef } from "vue";
-import { useI18n } from "vue-i18n";
-import { FeatureModal } from "@/components/FeatureGuard";
import {
providePlanContext,
useBasePlanContext,
@@ -33,10 +22,11 @@ import {
} from "@/components/PlanCheckRun/context";
import { useBodyLayoutContext } from "@/layouts/common";
import { isValidPlanName } from "@/utils";
-
-interface LocalState {
- showFeatureModal: boolean;
-}
+import { useTitle } from "@vueuse/core";
+import Emittery from "emittery";
+import { NSpin } from "naive-ui";
+import { computed, toRef } from "vue";
+import { useI18n } from "vue-i18n";
defineOptions({
inheritAttrs: false,
@@ -49,10 +39,6 @@ const props = defineProps<{
const { t } = useI18n();
-const state = reactive<LocalState>({
- showFeatureModal: false,
-});
-
const { isCreating, plan, isInitializing, reInitialize } = useInitializePlan(
toRef(props, "planSlug"),
toRef(props, "projectId")