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
I’ll trace how execution filters and conditional groups are parsed and validated, then add the smallest backend fix plus a regression test. Assumption:
TIME_RANGEis valid only as a UI shorthand that should be expanded before recursive group validation; success is a groupedORquery containing the default time filter and labels being accepted without broadening the supported execution fields. I’ll first verify that model against the code; if groups intentionally preserveTIME_RANGE, I’ll instead fix validation at the recursive boundary. - Assistant
rgis unavailable in this checkout environment, so I’m switching to targetedgrepsearches and keeping the investigation read-only until the validation path is clear. - Assistant
The failure is confirmed: the controller rewrites
TIME_RANGEonly among root filters, while repository validation correctly descends into conditional groups. A groupedTIME_RANGEtherefore reaches JDBC unchanged and is rejected.The surgical design is to make the existing rewrite tree-aware and preserve every
AND/ORnode. I’m avoiding addingTIME_RANGEto repository-supported fields because it is a transport shorthand, not a database field, and doing so would merely move the failure deeper into SQL generation. I’m checking date-validation semantics now so nested ranges are resolved consistently, including multiple branches. - Assistant
The date helper also scans only root leaves, so changing just the mapper would silently turn a grouped
PT24Hinto the default eight-day window. I’ll update both traversal points: discover timeline fields recursively, then rewrite leaves recursively while retaining the exact group shape. This preserves current flat-filter behavior and ensures noTIME_RANGEreaches repository validation. The regression test will assert the group/operator survives and the rewritten tree validates forEXECUTION. - Assistant
The first pass exposed one compatibility detail: in start-date mode, an end-date-only query historically still receives the default start bound. I’ve retained that behavior by using distinct recursive checks for start bounds versus any date boundary. The implementation remains limited to two backend utilities and one focused test; I’m running that test class now.
- Assistant
Gradle is still configuring the large multi-project build and has not emitted test output yet. While it runs, I’m also reviewing the diff for accidental behavior changes—particularly default date-bound insertion and preservation of conditional-node shape.
- Assistant
The build has been silent for over two minutes, which is atypical but the Gradle process remains active. I’ll give this invocation a little longer rather than starting competing Gradle processes; if it stays silent, I’ll stop it cleanly and rerun with plain console output to expose where it is waiting.
- Assistant
The plain-console rerun shows the delay occurs while Gradle starts/configures its single-use daemon, before any project task runs; it is not a test failure or compilation error so far. I’m keeping the test running and will report the exact outcome rather than treating the startup delay as success.
- Assistant
Daemon logs confirm both attempts were canceled only when I interrupted them; they contain no Gradle exception and never progress past “executing build.” Since external access is out of scope and dependency resolution is the likely wait point, I’ll retry the focused test in offline mode against the preloaded Gradle cache. This should either run normally or fail promptly with a precise missing-cache dependency.
- Assistant
Production compilation now succeeds offline. The focused test task is blocked specifically because Mockito 5.23.0 is not cached, even though this test itself does not use Mockito. I’ll make one final local-only attempt using the project’s compiled outputs and available cache; I won’t alter dependency versions or build configuration merely to accommodate the environment.
- Assistant
The compiled-code smoke check passes: the
ORnode remains intact,TIME_RANGEresolves to approximately now minus 24 hours, the label remains unchanged, and recursive execution-filter validation accepts the result. I’m doing the final formatting/diff checks now; the only unavailable verification remains the JUnit task’s uncached Mockito agent. - Assistant
The repository hard-codes Mockito 5.23.0 solely as the test JVM agent, while the local cache contains 5.20.0. Because the regression test uses no Mockito APIs, I can safely verify it without repository changes by applying a temporary Gradle resolution override outside the workspace, run only this test, then remove that override. This affects verification only, not the implementation or committed build.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.