Skip to content

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

Use bb.issue. instead of bb. as the issue type prefix

天舟6b990bffa7a5
diff --git a/backend/api/issue.go b/backend/api/issue.go
index 01d2ff23b9..2b8f5ac26d 100644
--- a/backend/api/issue.go
+++ b/backend/api/issue.go
@@ -27,25 +27,25 @@ func (e IssueStatus) String() string {
type IssueType string
const (
- IssueGeneral IssueType = "bb.general"
- IssueDatabaseCreate IssueType = "bb.database.create"
- IssueDatabaseGrant IssueType = "bb.database.grant"
- IssueDatabaseSchemaUpdate IssueType = "bb.database.schema.update"
- IssueDataSourceRequest IssueType = "bb.data-source.request"
+ IssueGeneral IssueType = "bb.issue.general"
+ IssueDatabaseCreate IssueType = "bb.issue.db.create"
+ IssueDatabaseGrant IssueType = "bb.issue.db.grant"
+ IssueDatabaseSchemaUpdate IssueType = "bb.issue.db.schema.update"
+ IssueDataSourceRequest IssueType = "bb.issue.data-source.request"
)
func (e IssueType) String() string {
switch e {
case IssueGeneral:
- return "bb.general"
+ return "bb.issue.general"
case IssueDatabaseCreate:
- return "bb.database.create"
+ return "bb.issue.db.create"
case IssueDatabaseGrant:
- return "bb.database.grant"
+ return "bb.issue.db.grant"
case IssueDatabaseSchemaUpdate:
- return "bb.database.schema.update"
+ return "bb.issue.db.schema.update"
case IssueDataSourceRequest:
- return "bb.data-source.request"
+ return "bb.issue.data-source.request"
}
return "bb.unknown"
}
diff --git a/backend/store/migration/0001_init_schema.up.sql b/backend/store/migration/0001_init_schema.up.sql
index 284873844a..44eb286bfd 100644
--- a/backend/store/migration/0001_init_schema.up.sql
+++ b/backend/store/migration/0001_init_schema.up.sql
@@ -515,7 +515,7 @@ CREATE TABLE issue (
pipeline_id INTEGER NOT NULL REFERENCES pipeline (id),
name TEXT NOT NULL,
`status` TEXT NOT NULL CHECK (`status` IN ('OPEN', 'DONE', 'CANCELED')),
- `type` TEXT NOT NULL CHECK (`type` LIKE 'bb.%'),
+ `type` TEXT NOT NULL CHECK (`type` LIKE 'bb.issue.%'),
description TEXT NOT NULL,
assignee_id INTEGER REFERENCES principal (id),
subscriber_id_list TEXT NOT NULL,
diff --git a/backend/store/seed/0120_issue.sql b/backend/store/seed/0120_issue.sql
index 031a67aeb5..94704248fd 100644
--- a/backend/store/seed/0120_issue.sql
+++ b/backend/store/seed/0120_issue.sql
@@ -26,7 +26,7 @@ VALUES
9001,
'Hello world!',
'OPEN',
- 'bb.general',
+ 'bb.issue.general',
'Welcome to Bytebase, this is the issue interface where tech leads, developers and DBAs collaborate on database management issues such as: ' || char(10, 10) || ' - Requesting a new database' || char(10) || ' - Creating a table' || char(10) || ' - Creating an index' || char(10) || ' - Adding a column' || char(10) || ' - Troubleshooting performance issue' || char(10, 10) || 'Let''s bookmark this issue by clicking the star icon on the top of this page.',
1001,
'1001,1002,1003,1004',
@@ -62,7 +62,7 @@ VALUES
9002,
'Add column ''location'' to table ''warehouse''',
'OPEN',
- 'bb.database.schema.update',
+ 'bb.issue.db.schema.update',
'Add the location column to record the warehouse address.',
1001,
'1001,1002,1003,1004',
diff --git a/frontend/src/components/AlterSchemaPrepForm.vue b/frontend/src/components/AlterSchemaPrepForm.vue
index 61188c04a7..51eec02db7 100644
--- a/frontend/src/components/AlterSchemaPrepForm.vue
+++ b/frontend/src/components/AlterSchemaPrepForm.vue
@@ -215,7 +215,7 @@ export default {
issueSlug: "new",
},
query: {
- template: "bb.database.schema.update",
+ template: "bb.issue.db.schema.update",
name: `[${database.name}] Alter schema`,
project: state.project.id,
databaseList: database.id,
diff --git a/frontend/src/components/IssueStatusTransitionButtonGroup.vue b/frontend/src/components/IssueStatusTransitionButtonGroup.vue
index cc875c01d4..464d9333a1 100644
--- a/frontend/src/components/IssueStatusTransitionButtonGroup.vue
+++ b/frontend/src/components/IssueStatusTransitionButtonGroup.vue
@@ -396,7 +396,7 @@ export default {
.then(() => {
if (
transition.to == "DONE" &&
- props.issueTemplate.type == "bb.database.schema.update"
+ props.issueTemplate.type == "bb.issue.db.schema.update"
) {
store.dispatch("uistate/saveIntroStateByKey", {
key: "table.create",
diff --git a/frontend/src/components/RequestDatabasePrepForm.vue b/frontend/src/components/RequestDatabasePrepForm.vue
index cb5d300ffa..2946b9a2f8 100644
--- a/frontend/src/components/RequestDatabasePrepForm.vue
+++ b/frontend/src/components/RequestDatabasePrepForm.vue
@@ -222,7 +222,7 @@ export default {
issueSlug: "new",
},
query: {
- template: "bb.database.create",
+ template: "bb.issue.db.create",
name: `[${environment.name}] Request new database '${state.databaseName}'`,
environment: state.environmentId,
project: state.projectId,
@@ -239,7 +239,7 @@ export default {
issueSlug: "new",
},
query: {
- template: "bb.database.grant",
+ template: "bb.issue.db.grant",
name: `[${environment.name}] Request database '${database.name}' ${
state.readOnly ? "Read Only access" : "Read & Write access"
}`,
diff --git a/frontend/src/miragejs/factories/issue.js b/frontend/src/miragejs/factories/issue.js
index 810092e1dc..6a8d5fb19f 100644
--- a/frontend/src/miragejs/factories/issue.js
+++ b/frontend/src/miragejs/factories/issue.js
@@ -23,7 +23,7 @@ export default {
return "OPEN";
},
type() {
- return "bb.database.create";
+ return "bb.issue.db.create";
},
description() {
return faker.fake("{{lorem.paragraphs}}");
diff --git a/frontend/src/miragejs/seeds/index.ts b/frontend/src/miragejs/seeds/index.ts
index a9d85373d6..beb5f6aca2 100644
--- a/frontend/src/miragejs/seeds/index.ts
+++ b/frontend/src/miragejs/seeds/index.ts
@@ -200,7 +200,7 @@ const workspacesSeeder = (server: any) => {
});
let issue = server.create("issue", {
- type: "bb.general",
+ type: "bb.issue.general",
name: "Hello, World! Demo",
description:
"Welcome to Bytebase, this is the issue interface where leads, developers and DBAs collaborate on database management issues such as: \n\n - Requesting a new database\n - Creating a table\n - Creating an index\n - Adding a column\n - Troubleshooting performance issue\n\nLet's bookmark this issue by clicking the star icon on the top of this page.",
@@ -403,7 +403,7 @@ const workspacesSeeder = (server: any) => {
});
issue = server.create("issue", {
- type: "bb.database.create",
+ type: "bb.issue.db.create",
name: title,
creatorId: ws1Dev1.id,
updaterId: ws1Dev1.id,
@@ -463,7 +463,7 @@ const workspacesSeeder = (server: any) => {
});
issue = server.create("issue", {
- type: "bb.database.grant",
+ type: "bb.issue.db.grant",
name: title,
creatorId: ws1Dev1.id,
updaterId: ws1Dev1.id,
@@ -597,7 +597,7 @@ const workspacesSeeder = (server: any) => {
issue = server.create("issue", {
name: data.title,
- type: "bb.database.schema.update",
+ type: "bb.issue.db.schema.update",
creatorId: ws1Dev1.id,
updaterId: ws1Dev1.id,
assigneeId: ws1Owner.id,
@@ -655,7 +655,7 @@ const workspacesSeeder = (server: any) => {
issue = server.create("issue", {
name: data.title,
- type: "bb.database.schema.update",
+ type: "bb.issue.db.schema.update",
creatorId: ws1Owner.id,
updaterId: ws1Owner.id,
assigneeId: ws1DBA.id,
@@ -713,7 +713,7 @@ const workspacesSeeder = (server: any) => {
issue = server.create("issue", {
name: data.title,
- type: "bb.database.schema.update",
+ type: "bb.issue.db.schema.update",
creatorId: ws1Dev2.id,
updaterId: ws1Dev2.id,
assigneeId: ws1DBA.id,
@@ -770,7 +770,7 @@ const workspacesSeeder = (server: any) => {
issue = server.create("issue", {
name: data.title,
- type: "bb.database.schema.update",
+ type: "bb.issue.db.schema.update",
creatorId: ws2Dev.id,
updaterId: ws2Dev.id,
assigneeId: ws2DBA.id,
diff --git a/frontend/src/plugins/issue/DatabaseCreateTemplate.ts b/frontend/src/plugins/issue/DatabaseCreateTemplate.ts
index 866ecc0d26..989ad6a304 100644
--- a/frontend/src/plugins/issue/DatabaseCreateTemplate.ts
+++ b/frontend/src/plugins/issue/DatabaseCreateTemplate.ts
@@ -20,7 +20,7 @@ const INPUT_DATABASE_NAME = INPUT_CUSTOM_FIELD_ID_BEGIN;
const OUTPUT_DATABASE_FIELD_ID = OUTPUT_CUSTOM_FIELD_ID_BEGIN;
const template: IssueTemplate = {
- type: "bb.database.create",
+ type: "bb.issue.db.create",
buildIssue: (
ctx: TemplateContext
): Omit<IssueCreate, "projectId" | "creatorId"> => {
@@ -28,7 +28,7 @@ const template: IssueTemplate = {
return {
name: "Request new db",
- type: "bb.database.create",
+ type: "bb.issue.db.create",
description: "",
pipeline: {
stageList: [
diff --git a/frontend/src/plugins/issue/DatabaseGrantTemplate.ts b/frontend/src/plugins/issue/DatabaseGrantTemplate.ts
index 59de5de9be..97729a0c4d 100644
--- a/frontend/src/plugins/issue/DatabaseGrantTemplate.ts
+++ b/frontend/src/plugins/issue/DatabaseGrantTemplate.ts
@@ -14,7 +14,7 @@ const INPUT_READ_ONLY_FIELD_ID = INPUT_CUSTOM_FIELD_ID_BEGIN;
const OUTPUT_DATABASE_FIELD_ID = OUTPUT_CUSTOM_FIELD_ID_BEGIN;
const template: IssueTemplate = {
- type: "bb.database.grant",
+ type: "bb.issue.db.grant",
buildIssue: (
ctx: TemplateContext
): Omit<IssueCreate, "projectId" | "creatorId"> => {
@@ -22,7 +22,7 @@ const template: IssueTemplate = {
return {
name: "Request database access",
- type: "bb.database.grant",
+ type: "bb.issue.db.grant",
description: "",
pipeline: {
stageList: [
diff --git a/frontend/src/plugins/issue/DatabaseSchemaUpdateTemplate.ts b/frontend/src/plugins/issue/DatabaseSchemaUpdateTemplate.ts
index bb073032dc..511f07cff7 100644
--- a/frontend/src/plugins/issue/DatabaseSchemaUpdateTemplate.ts
+++ b/frontend/src/plugins/issue/DatabaseSchemaUpdateTemplate.ts
@@ -16,7 +16,7 @@ import {
} from "../../types";
const template: IssueTemplate = {
- type: "bb.database.schema.update",
+ type: "bb.issue.db.schema.update",
buildIssue: (
ctx: TemplateContext
): Omit<IssueCreate, "projectId" | "creatorId"> => {
@@ -39,7 +39,7 @@ const template: IssueTemplate = {
}
return {
name: "Update database schema",
- type: "bb.database.schema.update",
+ type: "bb.issue.db.schema.update",
description: "",
pipeline: {
stageList,
diff --git a/frontend/src/plugins/issue/DefaultTemplate.ts b/frontend/src/plugins/issue/DefaultTemplate.ts
index b19002e764..75f429e2cc 100644
--- a/frontend/src/plugins/issue/DefaultTemplate.ts
+++ b/frontend/src/plugins/issue/DefaultTemplate.ts
@@ -2,13 +2,13 @@ import { IssueCreate, UNKNOWN_ID } from "../../types";
import { IssueTemplate, TemplateContext } from "../types";
const template: IssueTemplate = {
- type: "bb.general",
+ type: "bb.issue.general",
buildIssue: (
ctx: TemplateContext
): Omit<IssueCreate, "projectId" | "creatorId"> => {
return {
name: "",
- type: "bb.general",
+ type: "bb.issue.general",
description: "",
pipeline: {
stageList: [
diff --git a/frontend/src/types/common.ts b/frontend/src/types/common.ts
index ad3c108315..6d62dcb9ac 100644
--- a/frontend/src/types/common.ts
+++ b/frontend/src/types/common.ts
@@ -223,7 +223,7 @@ export const unknown = (
updatedTs: 0,
name: "<<Unknown issue>>",
status: "DONE",
- type: "bb.general",
+ type: "bb.issue.general",
description: "",
subscriberList: [],
payload: {},
@@ -461,7 +461,7 @@ export const empty = (
updatedTs: 0,
name: "",
status: "DONE",
- type: "bb.general",
+ type: "bb.issue.general",
description: "",
subscriberList: [],
payload: {},
diff --git a/frontend/src/types/issue.ts b/frontend/src/types/issue.ts
index d05dfbac7e..306ae9516a 100644
--- a/frontend/src/types/issue.ts
+++ b/frontend/src/types/issue.ts
@@ -3,14 +3,14 @@ import { Pipeline, PipelineCreate } from "./pipeline";
import { Principal } from "./principal";
import { Project } from "./project";
-type IssueTypeGeneral = "bb.general";
+type IssueTypeGeneral = "bb.issue.general";
type IssueTypeDatabase =
- | "bb.database.create"
- | "bb.database.grant"
- | "bb.database.schema.update";
+ | "bb.issue.db.create"
+ | "bb.issue.db.grant"
+ | "bb.issue.db.schema.update";
-type IssueTypeDataSource = "bb.data-source.request";
+type IssueTypeDataSource = "bb.issue.data-source.request";
export type IssueType =
| IssueTypeGeneral
diff --git a/frontend/src/views/DatabaseCreate.vue b/frontend/src/views/DatabaseCreate.vue
index 998d279af8..718c7ee288 100644
--- a/frontend/src/views/DatabaseCreate.vue
+++ b/frontend/src/views/DatabaseCreate.vue
@@ -248,21 +248,21 @@ export default {
// If it's from database request issue, we disallow changing the preset field.
// This is to prevent accidentally changing the requested field.
const allowEditProject = computed(() => {
- return state.fromIssueType != "bb.database.create" || !state.projectId;
+ return state.fromIssueType != "bb.issue.db.create" || !state.projectId;
});
const allowEditEnvironment = computed(() => {
return (
- state.fromIssueType != "bb.database.create" || !state.environmentId
+ state.fromIssueType != "bb.issue.db.create" || !state.environmentId
);
});
const allowEditDatabaseName = computed(() => {
- return state.fromIssueType != "bb.database.create" || !state.databaseName;
+ return state.fromIssueType != "bb.issue.db.create" || !state.databaseName;
});
const allowEditIssue = computed(() => {
- return state.fromIssueType != "bb.database.create" || !state.issueId;
+ return state.fromIssueType != "bb.issue.db.create" || !state.issueId;
});
const instanceLink = computed((): string => {
diff --git a/frontend/src/views/IssueDetail.vue b/frontend/src/views/IssueDetail.vue
index 1fae2eed69..812544bf65 100644
--- a/frontend/src/views/IssueDetail.vue
+++ b/frontend/src/views/IssueDetail.vue
@@ -592,13 +592,13 @@ export default {
const showIssueSqlPanel = computed(() => {
return (
- issue.value.type == "bb.general" ||
- issue.value.type == "bb.database.schema.update"
+ issue.value.type == "bb.issue.general" ||
+ issue.value.type == "bb.issue.db.schema.update"
);
});
const showIssueRollbackSqlPanel = computed(() => {
- return issue.value.type == "bb.database.schema.update";
+ return issue.value.type == "bb.issue.db.schema.update";
});
return {
diff --git a/frontend/src/views/IssueOutputPanel.vue b/frontend/src/views/IssueOutputPanel.vue
index 0f3cbe2c41..998543b8ec 100644
--- a/frontend/src/views/IssueOutputPanel.vue
+++ b/frontend/src/views/IssueOutputPanel.vue
@@ -222,8 +222,8 @@ export default {
return false;
}
return (
- props.issue.type == "bb.database.create" ||
- props.issue.type == "bb.database.grant"
+ props.issue.type == "bb.issue.db.create" ||
+ props.issue.type == "bb.issue.db.grant"
);
});