-
Notifications
You must be signed in to change notification settings - Fork 129
chore(engine): add db nuke subcommand
#3313
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
PR Review: Add
|
More templates
@rivetkit/actor
@rivetkit/cloudflare-workers
@rivetkit/core
@rivetkit/db
@rivetkit/framework-base
@rivetkit/next-js
@rivetkit/react
rivetkit
@rivetkit/sql-loader
@rivetkit/engine-runner
@rivetkit/engine-runner-protocol
commit: |
26c768a to
ca84581
Compare
PR Review: Add
|
ca84581 to
cf3b3e3
Compare
Code ReviewOverviewThis PR adds a Issues Found🔴 Critical: Shell Script BugFile: The path in the shell script is quoted, which prevents tilde expansion: rm -rf "~/Library/Application Support/rivet-engine/"This will fail because the shell won't expand Fix: rm -rf ~/Library/Application\ Support/rivet-engine/
# or
rm -rf "$HOME/Library/Application Support/rivet-engine/"🟡 Issue: Hardcoded macOS PathFile: The script hardcodes a macOS-specific path ( Concerns:
Recommendation: Either:
Code Quality✅ Good Practices
🟢 Minor: Consider Using Structured LoggingFile: According to CLAUDE.md, structured logging with tracing is preferred. Consider: tracing::info!(path = %file_system.path.display(), "removing database directory");
// ... operation ...
tracing::info!("database directory removed");However, for CLI commands directly interacting with users, 🟢 Minor: Error Message CapitalizationFile: Per CLAUDE.md logging guidelines (lowercase unless mentioning code symbols), consider: bail!("nuke command not implemented for postgres");Security Considerations✅ Good Safety Measures
🟡 Consider: Additional SafeguardsFor a destructive operation, consider:
Testing
|
Merge activity
|
9d52114 to
84e9dc6
Compare
cf3b3e3 to
620ef31
Compare
PR ReviewThank you for adding the Critical Issues1. Bug in The path is quoted, which prevents shell tilde expansion: rm -rf "~/Library/Application Support/rivet-engine/"This will literally try to remove a directory named rm -rf ~/Library/Application\ Support/rivet-engine/
# or
rm -rf "$HOME/Library/Application Support/rivet-engine/"2. Platform-specific hardcoded path The script hardcodes a macOS-specific path (
Code Quality Issues3. Logging pattern violation (engine/packages/engine/src/commands/db/mod.rs:71, 73) Per CLAUDE.md, use // Current
println!("Removing {}", file_system.path.display());
println!("Complete");
// Should be
tracing::info!(path = %file_system.path.display(), "removing database");
tracing::info!("database removed");4. Missing error context (line 72) Add context to the error for better debugging: tokio::fs::remove_dir_all(&file_system.path)
.await
.context("failed to remove database directory")?;Positive Aspects
Recommendations
Test Plan SuggestionAfter fixing:
|
PR Review: Add
|

No description provided.