Untitled conversation
- User
[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.
- Assistant
Now let me find where the route query gets converted into the backend API request — where
timeRangenormally becomesstartDate. - Assistant
Let me check
DateUtils.validateTimelineand the repository validation path, plus how the JDBC repo handles nested filters: - Assistant
Now let me check that the JDBC layer handles nested (node) filters properly once TIME_RANGE is rewritten:
- Assistant
Now update
QueryFilterUtils: - Assistant
Now add tests reproducing the issue:
- Assistant
The implementation looks good. Now let me check on the test run:
- Assistant
Gradle is still starting up. I'll wait for the monitor notification with the test results.
- Assistant
The change set is minimal and focused. Waiting on the test run to complete now — the monitor will notify when the Gradle build finishes.
- Assistant
Monitor armed — waiting for the Gradle run to produce its final output (compilation of upstream modules like
coretakes a while on first build). - Assistant
All tests pass —
BUILD SUCCESSFUL, 10/10 green, including the three new tests covering the conditional-group case and the four pre-existingTimeLineSearchTesttests confirming no regression in the top-level path.Summary
Root cause: When the UI sends a conditional filter group (e.g.
filters[or][0][timeRange][EQUALS]=PT720H+filters[or][1][labels][EQUALS][foo]=bar), the binder builds a nestedQueryFilternode. ButQueryFilterUtils' TIME_RANGE→date rewrite (, , ) only walked the filter list, so a leaf inside a group was never translated into /. The JDBC repository's recurse, so it rejected the surviving nested with HTTP 400. - Assistant
That's the leftover monitor confirming the same result already reported: all 10 tests pass, BUILD SUCCESSFUL. The fix is complete — nothing further to do.
Final state of the change:
webserver/.../utils/QueryFilterUtils.java— recursiveTIME_RANGEresolution inside conditional groups (mapLeaves/anyLeafMatcheshelpers;updateFilters,updateFiltersForEndDate,rewriteTriggerDateFiltersnow handle nested nodes; recursivehasDateFilterso no clipping default is appended)webserver/.../utils/TimeLineSearch.java—parseDurationwidened to package-privatewebserver/.../utils/QueryFilterUtilsTest.java— 3 new tests reproducing the issue (OR group oftimeRange+labels), including validation againstResource.EXECUTIONthat previously threw the HTTP 400 error
- Assistant
The monitor has ended — that's just the cleanup notification. The task is fully resolved:
Fix for "[Filters] Backend do not accept conditional groups": nested
TIME_RANGEfilters inside conditional groups (filters[or][N][timeRange][EQUALS]=...) are now recursively rewritten toSTART_DATE/END_DATEbounds inQueryFilterUtilsbefore reaching repository validation, which previously rejected them with HTTP 400. Verified with./gradlew :webserver:test— 10/10 tests passing, including 3 new tests covering the exact repro scenario.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.