Skip to content

fix(examples): support commit SHAs for git_ref in the Harbor adapter 🤖🤖🤖 - #70

Merged
rdasilveiracabral merged 1 commit into
NVIDIA-NeMo:mainfrom
kmad:fix/harbor-adapter-sha-ref
Jul 31, 2026
Merged

fix(examples): support commit SHAs for git_ref in the Harbor adapter 🤖🤖🤖#70
rdasilveiracabral merged 1 commit into
NVIDIA-NeMo:mainfrom
kmad:fix/harbor-adapter-sha-ref

Conversation

@kmad

@kmad kmad commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

The adapter docstring says git_ref accepts a "branch/tag/SHA", but install() passes it to git clone --branch, which rejects commit SHAs — pinning an exact commit fails with exit 128 (fatal: Remote branch <sha> not found).

Fix: fetch the ref into an initialized repo and check out FETCH_HEAD — one code path verified against GitHub for branches, lightweight tags, annotated tags (checkout peels correctly), and full SHAs including non-tip commits, with --depth 1 shallowness preserved. The git_ref=None default keeps the existing git clone --depth 1 path unchanged. Abbreviated SHAs resolve in neither the old nor new path, so the docstring now says full SHA.

Found while reproducing the tech report's Terminal-Bench results with the repo pinned to an exact commit; the fixed path has since run several hundred trial installs in Daytona containers.

  • ruff check / ruff format --check pass
  • No test change: examples/ is outside pytest scope
  • Docs updated in-place (docstring)

🤖 Generated with Claude Code

git clone --branch only accepts branch/tag names, so pinning git_ref to
a commit SHA failed with exit 128 despite the documented contract.
Fetch the ref and check out FETCH_HEAD instead: one path for branches,
tags, and full SHAs, still --depth 1. Abbreviated SHAs are not
fetchable remotely, so the docstring now says full SHA.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: kmad <3433032+kmad@users.noreply.github.com>
@rdasilveiracabral
rdasilveiracabral merged commit 6031c5e into NVIDIA-NeMo:main Jul 31, 2026
5 checks passed
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