Skip to content

LINBEE-20702: Optimize git clone performance with shallow-since#432

Merged
MishaKav merged 2 commits intodevelopfrom
LINBEE-20702
Nov 25, 2025
Merged

LINBEE-20702: Optimize git clone performance with shallow-since#432
MishaKav merged 2 commits intodevelopfrom
LINBEE-20702

Conversation

@MishaKav
Copy link
Collaborator

@MishaKav MishaKav commented Nov 23, 2025

✨ PR Description

Purpose: Optimize git clone performance in GitHub Action by replacing deep fetches with time-limited shallow clones.
Main changes:

  • Replaced --deepen=$ALL with --shallow-since="6 months ago" for git fetch operations
  • Removed unnecessary ALL=2147483647 variable declaration
  • Maintained the same branch checkout workflow with optimized fetch strategy

CHANGELOG

🔧 Improvements

  • Faster workflow execution by fetching only 6 months of git history instead of full repository
  • Reduced disk usage and clone times for repositories with large histories

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

Copy link

@orca-security-us orca-security-us bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@MishaKav MishaKav added the auto-deploy when exists in PR, will auto make release and auto deploy to prod label Nov 23, 2025
Copy link
Contributor

@gitstream-cm gitstream-cm bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨ PR Review

The PR successfully optimizes git fetch performance by switching to shallow clones, but introduces a potential functional regression for branches or commits older than 1 year.

1 issues detected:

🐞 Bug - Fetching only 1 year of history will fail to checkout branches that reference commits older than this timeframe.

Details: The shallow-since fetch will fail to retrieve commits older than 1 year. If base_ref or head_ref reference commits created before this cutoff (e.g., in reopened PRs, long-lived branches, or branches based on old commits), the fetch operations will not retrieve the necessary commits, causing the subsequent checkout operations on lines 134-136 to fail with reference errors.
File: action.yml

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how

Copy link
Collaborator

@vim-zz vim-zz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We dont even need 1 year, we are Ok with 6 month as this is the time covered by code-experts

… history

Replace --deepen=2147483647 with --shallow-since="6 months ago" to improve clone performance while maintaining sufficient commit history for gitStream analysis.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Contributor

@gitstream-cm gitstream-cm bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨ PR Review

The PR optimizes git clone performance by using shallow fetches, but there's a critical discrepancy between what was tested and what was implemented.

1 issues detected:

🐞 Bug - Implementation uses 6-month cutoff while testing and documentation reference 1-year cutoff 🛠️

Details: The implementation uses "6 months ago" for shallow fetch, but the PR description and performance testing clearly show results from testing with a "1 year" shallow clone. This discrepancy means the actual performance characteristics and failure risks differ from what was validated. The more aggressive 6-month cutoff increases the likelihood of checkout failures for long-lived or reopened PRs beyond what was tested.
File: action.yml (131-133)
🛠️ A suggested code correction is included in the review comments.

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how

@MishaKav MishaKav merged commit ce6434b into develop Nov 25, 2025
13 of 14 checks passed
@MishaKav MishaKav deleted the LINBEE-20702 branch November 25, 2025 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 min review AI-Minor-Change ai-tool-claude auto-deploy when exists in PR, will auto make release and auto deploy to prod

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants