-
Notifications
You must be signed in to change notification settings - Fork 39
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(cli): Add 'deadline worker delete' command #598
base: mainline
Are you sure you want to change the base?
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 creating this PR! I just have the one comment about adding a prompt (and a way to automatically accept that prompt).
Additionally, to get the PR merged the github actions will have to pass. You'll notice that DCO and Semantic PR are failing. From the contributor guidelines we need you to sign your commit and have the message follow the conventional commit syntax. Here's how you can do that given some staged files:
git commit -s -m "feat(cli): add 'deadline worker delete' command"
@click.option("--worker-id", help="The worker to delete.", required=True) | ||
@_handle_error | ||
def worker_delete(fleet_id, worker_id, **args): |
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.
Similar to deadline cancel job
we should add a confirmation (defaults to no) and a --yes
option in here before a user performs a destructive action.
deadline-cloud/src/deadline/client/cli/_groups/job_group.py
Lines 156 to 162 in 25b809f
@click.option( | |
"--yes", | |
is_flag=True, | |
help="Skip any confirmation prompts", | |
) | |
@_handle_error | |
def job_cancel(mark_as: str, yes: bool, **args): |
Something like:
Deleting a worker will remove the resource and it will no longer be visible in the AWS Deadline Cloud service. Are you sure you wish to proceed?
Here's how the cancel commands prompts the user
deadline-cloud/src/deadline/client/cli/_groups/job_group.py
Lines 211 to 218 in 25b809f
# We explicitly require a yes/no response, as this is an operation that will interrupt the work in progress | |
# on their job. | |
if not click.confirm( | |
cancel_message, | |
default=None, | |
): | |
click.echo("Job not canceled.") | |
sys.exit(1) |
We can ignore adding the auto-accept for now. But we should change the help text for the option to say "confirms the deletion of the worker".
Thank you, I will fix PR |
Fixes:
What was the problem/requirement? (What/Why)
Customer wanted to delete a worker
What was the solution? (How)
Use deadline client API to delete a worker by id
What is the impact of this change?
Customer is happy
How was this change tested?
No testing required, just simple API call
Was this change documented?
Yes
Does this PR introduce new dependencies?
No
Is this a breaking change?
No, it is merely a change, just another API call
Does this change impact security?
No
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.