Extend Workflow Event Types filter functionality to filter Workflow Signaled events#1024
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR creates a separate history events group for workflow signals to improve filtering accuracy. Previously, the "Signal" filter incorrectly filtered for external workflow execution signals instead of workflow signals, which are more commonly filtered for.
- Create new
WorkflowSignaledevent group type for workflow signal events - Update filter mapping so "Signal" filters for workflow signals instead of external workflow signals
- Move external workflow signals to the "Workflow" category
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| workflow-history.types.ts | Adds new WorkflowSignaled group type and moves workflowExecutionSignaledEventAttributes from single events |
| workflow-history-filters-type.constants.ts | Updates filter mapping to use WorkflowSignaled for Signal filter |
| group-history-events.ts | Adds grouping logic for workflow signaled events |
| get-workflow-signaled-event-group-from-events.ts | Creates new group handler for workflow signaled events |
| get-single-event-group-from-events.ts | Removes workflow signaled event handling |
| is-workflow-signaled-event.ts | New type guard for workflow signaled events |
| is-single-event.ts | Removes workflow signaled event from single events list |
| Various test files | Updates tests to reflect new grouping structure |
| Various fixture files | Creates new fixtures and updates existing ones for workflow signaled events |
Comments suppressed due to low confidence (1)
src/views/workflow-history/workflow-history.types.ts:1
- The
HistoryEventGroupTypeunion type is missing the new'WorkflowSignaled'type that was added in theWorkflowSignaledEventHistoryGroupdefinition. This creates an inconsistency between the type definition and its usage.
import { type z } from 'zod';
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...kflow-history/helpers/check-history-event-group/__tests__/is-workflow-signaled-event.test.ts
Outdated
Show resolved
Hide resolved
|
@adhityamamallan Why are we changing the signal from a single event to a group ? |
|
Treating For example |
Unfortunately not; the filtering is effective only on groups (workflow-history.tsx#L175).
I agree. I initially had a separate filter value for it, but could not figure out what to call it, because having "Signal" and "External Workflow Signal" together is confusing. Any suggestions for what to call it? On another note, the "Workflow" group is a little problematic because we include all single events under it, regardless of what they are. And it's not entirely clear to users what they are, either. IMHO, the more clarity we bring to single events, the better, even if it means breaking the category up into different, more granular categories. |
|
I see that as problematic as the signals, so better solve it once than working around it. We have this method that should give the flexibility we need. Having a set of filter groups that have |
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/views/workflow-history/workflow-history-filters-type/workflow-history-filters-type.types.ts:13
- The 'DECISION' type is duplicated in the union type. Remove one of the duplicate entries.
| 'DECISION'
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/views/workflow-history/workflow-history-filters-type/workflow-history-filters-type.types.ts
Show resolved
Hide resolved
src/views/workflow-history/config/workflow-history-filters-type.config.ts
Outdated
Show resolved
Hide resolved
src/views/workflow-history/config/workflow-history-filters-type.config.ts
Show resolved
Hide resolved
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
…_tests__/is-workflow-signaled-event.test.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
6d2e605 to
f461005
Compare
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
| { attributes: 'cancelTimerFailedEventAttributes' }, | ||
| { attributes: 'markerRecordedEventAttributes' }, | ||
| { attributes: 'upsertWorkflowSearchAttributesEventAttributes' }, | ||
| { attributes: 'workflowExecutionSignaledEventAttributes' }, |
There was a problem hiding this comment.
This was unintentional because of the renaming, but I still think the new order makes more sense
Summary
The "Signal" value in the Workflow Event Types filter currently filters for ExternalWorkflowExecutionSignaled event groups. However, since filtering for workflow signals is much more common, it is easy to assume that the "Signal" value filters for those. This PR modifies the event filtering so that "Signal" actually filters for workflow signals.
Changes:
Test Plan
Added/updated unit tests + ran locally.