feat(sql_workbench): support GaussDB / PostgreSQL whitelist + fix /odc_query proxy fallback#631
Merged
Conversation
6 tasks
…itelist
- SupportDBType: add DBTypeGaussDB + DBTypePostgreSQL to whitelist
(EARS-1.2 / decision-3 positive coverage for KF-2)
- convertDBType: add "GaussDB" -> "GAUSSDB" mapping immediately after
the existing "PostgreSQL" -> "POSTGRESQL" mapping (EARS-1.3 / CR-12
case-sensitivity normalization)
- unit tests:
- Test_convertDBType: new "GaussDB" case (13 total); existing
"PostgreSQL" / "Unknown passthrough" regressed unchanged
- Test_SupportDBType: flip "PostgreSQL" expected from false to true
(decision-3 lock); new "GaussDB supported" + "GaussDBForMySQL
unsupported" cases; existing SQL Server negative regression kept
- Test_SupportDBType_GaussDB_PG_family_consistency: hard assertion
PG family (PostgreSQL + GaussDB) whitelist coupling
Related: actiontech/dms-ee#865
The static middleware Skipper at internal/apiserver/service/router.go only skipped /cloudbeaver, /provision/v, /sqle/v and /swagger paths. Requests to /odc_query/ (with trailing slash), /odc_query/index.html and any /odc_query/<spa-path> were intercepted by the DMS HTML5 SPA fallback and got served as the DMS index.html (873B), instead of the real ODC umi index.html (~11KB). This broke the DMS UI 'SQL Workbench' entry whenever the link used the trailing-slash form (`/odc_query/?dsId=...`). Without the fix the browser landed on the DMS dashboard rather than the ODC SQL workbench, even though API and subresource proxy targets at `/odc_query/*` worked fine. Add a HasPrefix check against SqlWorkbenchController.SqlWorkbenchService.GetRootUri() (==/odc_query) at the top of the Skipper so all `/odc_query` and `/odc_query/...` requests bypass StaticConfig and reach the existing ProxyWithConfig rewrite (`/odc_query/*` -> `/$1`) targeting ODC 8989. Refs: dms-ee#865
Seechi-Yolo
approved these changes
May 29, 2026
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
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
Summary
CE 部分,CE/EE 拆分自 actiontech/dms-ee#865(ODC 工作台支持 GaussDB / openGauss 需求)。
internal/sql_workbench/service/sql_workbench_service.go:SupportDBType白名单新增DBTypeGaussDB+DBTypePostgreSQL(覆盖 EARS-1.2 / decision-3 → KF-2)convertDBType新增"GaussDB" → "GAUSSDB"映射(EARS-1.3 / CR-12 case-sensitivity)internal/apiserver/service/router.go:/odc_query前缀,导致 DMS SPA fallback 拦截 ODC umi index.htmlHasPrefix(GetRootUri())跳过逻辑,恢复/odc_query/*→ ODC :8989 反向代理Related Issue
Refs: actiontech/dms-ee#865
Test plan
Description
修复/odc_query路径代理问题
更新转换函数支持GaussDB映射
白名单新增PostgreSQL和GaussDB支持
补充单元测试验证新逻辑
Diagram Walkthrough
File Walkthrough
router.go
修复/odc_query代理失败问题internal/apiserver/service/router.go
sql_workbench_service.go
添加GaussDB映射与白名单支持internal/sql_workbench/service/sql_workbench_service.go
sql_workbench_service_test.go
补充GaussDB支持单元测试验证internal/sql_workbench/service/sql_workbench_service_test.go