Add a NOT IN operator for KeywordList search attributes - #3961
Open
rossedfort wants to merge 1 commit into
Open
rossedfort wants to merge 1 commit into
rossedfort wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
andrewzamojc
approved these changes
Oct 1, 2026
| const listConditionalOptions = $derived([ | ||
| { value: 'in', label: 'In' }, | ||
| { value: 'in', label: translate('common.in') }, | ||
| { value: 'not in', label: translate('common.not-in') }, |
Contributor
There was a problem hiding this comment.
I guess this is already working and you're just adding it to the FE? All the other files are tests.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description & motivation 💭
KeywordList search attributes (
BuildIds,TemporalChangeVersion, and any custom one) could be filtered within,=,!=,is nullandis not null, but there was no way to express "this list contains none of these values".!=is not a substitute — it compares a single value, so excluding three build IDs meant three separate chips.Every layer below the UI already handled
not in:'not in'is in theconditionalsgrammar list insrc/lib/utilities/is.ts, andisInConditionalmatches it.tokenize.tshas a six-character lookahead written specifically to lex it, already covered by a test.formatValueinfilter-workflow-query.tspasses the parenthesized literal through unquoted for any in-style conditional.toListWorkflowFiltersstores the whole("a", "b")token as the value and capturesnot inas the conditional.So the fix is one entry in
listConditionalOptions. The chip's value editor already picksChipInputvs. a plain input viaisInConditional, andapplyChangesalready re-serializes chips to("a", "b")for it.The query serializes unspaced, matching how
inis emitted today:`BuildIds`not in("a", "b").Confirmed server-side support before building this: in
common/persistence/visibility/store/query/converter.go,supportedKeywordListOperatorsis exactlyEqualStr, NotEqualStr, InStr, NotInStr. (The List Filter docs page doesn't mentionNOT IN, but the converter accepts it.)Scoped to KeywordList only. Keyword attributes support
NOT INserver-side too, but they have noInoption in the UI today, so addingNot Inthere alone would be inconsistent.The hardcoded English
'In'label moved to a translation key alongside the new'Not In', so the pair stays consistent.Testing 🧪
How was this tested 👻
Unit:
not inserialization (alone and AND-joined) infilter-workflow-query.test.ts; parsing`CustomKeywordListField`not in("Hello", "World")back into a filter (alone and joined) into-list-workflow-filters.test.ts.E2E: a
KeywordList search attributesblock registering a KeywordList custom attribute, covering the Not In flow, the unchanged In flow, and a round trip through the raw query box.Full unit suite and the integration suite pass; cold
svelte-checkreports 0 errors;lint:ciis clean.Manual testing has not been done — nothing here has exercised a real
NOT INquery against Elasticsearch. Worth a pass before merge.Steps for others to test: 🚶🏽♂️🚶🏽♀️
BuildIdsorTemporalChangeVersion).`BuildIds`not in("a", "b")and the results should exclude matching workflows.Issue(s) closed
FE-613