Skip to content

Commit 68394a8

Browse files
Add flag for History Page v2 (#1081)
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
1 parent 945e9bf commit 68394a8

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

src/config/dynamic/dynamic.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import cronListEnabled from './resolvers/cron-list-enabled';
1515
import extendedDomainInfoEnabled from './resolvers/extended-domain-info-enabled';
1616
import { type ExtendedDomainInfoEnabledConfig } from './resolvers/extended-domain-info-enabled.types';
1717
import failoverHistoryEnabled from './resolvers/failover-history-enabled';
18+
import historyPageV2Enabled from './resolvers/history-page-v2-enabled';
1819
import workflowActionsEnabled from './resolvers/workflow-actions-enabled';
1920
import {
2021
type WorkflowActionsEnabledResolverParams,
@@ -72,6 +73,12 @@ const dynamicConfigs: {
7273
'request',
7374
true
7475
>;
76+
HISTORY_PAGE_V2_ENABLED: ConfigAsyncResolverDefinition<
77+
undefined,
78+
boolean,
79+
'request',
80+
true
81+
>;
7582
} = {
7683
CADENCE_WEB_PORT: {
7784
env: 'CADENCE_WEB_PORT',
@@ -121,6 +128,11 @@ const dynamicConfigs: {
121128
evaluateOn: 'request',
122129
isPublic: true,
123130
},
131+
HISTORY_PAGE_V2_ENABLED: {
132+
resolver: historyPageV2Enabled,
133+
evaluateOn: 'request',
134+
isPublic: true,
135+
},
124136
} as const;
125137

126138
export default dynamicConfigs;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* WIP: Returns whether the new Workflow History (V2) page is enabled
3+
*
4+
* To enable the new Workflow History (V2) page, set the CADENCE_HISTORY_PAGE_V2_ENABLED env variable to true.
5+
* For further customization, override the implementation of this resolver.
6+
*
7+
* @returns {Promise<boolean>} Whether Workflow History (V2) page is enabled.
8+
*/
9+
export default async function historyPageV2Enabled(): Promise<boolean> {
10+
return process.env.CADENCE_HISTORY_PAGE_V2_ENABLED === 'true';
11+
}

src/config/dynamic/resolvers/schemas/resolver-schemas.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ const resolverSchemas: ResolverSchemas = {
6767
args: z.undefined(),
6868
returnType: z.boolean(),
6969
},
70+
HISTORY_PAGE_V2_ENABLED: {
71+
args: z.undefined(),
72+
returnType: z.boolean(),
73+
},
7074
};
7175

7276
export default resolverSchemas;

src/utils/config/__fixtures__/resolved-config-values.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,6 @@ const mockResolvedConfigValues: LoadedConfigResolvedValues = {
4343
WORKFLOW_DIAGNOSTICS_ENABLED: false,
4444
ARCHIVAL_DEFAULT_SEARCH_ENABLED: false,
4545
FAILOVER_HISTORY_ENABLED: false,
46+
HISTORY_PAGE_V2_ENABLED: false,
4647
};
4748
export default mockResolvedConfigValues;

0 commit comments

Comments
 (0)