-
Notifications
You must be signed in to change notification settings - Fork 257
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(gateway): special error if own project is already running #1192
Conversation
The command `cargo shuttle project start` fails if a project with the same name is already present. The error message that's printed now tells the caller that their project is already running if they are the project owner. Fixes shuttle-hq#1155
My main concern is: What if the project is not in |
If we can limit the number of cases, I would prefer not to add any strings to |
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.
Alrighty, this will do fine as a first solution.
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.
LGTM, thanks for adding tests as well! 🤩 Regarding it being a few potential states, we could add "try running cargo shuttle project status" or something similar to the error message. We can merge this either way, though, let me know what you think!
Yes, until we know exactly what cases should be considered, I think a message of that sort would be best. I could add it to this PR later today. |
Cool, sounds good! |
How about "it looks like your project is already running. You can find out more with |
That sounds fine. |
I gathered that It seems to me that in If I am correct, we could make |
Yeah, that was roughly what I was thinking at first. A great task for a follow-up PR! 😃 |
Now, if `cargo shuttle project start` fails because the existing project is owned by the caller, the information from `cargo shuttle project status` is automatically displayed. Depending on the running state, different hints are provided. Extends shuttle-hq#1192
Now, if `cargo shuttle project start` fails because the existing project is owned by the caller, the information from `cargo shuttle project status` is automatically displayed. Depending on the running state, different hints are provided. Extends shuttle-hq#1192
* feat(gateway): inform project owner about running state Now, if `cargo shuttle project start` fails because the existing project is owned by the caller, the information from `cargo shuttle project status` is automatically displayed. Depending on the running state, different hints are provided. Extends #1192 * Improve PR #1194
Description of change
The command
cargo shuttle project start
fails if a project with the same name is already present. The error message that's printed now tells the caller that their project is already running if they are the project owner.Closes #1155
How has this been tested? (if applicable)
One assertion has been added to the relevant test for each new case. They make sure that the new error variant
ErrorKind::ProjectAlreadyRunning
is returned if either the owner or an admin tries to recreate a running project.