feat: multi-value filters for bulk workflow run cancel#205
Open
CahidArda wants to merge 3 commits into
Open
Conversation
Add multi-value filter support to the bulk workflow-run cancel endpoint, mirroring the Workflow API change. A run matches if its value equals any of the given values (OR logic); separate filters are combined with AND logic. - `workflowUrl` and `workflowUrlStartingWith` now accept `string | string[]`. - `callerIp` and `flowControlKey` cancel filters now accept `string | string[]` (scoped to cancel via a dedicated `CancelUniversalFilterFields`; DLQ and logs filters remain single-value). - The workflowUrl translation helper handles array URLs. Tests added for multiple exact URLs, multiple prefix URLs, multi-value callerIp/flowControlKey, and multiple labels.
Widen the shared filter types so multi-value filtering (pass an array to match any value, OR semantics) is available on the workflow DLQ and logs endpoints too, not just bulk cancel: - `callerIp` and `flowControlKey` now accept `string | string[]` everywhere. - `workflowUrl` now accepts `string | string[]` on DLQ/logs filters. - Simplified the cancel filter types to reuse the now-widened shared base. Tests: - Live (real QStash): cancel by multiple workflowUrls (exact, OR), and logs filtered by multiple workflowUrls (OR, discriminating). - Mocked: DLQ list with multi-value workflowUrl/callerIp/flowControlKey serialized as repeated query params.
Verified against the live server that the workflow cancel and logs endpoints accept `host`/`path` filters (and discriminate correctly), while the DLQ endpoint rejects them — mirroring qstash. So `host`/`path` are added to the cancel and logs filter types (each supporting multiple values), and omitted from the DLQ type. Tests: - Live (real QStash): cancel by host/path (discriminating) and logs by host/path (discriminating). - Mocked: cancel with host[]/path serialized as repeated query params.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add multi-value filter support to the bulk workflow-run cancel endpoint, mirroring the Workflow API change. A run matches if its value equals any of the given values (OR logic); separate filters are combined with AND logic.
workflowUrlandworkflowUrlStartingWithnow acceptstring | string[].callerIpandflowControlKeycancel filters now acceptstring | string[](scoped to cancel via a dedicatedCancelUniversalFilterFields; DLQ and logs filters remain single-value).Tests added for multiple exact URLs, multiple prefix URLs, multi-value callerIp/flowControlKey, and multiple labels.