Skip to content

Conversation

@jhaynie
Copy link
Member

@jhaynie jhaynie commented Jun 26, 2025

Summary by CodeRabbit

  • New Features

    • Added support for deleting projects by specifying project IDs directly as command-line arguments.
    • Introduced a --force flag to skip confirmation prompts when deleting projects.
  • Improvements

    • The project deletion command now preserves interactive selection if no IDs are provided.
  • Chores

    • Updated default ignore rules to automatically exclude .DS_Store files.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 26, 2025

Walkthrough

The command-line project deletion command was updated to accept project IDs as arguments and introduces a --force flag to skip confirmation prompts. If no IDs are provided, the interactive UI remains available. Additionally, the default ignore rules now include .DS_Store files in the ignore patterns.

Changes

File(s) Change Summary
cmd/project.go Updated projectDeleteCmd to accept project IDs as arguments, added --force flag, removed cobra.NoArgs restriction, and adjusted control flow for argument and flag handling.
internal/ignore/rules.go Added "**/.DS_Store" to the default ignore patterns in AddDefaults() method.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant ProjectAPI

    User->>CLI: Run project delete [projectID(s)] [--force]
    alt Project IDs provided
        alt --force flag set
            CLI->>ProjectAPI: Delete specified projects (no confirmation)
        else --force not set
            CLI->>User: Prompt for confirmation
            User->>CLI: Confirm or cancel
            alt Confirmed
                CLI->>ProjectAPI: Delete specified projects
            else Cancelled
                CLI->>User: Operation cancelled
            end
        end
    else No project IDs provided
        CLI->>ProjectAPI: Fetch list of projects
        CLI->>User: Show interactive project selection UI
        User->>CLI: Select projects
        CLI->>User: Prompt for confirmation (unless --force)
        User->>CLI: Confirm or cancel
        alt Confirmed
            CLI->>ProjectAPI: Delete selected projects
        else Cancelled
            CLI->>User: Operation cancelled
        end
    end
Loading

Possibly related PRs

Suggested reviewers

  • robindiddams

Poem

A hop, a skip, a project gone,
With just a flag, the prompt is done.
Pass IDs quick, or pick with glee,
Now .DS_Store files, you’ll never see.
The bunny cheers with ears held high—
Simpler deletes, oh my, oh my!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 08eb9ad and fcd89f0.

📒 Files selected for processing (1)
  • cmd/project.go (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • cmd/project.go
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Test CLI Upgrade Path (windows-latest)
  • GitHub Check: Build and Test (macos-latest)
  • GitHub Check: Analyze (go)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch headless-delete

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai bot requested a review from robindiddams June 26, 2025 15:14
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
cmd/project.go (1)

813-816: Remove unused variable assignment.

The static analysis tool correctly identified that desc is assigned but never used in the option construction. This creates unnecessary computation and potential confusion.

Apply this diff to remove the unused assignment:

 		for _, project := range projects {
-			desc := project.Description
-			if desc == "" {
-				desc = emptyProjectDescription
-			}
 			options = append(options, tui.Option{
 				ID:   project.ID,
 				Text: tui.Bold(tui.PadRight(project.Name, 20, " ")) + tui.Muted(project.ID),
 			})
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e213b1f and 08eb9ad.

📒 Files selected for processing (2)
  • cmd/project.go (2 hunks)
  • internal/ignore/rules.go (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
cmd/project.go (1)
internal/project/project.go (1)
  • ProjectListData (298-304)
🪛 golangci-lint (1.64.8)
cmd/project.go

815-815: ineffectual assignment to desc

(ineffassign)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Analyze (go)
  • GitHub Check: Test CLI Upgrade Path (windows-latest)
🔇 Additional comments (5)
internal/ignore/rules.go (1)

96-96: LGTM! Good addition of macOS system file ignore pattern.

Adding .DS_Store to the default ignore patterns is a wise decision as these are macOS-specific metadata files that should typically be excluded from project operations.

cmd/project.go (4)

801-834: LGTM! Clean implementation of headless mode support.

The logic elegantly handles both headless (argument-based) and interactive modes:

  • When project IDs are provided as arguments, they're used directly
  • Falls back to the existing interactive multi-select UI when no arguments are given
  • Maintains full backward compatibility

This aligns perfectly with the PR objective of adding headless project deletion.


836-841: LGTM! Proper force flag implementation.

The force flag implementation correctly:

  • Skips the confirmation prompt when --force is specified
  • Maintains the existing confirmation flow for safety when force is not used
  • Provides clear feedback when deletion is cancelled

This follows standard CLI patterns and enhances usability for automation scenarios.


845-845: LGTM! Good refactoring for spinner integration.

Wrapping the deletion logic in an action variable improves code organization and readability while maintaining the same functionality.


967-967: LGTM! Proper flag definition for force option.

The --force flag is correctly defined with appropriate description for skipping confirmation prompts.

@jhaynie jhaynie merged commit caca7d8 into main Jun 26, 2025
14 checks passed
@jhaynie jhaynie deleted the headless-delete branch June 26, 2025 15:24
@devin-ai-integration devin-ai-integration bot mentioned this pull request Jun 26, 2025
3 tasks
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