Skip to content

feat(git): add newCloneOptions function and corresponding tests for Git clone options#3221

Merged
Seechi-Yolo merged 1 commit intomainfrom
fix-3220
Mar 24, 2026
Merged

feat(git): add newCloneOptions function and corresponding tests for Git clone options#3221
Seechi-Yolo merged 1 commit intomainfrom
fix-3220

Conversation

@LordofAvernus
Copy link
Copy Markdown
Collaborator

@LordofAvernus LordofAvernus commented Mar 24, 2026

User description

关联的 issue

#3220

描述你的变更

使用浅克隆减少审核仓库耗时

确认项(pr提交后操作)

Tip

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


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


Description

  • 使用浅克隆降低仓库克隆数据量

  • 新增 newCloneOptions 函数以复用克隆配置

  • 配置单分支克隆以减少不必要数据

  • 添加单元测试确保配置正确


Diagram Walkthrough

flowchart LR
  A["配置克隆选项"] -- "调用newCloneOptions" --> B["设置浅克隆深度与TLS选项"]
  B -- "判断分支" --> C["设置SingleBranch与ReferenceName"]
  C -- "传递给PlainCloneContext" --> D["执行仓库克隆"]
Loading

File Walkthrough

Relevant files
Bug fix
configuration.go
重构Git克隆配置以使用浅克隆                                                                                   

sqle/api/controller/v1/configuration.go

  • 替换原始克隆配置
  • 使用 newCloneOptions 生成克隆选项
  • 设置浅克隆深度为1
  • 对存在分支时启用单分支克隆
+19/-9   
Tests
configuration_test.go
为newCloneOptions添加单元测试                                                                     

sqle/api/controller/v1/configuration_test.go

  • 添加无分支下的 newCloneOptions 测试
  • 添加有分支下的 newCloneOptions 测试
  • 验证浅克隆深度和单分支配置
+45/-0   

@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

🎫 Ticket compliance analysis 🔶

3220 - Partially compliant

Compliant requirements:

  • 使用浅克隆降低仓库克隆数据量
  • 新增 newCloneOptions 函数以复用克隆配置
  • 配置单分支克隆以减少不必要数据
  • 添加单元测试确保配置正确

Non-compliant requirements:

Requires further human verification:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

@github-actions
Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

@Seechi-Yolo Seechi-Yolo merged commit 6500362 into main Mar 24, 2026
4 checks passed
@BugsGuru BugsGuru deleted the fix-3220 branch April 2, 2026 09:41
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