Skip to content

feat: Failover History table#1076

Merged
adhityamamallan merged 6 commits intocadence-workflow:masterfrom
adhityamamallan:failover-table
Nov 14, 2025
Merged

feat: Failover History table#1076
adhityamamallan merged 6 commits intocadence-workflow:masterfrom
adhityamamallan:failover-table

Conversation

@adhityamamallan
Copy link
Member

Summary

Add table to display failover history of a domain, with support for both active-passive and active-active domains

Test plan

Unit tests + ran locally.

Active-Passive Domain

Screenshot 2025-11-13 at 13 50 13

Active-Active Domain

No cluster attribute in filters

Screenshot 2025-11-13 at 13 49 42

Only primary cluster failovers

Screenshot 2025-11-13 at 13 48 51

With cluster attribute in filters

Screenshot 2025-11-13 at 13 49 20

Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a failover history table feature for domain pages with support for both active-passive and active-active domain configurations. The implementation includes filtering capabilities based on cluster attributes for active-active domains.

  • Adds a new DomainPageFailovers component that displays failover events in a table format
  • Implements specialized rendering for active-active domains with cluster attribute filtering
  • Introduces query parameters to manage cluster attribute scope and value filters

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
domain-page-failovers/domain-page-failovers.tsx Main component that renders the failover history table with conditional config based on domain type
domain-page-failovers/domain-page-failovers.styles.ts Styling for the failover table container
domain-page-failovers/__tests__/domain-page-failovers.test.tsx Comprehensive unit tests covering table rendering and domain type variations
domain-page-failover-single-cluster/domain-page-failover-single-cluster.tsx Reusable component to display cluster failover transitions with arrow icon
domain-page-failover-single-cluster/domain-page-failover-single-cluster.styles.ts Styling for single cluster failover display
domain-page-failover-single-cluster/__tests__/domain-page-failover-single-cluster.test.tsx Tests for single cluster failover component edge cases
domain-page-failover-active-active/domain-page-failover-active-active.tsx Active-active specific component with cluster attribute filtering and "See more" action
domain-page-failover-active-active/domain-page-failover-active-active.styles.ts Styling for active-active failover display
domain-page-failover-active-active/__tests__/domain-page-failover-active-active.test.tsx Extensive tests covering various cluster attribute matching scenarios
config/domain-page-query-params.config.ts Adds clusterAttributeScope and clusterAttributeValue query parameters
config/domain-page-failovers-table.config.ts Table column configuration for active-passive domains
config/domain-page-failovers-table-active-active.config.ts Table column configuration for active-active domains, reusing base config
__fixtures__/domain-page-query-params.ts Updates mock values to include new cluster attribute query params

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…g.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
}
/>
</styled.FailoversTableContainer>
);
Copy link
Member

Choose a reason for hiding this comment

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

A few callouts.

  • The screenshots in the PR summary are helpful. Even better if we had ubook / storybook so that visual snapshots become part of the source code and CI.
  • For example, there's some guesswork for me regarding the two columns variants.
  • And I trust that shouldShowResults behaves correctly because Table is battle-tested. With uBook, it'd be great to see the full lifecycle of this component. I can share Flipr examples if that'd help.

Comment on lines +34 to +67
jest.mock('../../config/domain-page-failovers-table.config', () => [
{
name: 'Failover ID',
id: 'failoverId',
width: '35%',
renderCell: (event: FailoverEvent) => <div>{event.id}</div>,
},
{
name: 'Time',
id: 'time',
width: '15%',
renderCell: (event: FailoverEvent) => (
<div>{event.createdTime?.seconds || 'No date'}</div>
),
},
{
name: 'Type',
id: 'type',
width: '10%',
renderCell: (event: FailoverEvent) => <div>{event.failoverType}</div>,
},
{
name: 'Failover Information',
id: 'failoverInfo',
width: '40%',
renderCell: (event: FailoverEvent) => (
<div>
{event.clusterFailovers[0]?.fromCluster?.activeClusterName}
{` -> `}
{event.clusterFailovers[0]?.toCluster?.activeClusterName}
</div>
),
},
]);
Copy link
Member

Choose a reason for hiding this comment

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

For my understanding...

I wonder how the jest.mock for domain-page-failovers-table.config helps? Maybe because virtualization / infinite-scroll is not well supported in Jest-mode? The current approach risks drift and false-negatives (a test passes but actually misbehaves).

Copy link
Member Author

@adhityamamallan adhityamamallan Nov 14, 2025

Choose a reason for hiding this comment

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

In essence, we want to isolate changes to the config from the unit tests themselves, to stick to the idea that unit tests are for a single file, and to prevent changes to the config from breaking unit tests.

The current approach risks drift and false-negatives

Agreed, ideally this should be solved through integration tests

@adhityamamallan adhityamamallan merged commit 682502f into cadence-workflow:master Nov 14, 2025
5 checks passed
Assem-Uber pushed a commit to Assem-Uber/cadence-web that referenced this pull request Nov 19, 2025
* Add table to display failover history of a domain, with support for both active-passive and active-active domains

Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Assem-Uber added a commit that referenced this pull request Nov 24, 2025
* Create fetcher utility

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* rename query

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* Create hook for fetching history

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* add configurable throttleMs to the hook

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* use fetcher in workflow history

* remove useKeepLoadingEvents

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* grouping utility

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* update test cases

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* change the api of onChange and add destroy method

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* replace getGroups with getState

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* init grouper hook

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* user grouper in history

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* update fetcher based on feedback

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* rename unmout to destroy

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* Create hook for fetching history

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* move condition into executeImmediately

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* update destroy in method

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* mock grouper throttle

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* fix use fetcher test case

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* feat: Grouped events table header (#1059)

* Grouped events header

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* add test cases

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* fix comment typo

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* add space for reset button

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* move grouped table

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* Update src/views/workflow-history-v2/workflow-history-grouped-table/workflow-history-grouped-table.tsx

Co-authored-by: Adhitya Mamallan <adi1998is@gmail.com>

* Change Id to ID

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

---------

Signed-off-by: Assem Hafez <assem.hafez@uber.com>
Co-authored-by: Adhitya Mamallan <adi1998is@gmail.com>

* chore: Fixed docker URI for kafka image (#1066)

Signed-off-by: Tim Chan <tim.chan@uber.com>

* chore: New feature flag for Cron List View (#1068)

Signed-off-by: Tim Chan <tim.chan@uber.com>

* use fetcher in workflow history

* fix content clicks

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* fix use initial selected event

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* increase page size

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* optimize first page processing

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* fix test cases

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* fix: History content negative z-index disallow clicks (#1069)

* fix content clicks

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* Update src/views/workflow-history/workflow-history.styles.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Signed-off-by: Assem Hafez <assem.hafez@uber.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* feat: Use fetcher in workflow history (#1064)

* Create fetcher utility

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* rename query

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* Create hook for fetching history

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* add configurable throttleMs to the hook

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* use fetcher in workflow history

* remove useKeepLoadingEvents

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* update fetcher based on feedback

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* rename unmout to destroy

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* Create hook for fetching history

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* move condition into executeImmediately

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* update destroy in method

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* fix type error with query params

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

---------

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* fix: Autocomplete for bool values (#1072)

Fix workflows query autocomplete to suggest the correct tokens for boolean values

Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>

* Add feature flag for Failover History (#1070)

Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>

* Add failover history tab (#1071)

Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>

* chore: Added ts-node to dev-deps (#1074)

Signed-off-by: Tim Chan <tim.chan@uber.com>

* feat: Hook to fetch & filter Failover History of a domain (#1075)

Add hook for fetching and filtering failover history
Add helper function to check if a ClusterFailover matches a given cluster attribute
Add some types/constants for domain page failovers

Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>

* feat: New Cron Tab (#1078)

Signed-off-by: Tim Chan <tim.chan@uber.com>

* feat: Failover History table (#1076)

* Add table to display failover history of a domain, with support for both active-passive and active-active domains

Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* chore: Fix console.error pollution (#1077)

* chore: Fix console.error pollution

Signed-off-by: Tim Chan <tim.chan@uber.com>

* Relocated to src/test-utils.

Signed-off-by: Tim Chan <tim.chan@uber.com>

---------

Signed-off-by: Tim Chan <tim.chan@uber.com>

* Add flag for History Page v2 (#1081)

Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>

* feat: Filters for Failover History Table (#1079)

Add filters for Failover History table, but only for active-active domains
Create filter for Cluster Attribute Scope, which depends on domain description to suggest possible scopes
Create filter for Cluster Attribute Value, which depends on selected scope to suggest possible values/names
Remove (now) unused styles file from DomainPageFailovers

Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>

* feat: Create a grouping utility that only parses new events (#1065)

* grouping utility

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* update test cases

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* change the api of onChange and add destroy method

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* replace getGroups with getState

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* call onchange after updating pending events

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* use sync processBatch for first page

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* Update src/views/workflow-history/helpers/workflow-history-grouper.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply PR comments

* Update src/views/workflow-history/helpers/workflow-history-grouper.types.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Signed-off-by: Assem Hafez <assem.hafez@uber.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* feat: Add modal to view full failover event (#1080)

* Add modal for viewing an individual failover event, which is shown when "See more" in the table is clicked

Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>

* feat: New components for Workflow History V2 (#1082)

* Add new Workflow History V2 root component, which (for now) renders only a placeholder header component and placeholder tables.
* Implement Workflow History Header with basic UI and sticky functionality
* Add logic in WorkflowHistoryWrapper to render V2 UI based on feature flag

Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>

* update test cases

* hook for history grouper

* remove comments

* fetcher updates

* add placeholder for fetcher

* update fetcher mock

* fetcher start update

* update todo

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix copilot comments

* remove extra comment

* lint fix

* change lastFlattented initial value to -1

* remove unused import

* address comments

---------

Signed-off-by: Assem Hafez <assem.hafez@uber.com>
Signed-off-by: Tim Chan <tim.chan@uber.com>
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Co-authored-by: Adhitya Mamallan <adi1998is@gmail.com>
Co-authored-by: Tim Chan <timothyc@alum.mit.edu>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants