ISSUE DESCRIPTION [Filters] Backend do not accept conditional groups Describe the issue…
- User
ISSUE DESCRIPTION
[Filters] Backend do not accept conditional groups
Describe the issue
HTTP 400 is returned at a simple conditional group filter query.
Reproduction
- Navigate to the Executions view
- Add a new conditional group to the default set of filters
- Keep the
ORoperator - Add a new filer - e.g. labels
foo:bar - HTTP 400 response with:
Invalid query filters: Provided query filters are invalid: Field TIME_RANGE is not supported for resource EXECUTION. Supported fields are QUERY, SCOPE, FLOW_ID, START_DATE, END_DATE, STATE, LABELS, TRIGGER_EXECUTION_ID, CHILD_FILTER, NAMESPACE, KIND, PARENT_ID
Environment
- Kestra Version: develop
Interface
No new interfaces are introduced.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
- I have thought about edge cases and made sure my fix handles them as well.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
- Assistant
I'll start by exploring the repository structure and searching for relevant filter/conditional group code related to the TIME_RANGE error.
- Assistant
Let me search more specifically for filter validation and TIME_RANGE handling.
- Assistant
Hmm empty results? That's weird. Let me try differently.
- Assistant
rg is not found now? Earlier it seemed to work... Wait, the first command had
rg -l "TIME_RANGE" --type java 2>/dev/nulland it might have just returned nothing silently. Let me use grep. - Assistant
I'll inspect QueryFilterUtils and QueryFilter next, focusing on how conditional groups and TIME_RANGE are validated.
- Assistant
Next I'll read the rest of QueryFilter validation and the full QueryFilterUtils.
- Assistant
I'll inspect validateQueryFilters and how filters are applied before validation — conditional groups may leave TIME_RANGE untransformed.
- Assistant
I'll check ExecutionController filter handling and TimeLineSearch next — nested TIME_RANGE likely isn't rewritten inside conditional groups.
- Assistant
I'll inspect the filter binder and how the UI builds conditional-group queries.
- Assistant
I'll check recent git history and UI filter serialization related to conditional groups.
- Assistant
Looking at how filters get nested - when there's a conditional group with OR, existing filters might stay at top level and TIME_RANGE should still get replaced... Unless the UI nests all filters someh...
- Assistant
Let me look at how filters are encoded when there are logical groups.
- Assistant
Let me look at the design system filter types and URL encoding.
- Assistant
Nested TIME_RANGE is the problem — inspecting encode helpers and DateUtils to plan a recursive fix.
- Assistant
I have a clear root cause. Checking DateUtils and related recursive handling before implementing the fix.
- Assistant
I'll check topLogical defaults and default filter grouping next.
- Assistant
Implementing recursive TIME_RANGE handling: updating TimeLineSearch, QueryFilterUtils, and DateUtils.
- Assistant
Implementing recursive fixes in TimeLineSearch, QueryFilterUtils, and DateUtils.
- Assistant
I'll rewrite TimeLineSearch to walk leaves recursively.
- Assistant
Simplifying TimeLineSearch to a single recursive leaf walk to reduce duplication.
- Assistant
Fixing the accidental typo in the comment.
- Assistant
Fixing the awkward javadoc phrasing.
- Assistant
Updating QueryFilterUtils to recurse into nested conditional groups.
- Assistant
I'll rewrite the update methods and rewriteTriggerDateFilters to be recursive.
- Assistant
Now update DateUtils.validateTimeline to recurse into conditional groups.
- Assistant
I need to make validateTimeline recursive. Note that isStartDateFilter / isEndDateFilter check field which is null for nodes, so nodes are silently skipped. I need to recurse.
- Assistant
Better to flatten date bounds across the tree so cross-node start/end pairs are validated correctly.
- Assistant
Cleaning up the DateUtils timeline validation rewrite.
- Assistant
There's a Chinese character "需要" that got inserted. Fix it.
- Assistant
Running the related unit tests to verify the fix.
- Assistant
The output was truncated - let me check the test result more carefully.
- Assistant
Tests reported UP-TO-DATE — forcing a rebuild of the changed modules.
- Assistant
Existing tests pass. Writing a temporary test to reproduce the conditional-group issue and verify the fix.
- Assistant
I left a junk comment in the file. Let me fix the temporary test file properly.
- Assistant
Now run the temporary test.
- Assistant
Compilation errors - need to see them.
- Assistant
The issue is type inference with Map.of and List.of. Let me check how the existing binder test does it.
- Assistant
Checking the full compiler error next.
- Assistant
The binder method is package-private — I'll build the filters manually instead.
- Assistant
Run the test again.
- Assistant
All 3 tests pass. Removing the temporary test file as we're not supposed to add tests.
- Assistant
Cleaning up fully-qualified type names and polishing imports.
- Assistant
Let me improve imports.
- Assistant
Need to replace FQCN usages.
- Assistant
Need to do replaces one at a time.
- Assistant
Also clean TimeLineSearch java.util.ArrayList. And handle extracts when filters is null - leaves handles null.
Also need TimeLineSearch to handle null filters list passed to extractFrom:
- Assistant
Seems like combining EOF with another command is problematic. Do them separately.
- Assistant
Let me edit TimeLineSearch imports and ArrayList.
- Assistant
replace ArrayList
- Assistant
Final test run and diff review.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.