Skip to content

fix: 修复代码审查发现的问题#30

Open
zx06 wants to merge 4 commits intomainfrom
260212-fix-review-issues
Open

fix: 修复代码审查发现的问题#30
zx06 wants to merge 4 commits intomainfrom
260212-fix-review-issues

Conversation

@zx06
Copy link
Owner

@zx06 zx06 commented Feb 12, 2026

  1. 修复 MySQL driver 资源泄漏:使用 sync.Once 替代每次 Open 都注册 dialer
  2. 提取公共连接逻辑到 internal/app:新增 ResolveConnection 和 ResolveSSH 函数
  3. 重构 cmd/xsql 使用公共连接助手,消除代码重复
  4. 更新测试使用新的 app.ResolveSSH 函数

1. 修复 MySQL driver 资源泄漏:使用 sync.Once 替代每次 Open 都注册 dialer
2. 提取公共连接逻辑到 internal/app:新增 ResolveConnection 和 ResolveSSH 函数
3. 重构 cmd/xsql 使用公共连接助手,消除代码重复
4. 更新测试使用新的 app.ResolveSSH 函数
Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 47.16981% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.85%. Comparing base (6bd2c00) to head (6c44548).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
internal/app/conn.go 40.00% 47 Missing and 1 partial ⚠️
internal/db/mysql/driver.go 63.63% 3 Missing and 1 partial ⚠️
cmd/xsql/query.go 71.42% 2 Missing ⚠️
cmd/xsql/schema.go 71.42% 2 Missing ⚠️

❌ Your patch check has failed because the patch coverage (47.16%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #30      +/-   ##
==========================================
+ Coverage   80.76%   80.85%   +0.08%     
==========================================
  Files          36       37       +1     
  Lines        2392     2403      +11     
==========================================
+ Hits         1932     1943      +11     
- Misses        357      361       +4     
+ Partials      103       99       -4     
Flag Coverage Δ
e2e 44.76% <0.00%> (-0.22%) ⬇️
integration 44.76% <0.00%> (-0.22%) ⬇️
unittests 66.45% <47.16%> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

zx06 and others added 3 commits February 12, 2026 09:48
- 添加 internal/app/conn.go 测试
- 补充 mysql driver 测试用例
- 补充 pg driver 测试用例
Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
3 Security Hotspots

See analysis details on SonarQube Cloud

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