self-development: replace git fetch --unshallow with --depth 100#956
Open
kelos-bot[bot] wants to merge 1 commit intomainfrom
Open
self-development: replace git fetch --unshallow with --depth 100#956kelos-bot[bot] wants to merge 1 commit intomainfrom
kelos-bot[bot] wants to merge 1 commit intomainfrom
Conversation
Remove `git fetch --unshallow || true` from all self-development workflow templates and use `git fetch origin main --depth 100` instead. This avoids downloading full repository history when only recent commits are needed for rebasing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
3 issues found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="self-development/kelos-squash-commits.yaml">
<violation number="1" location="self-development/kelos-squash-commits.yaml:60">
P2: Fetching `main` with fixed depth can break later `git merge-base`/squash steps for older branches. Ensure full history is available when the merge-base is outside the shallow window.</violation>
</file>
<file name="self-development/kelos-reviewer.yaml">
<violation number="1" location="self-development/kelos-reviewer.yaml:98">
P1: Fetching `main` with a fixed depth can miss the merge-base used by `git diff origin/main...HEAD`, causing incomplete or failing reviews for older PR branches.</violation>
</file>
<file name="self-development/kelos-workers.yaml">
<violation number="1" location="self-development/kelos-workers.yaml:99">
P2: Using a fixed shallow fetch depth can break rebases for older branches when the merge base is deeper than 100 commits.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| ``` | ||
| git fetch --unshallow || true | ||
| git fetch origin main | ||
| git fetch origin main --depth 100 |
There was a problem hiding this comment.
P1: Fetching main with a fixed depth can miss the merge-base used by git diff origin/main...HEAD, causing incomplete or failing reviews for older PR branches.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At self-development/kelos-reviewer.yaml, line 98:
<comment>Fetching `main` with a fixed depth can miss the merge-base used by `git diff origin/main...HEAD`, causing incomplete or failing reviews for older PR branches.</comment>
<file context>
@@ -92,11 +92,10 @@ spec:
```
- git fetch --unshallow || true
- git fetch origin main
+ git fetch origin main --depth 100
```
</file context>
Suggested change
| git fetch origin main --depth 100 | |
| git fetch --unshallow || true | |
| git fetch origin main |
| ``` | ||
| git fetch --unshallow || true | ||
| git fetch origin main | ||
| git fetch origin main --depth 100 |
There was a problem hiding this comment.
P2: Fetching main with fixed depth can break later git merge-base/squash steps for older branches. Ensure full history is available when the merge-base is outside the shallow window.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At self-development/kelos-squash-commits.yaml, line 60:
<comment>Fetching `main` with fixed depth can break later `git merge-base`/squash steps for older branches. Ensure full history is available when the merge-base is outside the shallow window.</comment>
<file context>
@@ -55,10 +55,9 @@ spec:
```
- git fetch --unshallow || true
- git fetch origin main
+ git fetch origin main --depth 100
```
</file context>
Suggested change
| git fetch origin main --depth 100 | |
| git fetch origin main --depth 100 | |
| git merge-base origin/main HEAD >/dev/null 2>&1 || git fetch --unshallow |
| - 0. Set up your working branch. Run this exactly: | ||
| ``` | ||
| git fetch --unshallow || true; git fetch origin main; git rebase origin/main | ||
| git fetch origin main --depth 100; git rebase origin/main |
There was a problem hiding this comment.
P2: Using a fixed shallow fetch depth can break rebases for older branches when the merge base is deeper than 100 commits.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At self-development/kelos-workers.yaml, line 99:
<comment>Using a fixed shallow fetch depth can break rebases for older branches when the merge base is deeper than 100 commits.</comment>
<file context>
@@ -96,7 +96,7 @@ spec:
- 0. Set up your working branch. Run this exactly:
```
- git fetch --unshallow || true; git fetch origin main; git rebase origin/main
+ git fetch origin main --depth 100; git rebase origin/main
```
- 1. Check if a PR already exists for branch kelos-task-{{.Number}}.
</file context>
Suggested change
| git fetch origin main --depth 100; git rebase origin/main | |
| git fetch origin main --depth 100; git rebase origin/main || (git fetch --unshallow origin main && git rebase origin/main) |
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
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.
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Removes
git fetch --unshallow || truefrom all self-development workflow templates and replaces it withgit fetch origin main --depth 100. This avoids downloading full repository history when only recent commits are needed for rebasing, improving performance of CI workflows.Which issue(s) this PR is related to:
Fixes #953
Special notes for your reviewer:
Changes are in 4 self-development YAML files:
kelos-squash-commits.yamlkelos-workers.yamlkelos-pr-responder.yamlkelos-reviewer.yamlDoes this PR introduce a user-facing change?
Summary by cubic
Switch self-development workflows from
git fetch --unshallowtogit fetch <remote> main --depth 100to fetch only recent commits and speed up CI rebases. Applies tokelos-squash-commits.yaml,kelos-workers.yaml,kelos-pr-responder.yaml, andkelos-reviewer.yaml; fixes #953.Written for commit 483bf68. Summary will update on new commits.