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
Good, FLOW doesn't have TIME_RANGE. Now let's write the fix generally: add recursive tree-mapping helper for TIME_RANGE resolution across QueryFilterUtils (used by Execution, Log) and rewriteTriggerDateFilters (Trigger), plus TimeLineSearch.extractFrom recursion.
Assistant
Now let's add a
flattenLeavesstatic utility to QueryFilter, and amapLeavesmethod to transform leaves while preserving tree structure. This will be reused by TimeLineSearch, QueryFilterUtils, and DateUtils.Assistant
Now insert
flattenLeavesandmapLeavesmethods afterisNode():Assistant
Good. Now let's update
TimeLineSearch.extractFromto use flattenLeaves.Assistant
Now update
QueryFilterUtils.javato usemapLeaves/anyLeafMatchesforupdateFilters,updateFiltersForEndDate, andrewriteTriggerDateFilters.Assistant
Now
validateTimeline(updatedFilters)at line 129 callsDateUtils.validateTimeline(filters)which iterates flat only — let's fix that too for consistency. Let's view rest of file and DateUtils.Assistant
Leftover lines 171-174 from old code need removing.
Assistant
Now let's also update
DateUtils.validateTimeline(List<QueryFilter>)to be recursive for consistency (used at the end ofreplaceTimeRangeWithComputedDateFilter).Assistant
Good, that's a leaf-condition builder (called from within recursive predicate building elsewhere). Let's check where nodes are converted to jOOQ conditions (should already handle nesting recursively since validation does).
Assistant
Good, this recurses via toCondition (handles node vs leaf) - fine since TIME_RANGE never reaches here anyway after our fix (it's resolved before). Now let's build core & webserver modules.
Assistant
Compiles successfully (only warnings). Now let's run the existing related tests.
Assistant
Both pass. Now let's write a reproduction test using QueryFilterFormatBinder + QueryFilterUtils to simulate the exact scenario end-to-end, and check that TIME_RANGE nested inside a group resolves properly without validation errors.
Assistant
Let's write a small temp test/script simulating the exact reproduction to confirm the fix end-to-end (binder -> replaceTimeRangeWithComputedDateFilter -> validateQueryFilters).
Assistant
Package-private. Let's move my test to the same package
io.kestra.webserver.converters.Assistant
Passes with fix. Now let's confirm it fails without the fix by stashing changes (excluding the test file itself).
Assistant
The test fails without the fix, confirming the bug reproduction. Now let's restore the fix.
Assistant
This exactly matches the reported error message. Now let's restore the fix.
Assistant
Now let's remove the temporary repro test (per instructions not to add tests), and run broader existing test suites to make sure nothing broke.
Assistant
No DateUtils test exists. That's fine. QueryFilterTest passed (730 tests). Now let's run webserver tests for QueryFilterFormatBinderTest and QueryFilterUtilsTest/TimeLineSearchTest again together.
Assistant
All pass. Now let's try running the full ExecutionControllerTest (integration, requires DB) to check the
badQueryFilterstest and general execution search functionality still works.Assistant
Good. Now let's run the full ExecutionControllerTest suite to be thorough (may take a while), plus TriggerControllerFilterTest and LogControllerTest.
Assistant
All 23 tests pass. Let's also run TriggerControllerFilterTest and LogControllerTest since they use the QueryFilterUtils functions too.
Assistant
All pass. Now let's also run the AbstractExecutionRepositoryTest / jdbc repository tests that use TIME_RANGE field, and QueryFilterFormatBinderTest again to be safe. Let's also double check core module compiles/tests fully.
Assistant
All 106 tests pass. Let's view the final diff to review everything.
Assistant
Everything compiles. Let's double check
git statusis clean (no leftover repro test file) and view final diff stat.Assistant
Clean. Now let's go through the checklist.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.