Skip to content

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

feat: support column marker (#7240)

Liu Ji2bff68236ee2
diff --git a/backend/legacyapi/task_check_run.go b/backend/legacyapi/task_check_run.go
index 7fb85ea32d..3dd5de95db 100644
--- a/backend/legacyapi/task_check_run.go
+++ b/backend/legacyapi/task_check_run.go
@@ -95,7 +95,7 @@ type TaskCheckResult struct {
Title string `json:"title,omitempty"`
Content string `json:"content,omitempty"`
Line int `json:"line,omitempty"`
- Column int `json:"column,omitempty"`
+ Column int `json:"column"`
Details string `json:"details,omitempty"`
}
diff --git a/frontend/src/components/Issue/TaskCheckRunPanel.vue b/frontend/src/components/Issue/TaskCheckRunPanel.vue
index 9852d0101b..64aae08c8d 100644
--- a/frontend/src/components/Issue/TaskCheckRunPanel.vue
+++ b/frontend/src/components/Issue/TaskCheckRunPanel.vue
@@ -173,6 +173,7 @@ const checkResultList = computed((): TaskCheckResult[] => {
content: props.taskCheckRun.result.detail,
namespace: "bb.core",
line: undefined,
+ column: undefined,
},
];
} else if (props.taskCheckRun.status == "CANCELED") {
@@ -184,6 +185,7 @@ const checkResultList = computed((): TaskCheckResult[] => {
content: "",
namespace: "bb.core",
line: undefined,
+ column: undefined,
},
];
}
diff --git a/frontend/src/components/Issue/logic/useSQLAdviceMarkers.ts b/frontend/src/components/Issue/logic/useSQLAdviceMarkers.ts
index 505f95ecb9..57452121e6 100644
--- a/frontend/src/components/Issue/logic/useSQLAdviceMarkers.ts
+++ b/frontend/src/components/Issue/logic/useSQLAdviceMarkers.ts
@@ -34,16 +34,16 @@ const getLatestAdviceOptions = (taskCheckRunList: TaskCheckRun[]) => {
.filter((result) => result.status === "ERROR" || result.status === "WARN")
.filter((result) => result.line !== undefined)
.map<AdviceOption>((result) => {
+ const line = result.line!;
+ const column = result.column ?? Number.MAX_SAFE_INTEGER;
return {
severity: result.status === "ERROR" ? "ERROR" : "WARNING",
message: result.content,
source: `${result.title} (${result.code})`,
- startLineNumber: result.line!,
- // We don't know the actual column yet, so we show the marker at then end of the line
- startColumn: Number.MAX_SAFE_INTEGER,
- endLineNumber: result.line!,
- // We don't know the actual column yet, so we show the marker at then end of the line
- endColumn: Number.MAX_SAFE_INTEGER,
+ startLineNumber: line,
+ endLineNumber: line,
+ startColumn: column,
+ endColumn: column,
};
});
};
diff --git a/frontend/src/types/pipeline/task.ts b/frontend/src/types/pipeline/task.ts
index cf5e215475..c200222ca3 100644
--- a/frontend/src/types/pipeline/task.ts
+++ b/frontend/src/types/pipeline/task.ts
@@ -282,6 +282,7 @@ export type TaskCheckResult = {
title: string;
content: string;
line: number | undefined;
+ column: number | undefined;
namespace: TaskCheckNamespace;
details?: string;
};