mmctl
mmctl copied to clipboard
Add subcommand for canceling export jobs
Summary
At the moment, the mattermost client already knows how to cancel a job, but mmctl
has no subcommands to expose this functionality and cancel an export job.
This PR adds a new subcommand mmctl export job cancel [export job id]
to cancel an export job.
Ticket Link
This PR is not resolving any open issues in Jira or GitHub. If necessary, I can create a GitHub issue to be able to link the PR to that.
Testing instructions
- Create a new export job
- Get the export job's ID
- Execute
mmctl export job cancel <ID>
First, the export job's state should be cancel_requested
, then it should switch to canceled
after some time.
Example
# Create and cancel the job
$ ./mmctl export create --attachments \
| awk -F": " '{print $2}' \
| xargs -n1 -I{} ./mmctl export job cancel "{}"
# Get job list again
$ ./mmctl export job list
ID: 59uow53d53f6byk5a4hbwg6y4c
Status: canceled
Created: 2022-09-20 08:21:55 +0200 CEST
ID: kw1kppccy7b7dnoqzdayh9q4jw
Status: success
Created: 2022-09-20 08:21:39 +0200 CEST
Started: 2022-09-20 08:21:40 +0200 CEST
Data: map[include_attachments:true]
Documentation
Although it was not completely necessary to update the mmctl export job show
subcommand's example usage, I did it to have a more consistent documentation.
Hello @gabor-boros,
Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.
This PR has been automatically labelled "stale" because it hasn't had recent activity. A core team member will check in on the status of the PR to help with questions. Thank you for your contribution!
/update-branch
@isacikgoz Thank you for your review! Your observations are addressed as part of 65daf40. Could you please do another round of review?
Also, could you please guide me on how I could help out at https://github.com/mattermost/mattermost-server/pull/21049 to get it merged? 😇
/update-branch
@gabor-boros can you update the docs with make docs
command? The CI is failing due to that error.
Ah, sure @isacikgoz. Give me a day or two. 😌
FYI: @isacikgoz updated