feat: add mcpd config volumes clear command#253
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughAdds a new CLI subcommand Changes
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds a new mcpd config volumes clear <server-name> --force subcommand to remove all configured volume mappings for a specific server, aligning behavior with existing destructive “clear” commands (requires --force) and reusing the existing volumes upsert semantics.
Changes:
- Registers the new
clearsubcommand undermcpd config volumes. - Implements
volumes clearcommand logic (force-gated, loads runtime context, clears volumes, upserts, prints operation result). - Adds unit tests covering success, noop, missing
--force, server-not-found, loader error, and upsert error paths.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cmd/config/volumes/cmd.go | Wires NewClearCmd into the volumes command’s subcommand list. |
| cmd/config/volumes/clear.go | Implements the volumes clear command and --force guard. |
| cmd/config/volumes/clear_test.go | Adds comprehensive unit tests for the new command behavior and error paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
mcpd config volumes clear <server-name> --forcecommand to clear all configured volume mappings for a server--forceflag to prevent accidental deletion (consistent withenv clearandargs clear)set,remove,list)Closes #199
Test plan
--force--forceis omittedmake test)golangci-lint run --fix -v)Summary by CodeRabbit
Release Notes
--forceflag as a safety mechanism to prevent accidental data loss.