Skip to content

feat(claude-code-review): make checkout fetch-depth a caller input - #68

Open
rekibnikufesin wants to merge 1 commit into
mainfrom
feat/claude-review-fetch-depth-input
Open

feat(claude-code-review): make checkout fetch-depth a caller input#68
rekibnikufesin wants to merge 1 commit into
mainfrom
feat/claude-review-fetch-depth-input

Conversation

@rekibnikufesin

Copy link
Copy Markdown
Contributor

Summary

Adds an optional fetch_depth input (default 1, unchanged behavior) to ai-platform-claude-code-review.yml and wires it into the checkout step's fetch-depth, instead of the hardcoded 1.

Why

While migrating 0xPolygon/devops onto this shared workflow (approver mode), I found devops's existing inline review workflow set fetch-depth: 0 deliberately — added in devops#1589 by @Andres-Monje:

Full history. The review explicitly includes a "historical git context" pass, and without the base branch the reviewer cannot tell whether a claim about existing code still holds on main — a PR branched before a related fix gets reviewed against the pre-fix tree and reports issues that were already resolved.

This shared workflow's checkout was hardcoded to fetch-depth: 1, so every consumer using it (comment or approve mode) is missing that fix — the review can re-flag an issue elsewhere in a touched file that a since-merged commit on main already resolved, because a shallow checkout has no commit ancestry for the historical-context pass to walk.

Rather than change the default for everyone (some repos may prefer the faster shallow checkout and don't rely on the historical pass), this exposes it as a per-repo opt-in:

uses: 0xPolygon/pipelines/.github/workflows/ai-platform-claude-code-review.yml@<sha>
with:
  mode: approve
  fetch_depth: 0

Verification

  • YAML re-parsed successfully after the edit (checked with Ruby's YAML loader, no repo tooling available locally for actionlint).
  • No behavior change for existing consumers: default stays 1.
  • devops will set fetch_depth: 0 in its caller once this merges and its pin is bumped (0xPolygon/devops#2086).

🤖 Generated with Claude Code

devops's own inline review workflow used fetch-depth: 0 deliberately
(PR #1589, andres-monje): the review's "historical git context" pass
walks history against the base branch to check whether a claim about
surrounding code still holds on main, and a shallow checkout has no
ancestry for that walk, so it can re-flag an issue elsewhere in a
touched file that a since-merged commit already fixed on main.

Migrating devops to this shared workflow would have silently dropped
that fix - the checkout here was hardcoded to fetch-depth: 1. Rather
than change the default for every consumer (some may prefer the faster
shallow checkout and not need the historical pass), expose it as an
optional fetch_depth input, default 1 (unchanged behavior), so repos
that want full history can opt in per-repo.
@claude

claude Bot commented Sep 3, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@MaximusHaximus MaximusHaximus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:engage:

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