-
Notifications
You must be signed in to change notification settings - Fork 2k
Add bulk delete endpoint for flow runs #19232
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
base: main
Are you sure you want to change the base?
Conversation
adds a bulk delete endpoint for flow runs using the same filter used by the `POST /filter` read endpoint
### key features
- **filter-based deletion**: uses the standard `FlowRunFilter` for maximum flexibility - delete by IDs, states, tags, or any criteria
- **batch processing**: processes flow runs efficiently with proper resource cleanup
- **background log cleanup**: schedules log deletion as background tasks to avoid blocking the response
### api
- **endpoint**: `POST /flow_runs/bulk_delete`
- **request body**:
- `flow_runs`: standard `FlowRunFilter` object (e.g., `{"id": {"any_": [id1, id2]}}`)
- `limit`: maximum number of flow runs to delete (1-200, default: 200)
- **response**: `FlowRunBulkDeleteResponse` with deleted flow run IDs
### implementation
- reuses existing `FlowRunFilter` schema - the same filter used for querying flow runs
- uses hard deletion (unlike cloud's soft deletion)
- properly handles concurrency slot cleanup
- background tasks handle log deletion
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
CodSpeed Performance ReportMerging #19232 will not alter performanceComparing Summary
|
- test_bulk_delete_by_ids: Tests deletion by specific flow run IDs - test_bulk_delete_by_tags: Tests deletion by tag filtering - test_bulk_delete_limit: Tests that the limit parameter is enforced - test_bulk_delete_validation: Tests parameter validation - test_bulk_delete_with_concurrency_slots: Tests concurrency slot cleanup All tests pass ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Test Results ✅Added comprehensive test coverage for the bulk delete endpoint: Test Coverage
Manual TestingAlso created and ran All tests pass: |
Following project convention - test fixtures don't have type hints 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
This pull request is stale because it has been open 14 days with no activity. To keep this pull request open remove stale label or comment. |
summary
this PR adds a bulk delete endpoint for flow runs
key features
FlowRunFilterfor maximum flexibility - delete by IDs, states, tags, or any criteriaapi
POST /flow_runs/bulk_deleteflow_runs: standardFlowRunFilterobject (e.g.,{"id": {"any_": [id1, id2]}})limit: maximum number of flow runs to delete (1-200, default: 200)FlowRunBulkDeleteResponsewith deleted flow run IDsimplementation details
processing logic
FlowRunFilterschema - the same filter used for querying flow runs🤖 Generated with Claude Code