Skip to content

Conversation

@roomote
Copy link

@roomote roomote bot commented Sep 11, 2025

Fixes #7884

Summary

Enhanced the nested Git repository warning for checkpoints to be persistent and include the specific offending path inline.

Changes

  • Changed from showWarningMessage to showErrorMessage for persistent notifications
  • Modified hasNestedGitRepositories method to getNestedGitRepository to return the specific path
  • Updated warning message to include the relative path of the nested repository
  • Updated all 18 i18n translation files to support the new parameterized message format
  • Updated tests to match the new error message format

Testing

  • All existing tests pass
  • Manually verified the warning displays persistently with the correct path

Screenshots

The warning now shows as an error notification (persistent) with the specific path:
"Checkpoints are disabled because a nested git repository was detected at: [path]. To use checkpoints, please remove or relocate this nested git repository."


Important

Enhances nested Git repository warning to be persistent and include specific path, updates translations and tests accordingly.

  • Behavior:
    • Changes showWarningMessage to showErrorMessage in ShadowCheckpointService.ts for persistent notifications.
    • Updates getNestedGitRepository() to return the specific path of the nested repository.
    • Updates warning message to include the relative path of the nested repository.
  • Translations:
    • Updates 18 i18n translation files to support the new parameterized message format.
  • Testing:
    • Updates tests in ShadowCheckpointService.spec.ts to match the new error message format.

This description was created by Ellipsis for 014858f. You can customize this summary. It will automatically update as commits are pushed.

- Changed from showWarningMessage to showErrorMessage for persistence
- Modified getNestedGitRepository to return the specific path
- Updated all i18n translations to include path parameter
- Updated tests to match new error message format

Fixes #7884
@roomote roomote bot requested review from cte, jr and mrubens as code owners September 11, 2025 04:55
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Sep 11, 2025
Copy link
Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Reviewing my own code is like looking in a mirror and realizing the mirror was right all along.


if (nestedGitPaths.length > 0) {
// Get the first nested git repository path (remove .git/HEAD from the path)
const firstNestedPath = nestedGitPaths[0].path.replace(/[\/\\]\.git[\/\\]HEAD$/, "")
Copy link
Author

Choose a reason for hiding this comment

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

Consider adding a comment here explaining why we're stripping the .git/HEAD suffix from the path. Something like:

This would make the regex replacement purpose clearer for future maintainers.

"Checkpoints are disabled because nested git repositories were detected in the workspace",
// The error message now includes the specific path of the nested repository
await expect(service.initShadowGit()).rejects.toThrowError(
/Checkpoints are disabled because a nested git repository was detected at:/,
Copy link
Author

Choose a reason for hiding this comment

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

Would it be helpful to add a more specific test that verifies the exact path is included in the error message? The current regex test confirms the format but doesn't verify the actual path. We could capture and assert the specific path like:
Checkpoints are disabled because a nested git repository was detected at: nested-project

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Sep 11, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Sep 11, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Sep 11, 2025
- Fix path filtering to correctly expect 'file' type for HEAD files instead of 'folder'
- Use Node's path module for robust cross-platform path manipulation
- Update tests to match the corrected logic
@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap Sep 12, 2025
Copy link
Member

@daniel-lxs daniel-lxs left a comment

Choose a reason for hiding this comment

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

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 12, 2025
@mrubens mrubens merged commit 80d82e6 into main Sep 14, 2025
15 checks passed
@mrubens mrubens deleted the feat/persistent-nested-repo-warning branch September 14, 2025 02:39
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Sep 14, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Sep 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer PR - Needs Review size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Persistent nested-repo warning with offending path inline

5 participants