Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is an attempt of providing gp-cli with a task restart functionality.
Restarting a task can be challenging and this PR is intentionally "lightweight" to get early feedback on the approach.
What I am doing here is leveraging the
/terminal/alias/write
endpoint of supervisor api. Once I know which task needs to be restart, I "re-write" those commands in the task terminal. It seems to work, but I've only briefly tested and I am concerned of side-effects of re-using the existing terminal (e.g. terminal session related things).Ideally, we would shutdown the terminal, create a new one, set a title for it and write those commands. However, I didn't see an API endpoint for supervisor to create a new terminal. I've definitely seen capability in the supervisor-cli (
supervisor terminal new
) so perhaps it's easy to expose such endpoint.Related Issue(s)
Fixes #8691
How to test
Release Notes
Documentation