Skip to content

Conversation

@saifxyzyz
Copy link

@saifxyzyz saifxyzyz commented Jan 4, 2026

This PR adds batch delete functionality to the cli
partially closes #19904

  • Before:
prefect flow-run delete 8d38609e-0a80-4045-bfb1-8f3c07e5cf55
prefect flow-run delete 3b7ce29f-64cf-4d1b-ad16-cff9cac1ce61
prefect flow-run delete ecfbecf9-4841-4320-980f-3405bc11b398
prefect flow-run delete 1b230e8e-69e9-4db0-b169-838a00d74db6
  • After:
prefect flow-run delete 8d38609e-0a80-4045-bfb1-8f3c07e5cf55 3b7ce29f-64cf-4d1b-ad16-cff9cac1ce61 ecfbecf9-4841-4320-980f-3405bc11b398 1b230e8e-69e9-4db0-b169-838a00d74db6

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.
  • If this pull request adds new functionality, it includes unit tests that cover the changes

@github-actions github-actions bot added cli Related to the Prefect CLI enhancement An improvement of an existing feature labels Jan 4, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 4, 2026

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing saifxyzyz:fix-batchdelete (ec387ca) with main (06750f7)

Open in CodSpeed

@zzstoatzz
Copy link
Collaborator

hi @saifxyzyz - thanks for the PR, i think we'd need to clean up the static analysis failures and add test coverage for this change: https://docs.prefect.io/contribute/dev-contribute

let me know if you have any trouble with this!

@saifxyzyz
Copy link
Author

Hey @zzstoatzz , I've taken care of the static analysis failure and added tests

Copy link
Collaborator

@zzstoatzz zzstoatzz left a comment

Choose a reason for hiding this comment

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

Hey @saifxyzyz — thanks for the PR and for addressing the earlier feedback

one behavior change I’m a little concerned about: flow-run delete now appears to exit 0 even when some/all requested IDs fail. that’s a departure from existing CLI delete semantics (single delete exits non‑zero when not found; bulk delete ops elsewhere tend to abort on failure). i’d suggest keeping the best‑effort deletes but returning a non‑zero exit code if any deletions fail (while still printing the per‑ID summary), preserving scriptability without losing the new UX. if you’re good with that direction, we should update the tests accordingly.

related UX nit: for the single‑ID case, it could still show the ID in the confirmation prompt.

@saifxyzyz
Copy link
Author

on it

@saifxyzyz
Copy link
Author

PTAL @zzstoatzz I've made the requested changes

@saifxyzyz saifxyzyz requested a review from zzstoatzz January 10, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the Prefect CLI enhancement An improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add batch delete support for flow runs

2 participants