Skip to content

fix(ci): remove --depth=1 from legacy guard base fetch - #1769

Merged
cv merged 2 commits into
NVIDIA:mainfrom
prekshivyas:fix/legacy-guard-shallow-fetch
Apr 10, 2026
Merged

fix(ci): remove --depth=1 from legacy guard base fetch#1769
cv merged 2 commits into
NVIDIA:mainfrom
prekshivyas:fix/legacy-guard-shallow-fetch

Conversation

@prekshivyas

@prekshivyas prekshivyas commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

The legacy-path-guard CI job fails on every PR with fatal: origin/main...HEAD: no merge base.

Root cause: The checkout uses fetch-depth: 0 (full PR history), but then git fetch origin main --depth=1 creates a shallow reference for origin/main with only 1 commit. Git can't find a merge base between the shallow main ref and HEAD.

Fix: Remove --depth=1 from the base branch fetch so origin/main has enough history for the three-dot diff.

Related

Introduced in #1683

Test plan

  • This PR's own legacy-path-guard job passes (self-validating)

Signed-off-by: Prekshi Vyas prekshiv@nvidia.com

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated internal CI/CD workflow configuration to improve git history fetching for automated checks.

The fetch-depth: 0 checkout fetches full PR branch history, but
git fetch origin main --depth=1 creates a shallow reference for
origin/main with only 1 commit. This breaks git diff --name-status
origin/main...HEAD because git can't find the merge base.

Remove --depth=1 so origin/main has enough history to compute the
three-dot diff against HEAD.

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 10, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

A workflow step in the GitHub Actions pipeline is modified to remove the --depth=1 shallow fetch limitation, enabling full commit history retrieval from the base branch during the "Fetch base branch" step.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/legacy-path-guard.yaml
Removed --depth=1 flag from git fetch command in "Fetch base branch" step, changing from shallow to full history fetch for origin/${{ github.base_ref }}.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 No shallow wells for history's tale,
Full depth now flows without avail,
The git roots run deep and wide,
Base branch secrets come to confide! 🌿

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: removing the --depth=1 flag from a git fetch command in the legacy-path-guard CI workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@cv
cv merged commit ee5fce2 into NVIDIA:main Apr 10, 2026
10 checks passed
@prekshivyas
prekshivyas deleted the fix/legacy-guard-shallow-fetch branch April 10, 2026 22:59
ericksoa pushed a commit to cheese-head/NemoClaw that referenced this pull request Apr 14, 2026
## Summary

The `legacy-path-guard` CI job fails on every PR with `fatal:
origin/main...HEAD: no merge base`.

**Root cause:** The checkout uses `fetch-depth: 0` (full PR history),
but then `git fetch origin main --depth=1` creates a shallow reference
for `origin/main` with only 1 commit. Git can't find a merge base
between the shallow main ref and HEAD.

**Fix:** Remove `--depth=1` from the base branch fetch so origin/main
has enough history for the three-dot diff.

## Related

Introduced in NVIDIA#1683 

## Test plan

- [ ] This PR's own `legacy-path-guard` job passes (self-validating)

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>

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

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Updated internal CI/CD workflow configuration to improve git history
fetching for automated checks.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@wscurran wscurran added the bug-fix PR fixes a bug or regression label Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants