From ca51649b1aeee34471c617c9aecdd071d8a278b5 Mon Sep 17 00:00:00 2001 From: Tim Li Date: Tue, 25 Nov 2025 10:42:20 -0800 Subject: [PATCH 1/5] Add ClusterAttributeScope and ClusterAttributeName to visibility query suggestions Signed-off-by: Tim Li --- .../get-search-attributes/get-search-attributes.constants.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/route-handlers/get-search-attributes/get-search-attributes.constants.ts b/src/route-handlers/get-search-attributes/get-search-attributes.constants.ts index 9f169f218..a2cdfdee3 100644 --- a/src/route-handlers/get-search-attributes/get-search-attributes.constants.ts +++ b/src/route-handlers/get-search-attributes/get-search-attributes.constants.ts @@ -17,4 +17,6 @@ export const SYSTEM_SEARCH_ATTRIBUTES: Set = new Set([ 'IsCron', 'NumClusters', 'UpdateTime', + 'ClusterAttributeScope', + 'ClusterAttributeName', ]); From a1c9bf85a913136526ebf2d08c5ce7ed307ed4bd Mon Sep 17 00:00:00 2001 From: Tim Li Date: Tue, 25 Nov 2025 10:46:34 -0800 Subject: [PATCH 2/5] minor Signed-off-by: Tim Li --- .../workflows-query-input/workflows-query-input.constants.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/views/shared/workflows-header/workflows-query-input/workflows-query-input.constants.ts b/src/views/shared/workflows-header/workflows-query-input/workflows-query-input.constants.ts index 1267aa627..9c9e47c79 100644 --- a/src/views/shared/workflows-header/workflows-query-input/workflows-query-input.constants.ts +++ b/src/views/shared/workflows-header/workflows-query-input/workflows-query-input.constants.ts @@ -12,6 +12,8 @@ export const ID_ATTRIBUTES = [ 'RolloutID', 'RunID', 'TaskList', + 'ClusterAttributeScope', + 'ClusterAttributeName', ]; export const CLOSE_STATUS_ATTRIBUTE = 'CloseStatus'; From 40b2853596cae9f2cb7c51efb80084aedce9afce Mon Sep 17 00:00:00 2001 From: Tim Li Date: Tue, 25 Nov 2025 11:02:41 -0800 Subject: [PATCH 3/5] fix test Signed-off-by: Tim Li --- .../helpers/__tests__/get-autocomplete-suggestions.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/shared/workflows-header/workflows-query-input/helpers/__tests__/get-autocomplete-suggestions.test.ts b/src/views/shared/workflows-header/workflows-query-input/helpers/__tests__/get-autocomplete-suggestions.test.ts index 2b44b4fd0..ddfc20bd3 100644 --- a/src/views/shared/workflows-header/workflows-query-input/helpers/__tests__/get-autocomplete-suggestions.test.ts +++ b/src/views/shared/workflows-header/workflows-query-input/helpers/__tests__/get-autocomplete-suggestions.test.ts @@ -23,7 +23,7 @@ describe('getAutocompleteSuggestions', () => { const suggestionsAfterSpace = getAutocompleteSuggestions( 'WorkflowID = "test" AND c' ); - expect(suggestionsAfterSpace).toEqual(['CloseTime', 'CloseStatus']); + expect(suggestionsAfterSpace).toEqual(['CloseTime', 'ClusterAttributeScope', 'ClusterAttributeName', 'CloseStatus']); }); it('suggests logical operators after a complete WorkflowID value', () => { @@ -116,6 +116,6 @@ describe('getAutocompleteSuggestions', () => { const complexQuery = 'WorkflowID = "test" AND StartTime >= "2023-01-01T00:00:00Z" AND c'; const suggestions = getAutocompleteSuggestions(complexQuery); - expect(suggestions).toEqual(['CloseTime', 'CloseStatus']); + expect(suggestions).toEqual(['CloseTime', 'ClusterAttributeScope', 'ClusterAttributeName', 'CloseStatus']); }); }); From 4a7dca509b95150c288e305726a8e54971102c26 Mon Sep 17 00:00:00 2001 From: Tim Li Date: Tue, 25 Nov 2025 11:30:34 -0800 Subject: [PATCH 4/5] fix lint and more test Signed-off-by: Tim Li --- .../get-autocomplete-suggestions.test.ts | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/views/shared/workflows-header/workflows-query-input/helpers/__tests__/get-autocomplete-suggestions.test.ts b/src/views/shared/workflows-header/workflows-query-input/helpers/__tests__/get-autocomplete-suggestions.test.ts index ddfc20bd3..4f4d05cbb 100644 --- a/src/views/shared/workflows-header/workflows-query-input/helpers/__tests__/get-autocomplete-suggestions.test.ts +++ b/src/views/shared/workflows-header/workflows-query-input/helpers/__tests__/get-autocomplete-suggestions.test.ts @@ -23,7 +23,12 @@ describe('getAutocompleteSuggestions', () => { const suggestionsAfterSpace = getAutocompleteSuggestions( 'WorkflowID = "test" AND c' ); - expect(suggestionsAfterSpace).toEqual(['CloseTime', 'ClusterAttributeScope', 'ClusterAttributeName', 'CloseStatus']); + expect(suggestionsAfterSpace).toEqual([ + 'CloseTime', + 'ClusterAttributeScope', + 'ClusterAttributeName', + 'CloseStatus', + ]); }); it('suggests logical operators after a complete WorkflowID value', () => { @@ -67,6 +72,16 @@ describe('getAutocompleteSuggestions', () => { expect(suggestionsRunID).toEqual(['""']); }); + it('suggests empty quotes after ClusterAttributeScope', () => { + const suggestions = getAutocompleteSuggestions('ClusterAttributeScope ='); + expect(suggestions).toEqual(['""']); + }); + + it('suggests empty quotes after ClusterAttributeName', () => { + const suggestions = getAutocompleteSuggestions('ClusterAttributeName !='); + expect(suggestions).toEqual(['""']); + }); + it('suggests status values after CloseStatus', () => { const suggestions = getAutocompleteSuggestions('CloseStatus ='); expect(suggestions).toEqual(STATUSES); @@ -105,6 +120,12 @@ describe('getAutocompleteSuggestions', () => { expect(suggestionsCase).toContain('CloseTime'); }); + it('handles partial attribute matching for Cluster attributes', () => { + const suggestions = getAutocompleteSuggestions('Cluster'); + expect(suggestions).toContain('ClusterAttributeScope'); + expect(suggestions).toContain('ClusterAttributeName'); + }); + it('suggests logical operators after complete complex query', () => { const complexQuery = 'WorkflowID = "test" AND StartTime >= "2023-01-01T00:00:00Z"'; @@ -116,6 +137,11 @@ describe('getAutocompleteSuggestions', () => { const complexQuery = 'WorkflowID = "test" AND StartTime >= "2023-01-01T00:00:00Z" AND c'; const suggestions = getAutocompleteSuggestions(complexQuery); - expect(suggestions).toEqual(['CloseTime', 'ClusterAttributeScope', 'ClusterAttributeName', 'CloseStatus']); + expect(suggestions).toEqual([ + 'CloseTime', + 'ClusterAttributeScope', + 'ClusterAttributeName', + 'CloseStatus', + ]); }); }); From 6b059afab4bff95eb2852dc9318ecb416d972ba4 Mon Sep 17 00:00:00 2001 From: Tim Li Date: Tue, 25 Nov 2025 14:29:34 -0800 Subject: [PATCH 5/5] update perma link Signed-off-by: Tim Li --- .../get-search-attributes/get-search-attributes.constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/route-handlers/get-search-attributes/get-search-attributes.constants.ts b/src/route-handlers/get-search-attributes/get-search-attributes.constants.ts index a2cdfdee3..c0b40f5b0 100644 --- a/src/route-handlers/get-search-attributes/get-search-attributes.constants.ts +++ b/src/route-handlers/get-search-attributes/get-search-attributes.constants.ts @@ -1,7 +1,7 @@ /** * System attributes as defined by Cadence. * These are built-in attributes that are automatically indexed by the system. - * https://github.com/cadence-workflow/cadence/blob/b9e01ea9b881daff690434419b253d1d36fc486a/common/definition/indexedKeys.go#L92 + * https://github.com/cadence-workflow/cadence/blob/5c79d73b2bd31ae492c84d780b5b4fb7afdc2417/common/definition/indexedKeys.go#L94 */ export const SYSTEM_SEARCH_ATTRIBUTES: Set = new Set([ 'DomainID',