Skip to content

feat: 快捷审核git仓库审核,支持指定仓库分支 #2946

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Mar 6, 2025

Conversation

littleniannian
Copy link
Collaborator

关联的 issue

#2942

描述你的变更

  • 快捷审核GIT审核支持分支选择

确认项(pr提交后操作)

Tip

请在指定复审人之前,确认并完成以下事项,完成后✅


  • 我已完成自测
  • 我已记录完整日志方便进行诊断
  • 我已在关联的issue里补充了实现方案
  • 我已在关联的issue里补充了测试影响面
  • 我已确认了变更的兼容性,如果不兼容则在issue里标记 not_compatible
  • 我已确认了是否要更新文档,如果要更新则在issue里标记 need_update_doc

@littleniannian littleniannian changed the title Feat git branch feat: 快捷审核git仓库审核,支持指定仓库分支 Mar 4, 2025
- 将表单值直接传递给 CloneGitRepository 函数- 在 CloneGitRepository 函数中增加对 URL 的有效性检查
- 优化代码结构,提高可读性和可维护性
-将 CloneGitRepository 函数的创建临时目录和清理逻辑移至函数内部
- 优化 TestGitConnection 和 SQL 审计记录中的 Git 仓库克隆逻辑
-改进 branches 切片处理,提高代码可读性和效率
- 在 TestGitConnectionV1 接口中,将 cleanup 函数调用移到 defer 中,确保在接口返回前执行清理
- 在 GetSqlsFromGit 接口中,添加 defer 清理逻辑,仅在发生错误时执行清理- 优化 CloneGitRepository 函数,使用命名返回值提高代码可读性
- 在 configuration_ce.go 和 sql_audit_record.go 文件中,优化了 git 仓库清理逻辑
- 将清理操作的错误处理逻辑简化,避免了嵌套的 if 语句
- 使用 cleanupError 变量来存储清理操作的错误,避免了与之前错误变量的混淆
@winfredLIN winfredLIN merged commit 5a1920f into main Mar 6, 2025
3 checks passed
@littleniannian littleniannian deleted the feat_git_branch branch March 6, 2025 10:07
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.

2 participants