Skip to content

Conversation

peytonrunyan
Copy link
Contributor

@peytonrunyan peytonrunyan commented Nov 22, 2022

This pull request adds the command prefect flow-run cancel <run_id>.

This CLI command will change the state.StateType of a given flow run to CANCELLED and the state name to Cancelling if possible, and otherwise will exit with error saying that it could not be cancelled. If it could not cancel, it will provide the reason from the abort status.

There is also a change in the orion client, which changes set_flow_run_state to raise ObjectNotFound if we get a 404. This brings it in-line with the behavior of the rest of the functions in the orion client. A test has been added for this.

Example

Screen Shot 2022-11-22 at 2 25 12 PM

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • This pull request includes tests or only affects documentation.
  • This pull request includes a label categorizing the change e.g. fix, feature, enhancement

@peytonrunyan peytonrunyan added enhancement An improvement of an existing feature v2 labels Nov 22, 2022
@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for prefect-orion ready!

Name Link
🔨 Latest commit e4c74d5
🔍 Latest deploy log https://app.netlify.com/sites/prefect-orion/deploys/637d2de6bb58cc000823dc14
😎 Deploy Preview https://deploy-preview-7629--prefect-orion.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@peytonrunyan peytonrunyan marked this pull request as ready for review November 22, 2022 20:15
@peytonrunyan peytonrunyan requested a review from zanieb as a code owner November 22, 2022 20:15
@zanieb
Copy link
Contributor

zanieb commented Nov 22, 2022

We probably shouldn't merge this until cancellation is available.

@peytonrunyan peytonrunyan changed the base branch from main to feature/flow-run-cancellation November 22, 2022 20:31
Copy link
Contributor

@bunchesofdonald bunchesofdonald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!

@peytonrunyan peytonrunyan merged commit e2bbe58 into feature/flow-run-cancellation Nov 22, 2022
@peytonrunyan peytonrunyan deleted the kill-cli branch November 22, 2022 21:47
zanieb pushed a commit that referenced this pull request Nov 30, 2022
zanieb pushed a commit that referenced this pull request Nov 30, 2022
zanieb pushed a commit that referenced this pull request Nov 30, 2022
zanieb pushed a commit that referenced this pull request Nov 30, 2022
zanieb pushed a commit that referenced this pull request Dec 1, 2022
zanieb pushed a commit that referenced this pull request Dec 1, 2022
github-actions bot pushed a commit that referenced this pull request Dec 1, 2022
github-actions bot pushed a commit to ddelange/prefect that referenced this pull request Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants