-
Notifications
You must be signed in to change notification settings - Fork 204
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
Conversation
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
winfredLIN
reviewed
Mar 6, 2025
winfredLIN
reviewed
Mar 6, 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
approved these changes
Mar 6, 2025
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.
关联的 issue
#2942
描述你的变更
确认项(pr提交后操作)
Tip
请在指定复审人之前,确认并完成以下事项,完成后✅
not_compatible
need_update_doc