Skip to content

feat(git-integration): optimize full clones by getting a single branch and skipping tags#3482

Merged
mbani01 merged 2 commits intomainfrom
feat/optimize_full_clone
Oct 8, 2025
Merged

feat(git-integration): optimize full clones by getting a single branch and skipping tags#3482
mbani01 merged 2 commits intomainfrom
feat/optimize_full_clone

Conversation

@mbani01
Copy link
Copy Markdown
Contributor

@mbani01 mbani01 commented Oct 8, 2025

This pull request updates the way Git repositories are cloned in the clone_service.py module to ensure consistency and improve reliability. The changes primarily affect both minimal and full clone operations by standardizing the use of certain Git flags and target directories.

Improvements to Git clone operations:

  • Both minimal and full clone commands now use "." as the target directory instead of the full path, aligning with best practices for running commands inside the destination directory. [1] [2]
  • The full clone operation now explicitly uses the --no-tags and --single-branch flags to match the minimal clone behavior, which can help reduce unnecessary data transfer and speed up cloning.

@mbani01 mbani01 requested a review from Copilot October 8, 2025 10:14
@mbani01 mbani01 self-assigned this Oct 8, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 8, 2025

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CDP-123)
  • feat: add user authentication (IN-123)

Projects:

  • CDP: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@mbani01 mbani01 changed the title feat(git-integration_: optimize full clones by getting a single branch and skipping tags feat(git-integration): optimize full clones by getting a single branch and skipping tags Oct 8, 2025
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Conventional Commits FTW!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request optimizes Git repository cloning operations by standardizing clone commands and improving efficiency. The changes ensure both minimal and full clone operations use consistent flags and target directories.

  • Updated both minimal and full clone operations to use "." as target directory instead of full path
  • Added --no-tags and --single-branch flags to full clone operation to match minimal clone behavior and reduce data transfer

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

"""Perform full repository clone"""
self.logger.info(f"Performing full clone for repo {remote}...")
await run_shell_command(["git", "clone", remote, repo_path], cwd=repo_path)
await run_shell_command(["git", "clone", "--no-tags", "--single-branch", remote, "."], cwd=repo_path)
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Adding --single-branch flag to full clone changes the behavior significantly - it will only clone the default branch instead of all branches. This contradicts the purpose of a 'full clone' which should include all branches. Consider removing --single-branch if the intention is to clone all branches, or rename the method to reflect the single-branch behavior.

Suggested change
await run_shell_command(["git", "clone", "--no-tags", "--single-branch", remote, "."], cwd=repo_path)
await run_shell_command(["git", "clone", "--no-tags", remote, "."], cwd=repo_path)

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 8, 2025

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CDP-123)
  • feat: add user authentication (IN-123)

Projects:

  • CDP: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 8, 2025

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CDP-123)
  • feat: add user authentication (IN-123)

Projects:

  • CDP: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@mbani01 mbani01 merged commit b0d2e27 into main Oct 8, 2025
13 checks passed
@mbani01 mbani01 deleted the feat/optimize_full_clone branch October 8, 2025 10:18
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