-
Notifications
You must be signed in to change notification settings - Fork 256
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
feat: Rename project new/rm
to start/stop
, add restart
+ other args fixes
#771
Conversation
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.
Thanks for these @jonaro00! 🥳 I just have one comment about the use of bail!
@@ -68,7 +68,13 @@ impl Shuttle { | |||
Command::Deploy(..) | |||
| Command::Deployment(..) | |||
| Command::Resource(..) | |||
| Command::Project(..) | |||
| Command::Project( | |||
// ProjectCommand::List does not need to know which project we are in |
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.
Nice one 😍
@@ -366,7 +375,7 @@ impl Shuttle { | |||
if let Some(deployment) = summary.deployment { | |||
deployment.id | |||
} else { | |||
return Err(anyhow!("could not automatically find a running deployment for '{}'. Try passing a deployment ID manually", self.ctx.project_name())); | |||
bail!("Could not automatically find a running deployment for '{}'. Try passing a deployment ID manually", self.ctx.project_name()); |
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.
I can't quite remember, but doesn't return Err(...)
make the format of the error better by catching the Err
somewhere?
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.
From https://docs.rs/anyhow/latest/anyhow/macro.bail.html
This macro is equivalent to
return Err(anyhow!($args...))
.
I'd be surprised if that actually affected formatting 🧐
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.
Thanks, this was overdue! 🙏 We also need to update the instances where project new/rm
is documented in this repo (readme, contributing), as well as the docs. We can also do that if you don't have time, of course, but it might be a bit delayed.
shuttle-hq/shuttle-docs#62 @oddgrd Ready to merge |
Terrific, thanks @jonaro00! ❤️ |
Description of change
new/rm
tostart/stop
: Why? The "rm" implies that something is deleted, which confuses some. Other suggestions for names are accepted. "create/destroy" instead? recreate doesn't sound as good as restart :/cargo shuttle project restart
(stop+start), since this is and has been a very commonly recommended operation (We will save so many keystrokes in Discord 🤠)cargo shuttle project list
be run whether in a Cargo project or notHow Has This Been Tested (if applicable)?
Tested against production. The restart command works as expected from both running and stopped states.