feat(sql_workbench): align ODC workbench audit gate and non-DQL workflow exec with CloudBeaver#645
Merged
Merged
Conversation
Add CE-built workflow_exec.go implementing workflow permission check, auto create/execute API call, response builder and operation log for the ODC SQL workbench non-DQL workflow path, mirroring the CloudBeaver workflow behavior so both workbenches share the same CE-level logic. Refs actiontech/dms-ee#889
Route compliant non-DQL SQL through workflow auto-exec when workflow_exec_enabled is on, and expose workflowInfo in streamExecute. Refs actiontech/dms-ee#889 (cherry picked from commit d6b3455bdf5575cc3b624dd4568a946996d9a4f0)
Reuse IsSuccess audit semantics, maintenance time checks, and isExecuteAnyway bypass before workflow/direct execution in the ODC streamExecute middleware, so the ODC workbench audit gate matches the CloudBeaver behavior. Refs actiontech/dms-ee#905
ODC exposes SQL Server nodes as database.schema (e.g. TestDB.dbo). SQLE direct audit uses schema_name as the connection database, so pass only the catalog part to avoid "Cannot open database TestDB.dbo". Fixes actiontech/dms-ee#911
PR Reviewer Guide 🔍
|
|
Failed to generate code suggestions for PR |
Seechi-Yolo
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
背景
ODC SQL 工作台此前缺少与 CloudBeaver 工作台一致的审核门与工单执行能力。本次将 CloudBeaver 已有的 CE 级审核/工单逻辑对齐到 ODC 工作台路径。
变更内容
workflow_exec.go,CE 构建):工单权限校验、自动建单并上线执行的 API 调用、响应构造与操作日志,行为对齐 CloudBeaver 的executeNonDQLByWorkflow,两个工作台共用同一套 CE 级逻辑。(actiontech/dms-ee#889)workflow_exec_enabled开启且为合规非 DQL 语句时,走工单自动上线;streamExecute响应新增workflowInfo/errorMessage。(actiontech/dms-ee#889)IsSuccess审核语义、运维时间管控与isExecuteAnyway(仍要执行)放行逻辑,置于工单/直接执行之前。(actiontech/dms-ee#905)database.schema(如TestDB.dbo)暴露 SQL Server 节点,SQLE 直连审核以schema_name作为连接库,仅取 catalog 部分,避免Cannot open database TestDB.dbo。(actiontech/dms-ee#911)说明
internal/dms/biz/cloudbeaver.go),保证社区版 ODC 工作台同样具备该能力。cloudbeaver.AllowQuery、SQLQueryConfig)在 CE 主线已存在。测试
go build ./...、go vet ./internal/sql_workbench/...、go test ./internal/sql_workbench/...均通过(golang:1.24.1 容器)。Refs actiontech/dms-ee#889
Refs actiontech/dms-ee#905
Fixes actiontech/dms-ee#911
Description
添加maintenanceTimeUsecase及维护时间检查功能
修改请求解析和审核中间件处理isExecuteAnyway参数
实现SQL Server schema归一化支持SQLE审核
新增workflow_exec.go实现非DQL工单自动执行
增加单元测试覆盖新功能逻辑
Diagram Walkthrough
File Walkthrough
sql_workbench_service.go
更新SQL工作台服务逻辑internal/sql_workbench/service/sql_workbench_service.go
workflow_exec.go
新增工单执行逻辑internal/sql_workbench/service/workflow_exec.go
sql_workbench_service_test.go
新增单元测试覆盖internal/sql_workbench/service/sql_workbench_service_test.go