Skip to content

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

chore(frontend): support ci/cd new database.general issue type in legacy issue API (#7633)

Liu Ji1e630fcc4c17
diff --git a/frontend/src/store/modules/issue.ts b/frontend/src/store/modules/issue.ts
index e13c81bd48..f7b5dfaf39 100644
--- a/frontend/src/store/modules/issue.ts
+++ b/frontend/src/store/modules/issue.ts
@@ -66,20 +66,23 @@ function convert(issue: ResourceObject, includedList: ResourceObject[]): Issue {
// Compose issue pipeline.
if (isDatabaseRelatedIssueType(result.type)) {
- const pipelineStore = usePipelineStore();
- const pipelineId = (
- issue.relationships!.pipeline.data as ResourceIdentifier
- ).id;
let pipeline = unknown("PIPELINE") as Pipeline;
- pipeline.id = parseInt(pipelineId);
-
- for (const item of includedList || []) {
- if (
- item.type == "pipeline" &&
- issue.relationships!.pipeline.data &&
- (issue.relationships!.pipeline.data as ResourceIdentifier).id == item.id
- ) {
- pipeline = pipelineStore.convert(item, includedList);
+ if (issue.relationships?.pipeline?.data) {
+ const pipelineStore = usePipelineStore();
+ const pipelineId = (
+ issue.relationships!.pipeline.data as ResourceIdentifier
+ ).id;
+ pipeline.id = parseInt(pipelineId);
+
+ for (const item of includedList || []) {
+ if (
+ item.type == "pipeline" &&
+ issue.relationships!.pipeline.data &&
+ (issue.relationships!.pipeline.data as ResourceIdentifier).id ==
+ item.id
+ ) {
+ pipeline = pipelineStore.convert(item, includedList);
+ }
}
}
result.pipeline = pipeline;
diff --git a/frontend/src/types/issue.ts b/frontend/src/types/issue.ts
index 39ba4bd9e2..e55bd9d214 100644
--- a/frontend/src/types/issue.ts
+++ b/frontend/src/types/issue.ts
@@ -21,6 +21,7 @@ type IssueTypeGeneral = "bb.issue.general";
type IssueTypeDataSource = "bb.issue.data-source.request";
type IssueTypeDatabase =
+ | "bb.issue.database.general" // For V1 API compatibility
| "bb.issue.database.create"
| "bb.issue.database.grant"
| "bb.issue.database.schema.update"
diff --git a/frontend/src/utils/issue/index.ts b/frontend/src/utils/issue/index.ts
index 73e3f458ba..1abffd118c 100644
--- a/frontend/src/utils/issue/index.ts
+++ b/frontend/src/utils/issue/index.ts
@@ -15,6 +15,7 @@ export function isGrantRequestIssueType(issueType: IssueType): boolean {
export function isDatabaseRelatedIssueType(issueType: IssueType): boolean {
return [
+ "bb.issue.database.general",
"bb.issue.database.create",
"bb.issue.database.grant",
"bb.issue.database.schema.update",