Skip to content

标准产品 CE:SQL 管控整改兼容交付记录#3338

Open
LordofAvernus wants to merge 1 commit into
mainfrom
sqle/feat-2988
Open

标准产品 CE:SQL 管控整改兼容交付记录#3338
LordofAvernus wants to merge 1 commit into
mainfrom
sqle/feat-2988

Conversation

@LordofAvernus

@LordofAvernus LordofAvernus commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

User description

概述

完成 SQL 管控整改追踪双交付提交闭环,关联客户基线与标准产品交付结果。

Fixes #2988

门禁

  • 等价门禁记录见工作区 docs/submit/merge_check.json
  • 客户基线默认使用本机 mysql-for-sqle,不引入不可达远程 TDSQL 依赖

Description

  • 新增 SQL 管控整改概览接口及相关计算逻辑

  • 添加命令行工具用于回填首次审核数据

  • 扩展模型以支持整改状态统计和打分计算

  • 增加单元测试验证整改结果和审核分数计算


Diagram Walkthrough

flowchart LR
  A["新增SQL管控整改Overview接口"] --> B["调用数据库获取审核记录"]
  B --> C["计算整改状态及分数"]
  C --> D["返回整改概览数据"]
  E["新增回填命令行工具"] --> F["更新首次审核数据"]
  G["新增单元测试"] --> H["验证整改计算逻辑"]
Loading

File Walkthrough

Relevant files
Enhancement
6 files
sql_manage.go
新增整改概览接口及相关数据结构                                                                                   
+117/-3 
sql_manager_ce.go
增加未支持整改导出接口实现                                                                                       
+8/-0     
sql_manage.go
添加整改状态过滤参数                                                                                             
+1/-0     
backfill_sql_manage_first_audit.go
新增回填首次审核结果的命令行工具                                                                                 
+62/-0   
sqled.go
注册回填命令到主命令中                                                                                           
+1/-0     
instance_audit_plan.go
扩展模型支持整改状态统计与审核分数计算                                                                           
+259/-12
Tests
1 files
sql_manage_remediation_test.go
增加整改逻辑单元测试覆盖                                                                                         
+115/-0 

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

🎫 Ticket compliance analysis ✅

2988 - Fully compliant

Compliant requirements:

  • 移除 review_requested 触发类型
  • 排除 actiontech-bot 的触发行为
  • 仅在 PR 创建、重新打开或同步时触发复审
⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

错误格式化

在使用 fmt.Errorf 格式化错误信息时,使用了 "%d" 格式化 error 类型,这可能会导致格式化输出错误,建议改为使用 "%v" 以确保输出正确的错误信息。

if dbConfig.SecretPassword != "" {
	password, err := dmsCommonAes.AesDecrypt(dbConfig.SecretPassword)
	if err != nil {
		return nil, fmt.Errorf("read db info from config file error, %d", err)
	}

@github-actions

Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
修正错误格式化占位符

建议将格式化占位符%d替换为%v,以正确显示错误内容,避免运行时格式化错误。这样可以防止因错误格式化导致的程序崩溃风险。

sqle/cmd/sqled/backfill_sql_manage_first_audit.go [50]

-return nil, fmt.Errorf("read db info from config file error, %d", err)
+return nil, fmt.Errorf("read db info from config file error, %v", err)
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly replaces %d with %v for formatting the err variable, ensuring that error details are properly rendered. This change improves error handling without over-complicating the PR.

Medium

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant