Skip to content

self-development: replace git fetch --unshallow with --depth 100#956

Open
kelos-bot[bot] wants to merge 1 commit intomainfrom
kelos-task-953
Open

self-development: replace git fetch --unshallow with --depth 100#956
kelos-bot[bot] wants to merge 1 commit intomainfrom
kelos-task-953

Conversation

@kelos-bot
Copy link
Copy Markdown

@kelos-bot kelos-bot Bot commented Apr 11, 2026

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Removes git fetch --unshallow || true from all self-development workflow templates and replaces it with git 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.yaml
  • kelos-workers.yaml
  • kelos-pr-responder.yaml
  • kelos-reviewer.yaml

Does this PR introduce a user-facing change?

NONE

Summary by cubic

Switch self-development workflows from git fetch --unshallow to git fetch <remote> main --depth 100 to fetch only recent commits and speed up CI rebases. Applies to kelos-squash-commits.yaml, kelos-workers.yaml, kelos-pr-responder.yaml, and kelos-reviewer.yaml; fixes #953.

Written for commit 483bf68. Summary will update on new commits.

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>
@github-actions github-actions Bot added needs-triage kind/cleanup needs-kind Indicates an issue or PR lacks a kind/* label needs-priority needs-actor release-note-none and removed needs-kind Indicates an issue or PR lacks a kind/* label labels Apr 11, 2026
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Apr 11, 2026

Choose a reason for hiding this comment

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

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
Fix with Cubic

```
git fetch --unshallow || true
git fetch origin main
git fetch origin main --depth 100
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Apr 11, 2026

Choose a reason for hiding this comment

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

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
Fix with Cubic

- 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
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Apr 11, 2026

Choose a reason for hiding this comment

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

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)
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

self-development: remove git fetch --shallow

1 participant