-
Notifications
You must be signed in to change notification settings - Fork 274
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
garden up
command + clean up syncs on exit
#4196
Conversation
When the `deploy` command is called with options that would put it into persistent operation, we now run it from inside the `dev` command. This brings a more full-featured interactive experience, and makes the UX more consistent.
This fixes an issue where some sync-related log lines would be duplicated (since they were rendered when the task for the relevant deploy action emitted a `ready` event).
We now stop any syncs started during a `dev` command session when exiting the command with CTRL-D or the `exit` command.
core/src/commands/dev.tsx
Outdated
@@ -156,7 +156,7 @@ Let's get your development environment wired up. | |||
})) | |||
|
|||
function quit() { | |||
cl?.disable("🌷 Thanks for stopping by, love you! ❤️") | |||
cl?.disable("🌷 Thanks for stopping by! ❤️") |
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.
💔
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 know : (
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.
💔
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.
wait why? 💔
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.
It was suggested that some users might find the old text too sugary.
I think it's fine myself.
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 dropped the commit with this change, we can decide later.
core/src/commands/dev.tsx
Outdated
function quitWithWarning() { | ||
log.warn(chalk.yellow(`Syncs started during this session may still be active when this command terminates. You can run ${chalk.white("garden sync stop '*'")} to stop all code syncs.`)) | ||
log.warn(chalk.yellow(`Hint: To stop code syncing on exit and allow Garden to exit gracefully, use ${chalk.white("Control-D")} or the ${chalk.white(`exit`)} command to exit ${chalk.white("garden dev")}.`)) | ||
quit() | ||
} |
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.
- ctrl-c still exits gracefully
- I think this should be a bit shorter and use
garden.emitwarning
to it can be muted - I think this should be a single line/message
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.
- ctrl-c still exits gracefully
It doesn't allow us enough time to guarantee that the syncs are turned off (it often is able to, but not always).
- I think this should be a bit shorter and use garden.emitwarning to it can be muted
- I think this should be a single line/message
Yeah, makes sense. I'll make those changes.
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.
How about now?
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.
Syncs started during this session may still be activ
Do we actually attempt to close them? I think it'd be cool if we didn't with ctr-c as that would allow to optionally keep them running.
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'd be open to having that discussion, but if there are no more comments I think we should merge this one (there are a lot of improvements and new things in there) and add any more tweaks in a follow-up PR.
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.
Thank you 👍
Co-authored by @edvald and @thsig.
See the commit messages for more details.
--cmd
option to thedev
command that executes the requested command (with the provided args & opts) at the start of the interactive session.--cmd
string result in multiple commands being run in thedev
command.garden deploy
command run inside thedev
command whenever it would be put into persistent operation.garden up
command that's an alias forgarden deploy --logs
.exit
or CTRL-D).dev
command with CTRL-C.