Skip to content

Commit a1da5f1

Browse files
authored
Add feature flag for archival default search (#989)
1 parent 8f9e44e commit a1da5f1

File tree

5 files changed

+29
-4
lines changed

5 files changed

+29
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ CADENCE_CLUSTERS_NAMES=cluster0,cluster1
3636

3737
Feature flags control various UI features and functionality in `cadence-web`. These can be configured using environment variables.
3838

39-
| Feature | Description | Environment Variable Configuration | Minimum Cadence server Version |
40-
|---------|-------------|---------------------|------------------------|
41-
| Extended Domain Information | Enhanced domain metadata display and help menu UI | `CADENCE_EXTENDED_DOMAIN_INFO_METADATA_ENABLED=true` | N/A |
42-
| Workflow Diagnostics | Workflow diagnostics APIs and UI for debugging workflows | `CADENCE_WORKFLOW_DIAGNOSTICS_ENABLED=true` | 1.2.13+ (1.3.1+ for full functionality) |
39+
| Feature | Description | Environment Variable Configuration | Minimum Cadence server Version |
40+
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | --------------------------------------- |
41+
| Extended Domain Information | Enhanced domain metadata display and help menu UI | `CADENCE_EXTENDED_DOMAIN_INFO_METADATA_ENABLED=true` | N/A |
42+
| Workflow Diagnostics | Workflow diagnostics APIs and UI for debugging workflows | `CADENCE_WORKFLOW_DIAGNOSTICS_ENABLED=true` | 1.2.13+ (1.3.1+ for full functionality) |
43+
| Enable Default Archival Search | Shows the default workflow search input + query input for archival workflows page. Default search is disabled by default as it doesn't work well with S3 implementation | `CADENCE_ARCHIVAL_DEFAULT_SEARCH_ENABLED=true` | N/A |
44+
4345

4446
**Note:** For advanced customization, feature flags can be modified through resolvers in the dynamic config system ([`src/config/dynamic/resolvers`](src/config/dynamic/resolvers)).
4547

src/config/dynamic/dynamic.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type {
66
ConfigSyncResolverDefinition,
77
} from '../../utils/config/config.types';
88

9+
import archivalDefaultSearchEnabled from './resolvers/archival-default-search-enabled';
910
import clusters from './resolvers/clusters';
1011
import clustersPublic from './resolvers/clusters-public';
1112
import { type PublicClustersConfigs } from './resolvers/clusters-public.types';
@@ -51,6 +52,12 @@ const dynamicConfigs: {
5152
'request',
5253
true
5354
>;
55+
ARCHIVAL_DEFAULT_SEARCH_ENABLED: ConfigAsyncResolverDefinition<
56+
undefined,
57+
boolean,
58+
'request',
59+
true
60+
>;
5461
} = {
5562
CADENCE_WEB_PORT: {
5663
env: 'CADENCE_WEB_PORT',
@@ -85,6 +92,11 @@ const dynamicConfigs: {
8592
evaluateOn: 'request',
8693
isPublic: true,
8794
},
95+
ARCHIVAL_DEFAULT_SEARCH_ENABLED: {
96+
resolver: archivalDefaultSearchEnabled,
97+
evaluateOn: 'request',
98+
isPublic: true,
99+
},
88100
} as const;
89101

90102
export default dynamicConfigs;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default async function archivalDefaultSearchEnabled(): Promise<boolean> {
2+
const enabled =
3+
process.env.CADENCE_ARCHIVAL_DEFAULT_SEARCH_ENABLED === 'true';
4+
5+
return enabled;
6+
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ const resolverSchemas: ResolverSchemas = {
5454
args: z.undefined(),
5555
returnType: z.boolean(),
5656
},
57+
ARCHIVAL_DEFAULT_SEARCH_ENABLED: {
58+
args: z.undefined(),
59+
returnType: z.boolean(),
60+
},
5761
};
5862

5963
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
@@ -39,5 +39,6 @@ const mockResolvedConfigValues: LoadedConfigResolvedValues = {
3939
issues: false,
4040
},
4141
WORKFLOW_DIAGNOSTICS_ENABLED: false,
42+
ARCHIVAL_DEFAULT_SEARCH_ENABLED: false,
4243
};
4344
export default mockResolvedConfigValues;

0 commit comments

Comments
 (0)