File tree Expand file tree Collapse file tree 4 files changed +32
-0
lines changed
utils/config/__fixtures__ Expand file tree Collapse file tree 4 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import { type ClustersConfigs } from './resolvers/clusters.types';
1414import cronListEnabled from './resolvers/cron-list-enabled' ;
1515import extendedDomainInfoEnabled from './resolvers/extended-domain-info-enabled' ;
1616import { type ExtendedDomainInfoEnabledConfig } from './resolvers/extended-domain-info-enabled.types' ;
17+ import failoverHistoryEnabled from './resolvers/failover-history-enabled' ;
1718import workflowActionsEnabled from './resolvers/workflow-actions-enabled' ;
1819import {
1920 type WorkflowActionsEnabledResolverParams ,
@@ -65,6 +66,12 @@ const dynamicConfigs: {
6566 'request' ,
6667 true
6768 > ;
69+ FAILOVER_HISTORY_ENABLED : ConfigAsyncResolverDefinition <
70+ undefined ,
71+ boolean ,
72+ 'request' ,
73+ true
74+ > ;
6875} = {
6976 CADENCE_WEB_PORT : {
7077 env : 'CADENCE_WEB_PORT' ,
@@ -109,6 +116,11 @@ const dynamicConfigs: {
109116 evaluateOn : 'request' ,
110117 isPublic : true ,
111118 } ,
119+ FAILOVER_HISTORY_ENABLED : {
120+ resolver : failoverHistoryEnabled ,
121+ evaluateOn : 'request' ,
122+ isPublic : true ,
123+ } ,
112124} as const ;
113125
114126export default dynamicConfigs ;
Original file line number Diff line number Diff line change 1+ /**
2+ * WIP: Returns whether failover history APIs and UI are enabled.
3+ *
4+ * To enable the failover history tab, set the CADENCE_FAILOVER_HISTORY_ENABLED env variable to true.
5+ * For further customization, override the implementation of this resolver.
6+ *
7+ * Server version behaviour:
8+ * - > 1.3.6 (still hasn't been released yet): The Failover History API will work as expected.
9+ * - <= 1.3.6: The Failover History API will return a GRPC unimplemented error (maps to HTTP 404 in the client).
10+ *
11+ * @returns {Promise<boolean> } Whether failover history UI is enabled.
12+ */
13+ export default async function failoverHistoryEnabled ( ) : Promise < boolean > {
14+ return process . env . CADENCE_FAILOVER_HISTORY_ENABLED === 'true' ;
15+ }
Original file line number Diff line number Diff line change @@ -63,6 +63,10 @@ const resolverSchemas: ResolverSchemas = {
6363 args : z . undefined ( ) ,
6464 returnType : z . boolean ( ) ,
6565 } ,
66+ FAILOVER_HISTORY_ENABLED : {
67+ args : z . undefined ( ) ,
68+ returnType : z . boolean ( ) ,
69+ } ,
6670} ;
6771
6872export default resolverSchemas ;
Original file line number Diff line number Diff line change @@ -42,5 +42,6 @@ const mockResolvedConfigValues: LoadedConfigResolvedValues = {
4242 } ,
4343 WORKFLOW_DIAGNOSTICS_ENABLED : false ,
4444 ARCHIVAL_DEFAULT_SEARCH_ENABLED : false ,
45+ FAILOVER_HISTORY_ENABLED : false ,
4546} ;
4647export default mockResolvedConfigValues ;
You can’t perform that action at this time.
0 commit comments