-
Notifications
You must be signed in to change notification settings - Fork 7
[GITHUB-338] Do not create a git repo if we’re already in a git repo #406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThe update refines the logic for initializing a new git repository during project creation. It now checks if a Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant Deployer
User->>CLI: Run project creation command
CLI->>Deployer: Check for git repository in project directory
alt .git found in project directory
CLI->>CLI: Initialize new git repo and add GitHub actions
else .git found only in parent directory
CLI->>CLI: Log info, skip git repo creation
else No git repo found
CLI->>CLI: Initialize new git repo and add GitHub actions
end
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✨ Finishing Touches
🧪 Generate Unit Tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
cmd/project.go (1)
636-637: Add clarity to the comment.The comment could be more specific about what "parent git repo" means in this context.
- // Only initialize a new git repo if there is no parent git repo - // (i.e., if the closest .git is the projectDir itself, not a parent) + // Only initialize a new git repo if we're not inside an existing git repository + // or if the .git directory is directly in the project directory itself
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
cmd/project.go(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
cmd/project.go (1)
internal/deployer/metadata.go (1)
GetGitInfo(64-105)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Test CLI Upgrade Path (windows-latest)
- GitHub Check: Analyze (go)
🔇 Additional comments (1)
cmd/project.go (1)
630-652: Git repository detection logic verified as correctI’ve reviewed the implementations of
GetGitInfoRecursive(internal/deployer/metadata.go:108–136) andGetGitInfo(internal/deployer/metadata.go:64–105). Together they correctly:
- Traverse upward from
projectDirto find the nearest.git(viaGetGitInfoRecursive), and- Confirm whether
projectDiritself is a git repo (viaGetGitInfo),ensuring
projectGitFlowonly runs when the closest.gitis at the project root (or absent altogether). There are currently no unit tests covering these functions—consider adding tests to validate this behavior going forward.
Summary by CodeRabbit