Optimize private-org-sync retry fetch operations#5013
Optimize private-org-sync retry fetch operations#5013petr-muller wants to merge 2 commits intoopenshift:mainfrom
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughAdded a configurable fetchOptions struct and extended makeFetch to accept it; fetch command assembly now conditionally includes tags and chooses between --deepen and --depth based on useDeepen, with deepen computed as 2^(expDepth-1). mirror() and tests updated to pass and expect the new behavior. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.11.3)Command failed Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: petr-muller The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
811c759 to
5ddfb25
Compare
The initial fetch includes --tags to download all tag refs. Retry fetches that deepen the shallow clone no longer redundantly re-request tags since they are already present locally from the first fetch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5ddfb25 to
396e6b0
Compare
There was a problem hiding this comment.
Pull request overview
This PR optimizes private-org-sync’s retry fetch behavior during mirror operations by reducing redundant data transfer when a push fails due to a shallow clone.
Changes:
- Skip
--tagson retry fetches (tags are fetched on the initial attempt). - Use
--deepenfor retry fetches instead of increasing--depth, avoiding re-downloading already-fetched commits. - Update unit tests to reflect the new fetch command sequence.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| cmd/private-org-sync/main.go | Adjusts fetch construction to support “initial fetch with tags + depth” and “retry fetches with deepen, without tags”. |
| cmd/private-org-sync/main_test.go | Updates expected mocked git invocations for retry fetches to use --deepen and omit --tags. |
Comments suppressed due to low confidence (1)
cmd/private-org-sync/main.go:463
- The log message references
rev-parse --is-shallow-repobut the command being run isrev-parse --is-shallow-repository. This mismatch can confuse debugging; please update the message to the exact flag name.
logger.Error(message)
logger.Error("`rev-parse --is-shallow-repo` likely not supported by used git")
return nil, fmt.Errorf("%s", message)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
/hold reviews make sense |
When a shallow push fails and deeper fetching is needed, use --deepen=N to fetch only the additional commits instead of --depth=N which re-downloads all commits up to that depth. This avoids redundant data transfer during the retry loop. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9520365 to
5137018
Compare
|
/hold cancel |
|
/test images |
|
Pipeline controller notification No second-stage tests were triggered for this PR. This can happen when:
Use |
|
@petr-muller: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
--tagson retry fetches since tags are already fetched on the initial attempt--deepeninstead of--depthfor retry fetches to avoid re-downloading already-fetched commits🤖 Generated with Claude Code