Skip to content

fix(docs-version-sync): use the .git marker for the repo root - #550

Open
mesutoezdil wants to merge 10 commits into
NVIDIA:mainfrom
mesutoezdil:mesutoezdil/fix/docs-version-sync-repo-root
Open

fix(docs-version-sync): use the .git marker for the repo root#550
mesutoezdil wants to merge 10 commits into
NVIDIA:mainfrom
mesutoezdil:mesutoezdil/fix/docs-version-sync-repo-root

Conversation

@mesutoezdil

@mesutoezdil mesutoezdil commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

TL;DR

go run -C tools/docs-version-sync . --target main, the command in docs/AGENTS.md, failed with imports.yaml not found. findRepoRoot looked for imports.yaml, which this repository does not use. It now resolves the root from the .git marker, and the imports.yaml references are removed from the root AGENTS.md.

QA

go test ./... in tools/docs-version-sync passes, including TestFindRepoRoot covering .git as a directory, .git as a worktree file, and the not-found case. Verified go run -C tools/docs-version-sync . --target main now runs from a nested directory.

Issues

Closes #549

Summary by CodeRabbit

  • Bug Fixes

    • Improved repository detection for documentation version synchronization in standard and worktree-based Git setups.
    • Updated error messages when a repository root cannot be found.
  • Tests

    • Added coverage for Git directories, worktree pointers, and missing repository metadata.
  • Documentation

    • Clarified guidance for determining ownership and build instructions within nested project areas.

@mesutoezdil
mesutoezdil requested review from a team as code owners July 29, 2026 21:51
@mesutoezdil
mesutoezdil requested a review from balajinvda July 29, 2026 21:51
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Repository guidance now uses nested AGENTS.md files for subtree ownership. findRepoRoot detects .git directories and gitdir files, with tests covering traversal, symlink resolution, and missing markers.

Changes

Repository-root resolution

Layer / File(s) Summary
Root marker detection and validation
AGENTS.md, tools/docs-version-sync/main.go, tools/docs-version-sync/main_test.go
Guidance no longer lists imports.yaml. findRepoRoot detects .git markers, and tests cover directory, gitdir-file, nested, symlink, and failure cases.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: balajinvda

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title uses the required Conventional Commits format and accurately identifies the repository-root bug fix.
Linked Issues check ✅ Passed The changes implement .git-based root detection, update AGENTS.md guidance, and add tests required by issue #549.
Out of Scope Changes check ✅ Passed All changes directly support the linked issue by updating root detection, documentation, and related tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread tools/docs-version-sync/main.go Outdated
@mesutoezdil
mesutoezdil force-pushed the mesutoezdil/fix/docs-version-sync-repo-root branch from 59f0ad5 to 7b812e7 Compare July 30, 2026 08:19
@mesutoezdil mesutoezdil changed the title fix(docs-version-sync): fall back to the .git marker for the repo root fix(docs-version-sync): use the .git marker for the repo root Jul 30, 2026
@mesutoezdil
mesutoezdil force-pushed the mesutoezdil/fix/docs-version-sync-repo-root branch from d60368f to 61ac660 Compare July 31, 2026 06:47
findRepoRoot looked for imports.yaml, which this repository does not use, so
`go run -C tools/docs-version-sync . --target main` failed with
"imports.yaml not found". Resolve the root from the .git marker instead and
drop the imports.yaml references from the root AGENTS.md.

Closes NVIDIA#549

Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
@mesutoezdil
mesutoezdil force-pushed the mesutoezdil/fix/docs-version-sync-repo-root branch from 61ac660 to f1805d0 Compare August 1, 2026 07:54
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.

docs-version-sync: cannot resolve the repo root on the public mirror

2 participants