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
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 trace the filter validation and conditional-group parsing paths, identify why
TIME_RANGEis being validated as an execution field, then reproduce the failure with the most focused existing test before changing source. I’ll first inspect the repository structure and search for the reported error text and relevant filter enums. - Assistant
ripgrepis unavailable, so I’ll use recursivegrepwith build and frontend dependency directories excluded. The likely fault is either recursive validation assigning the wrong resource type to child filters or request binding turning a group’s time-range metadata into a normal field. - Assistant
The supported-field list confirms validation happens after
TIME_RANGEshould have been normalized into a date filter. I’ll inspectQueryFilter, normalization utilities, binder behavior, and execution controller call order to see why top-level defaults normalize but grouped filters do not. - Assistant
QueryFilterUtilsonly maps top-level leaves; a conditional group remains unchanged, so its nested defaultTIME_RANGEreaches repository validation. I’ll verify binder validation timing and recursive repository support, then inspect tests around utility normalization and grouped query models to design a recursive transform that preserves group semantics. - Assistant
The binder intentionally builds nested nodes and core validation recursively checks leaves, while date rewriting is flat. A robust fix must recursively rewrite nested date leaves without flattening or changing
AND/OR; it must also compute eachTIME_RANGEvalue (potentially different durations) rather than relying solely on a flatTimeLineSearch. I’ll inspectTimeLineSearchandDateUtilsto preserve existing start/end precedence and validation behavior. - Assistant
The current flat extractor also misses the nested duration, so merely traversing during replacement would incorrectly substitute the default eight-day boundary instead of the selected duration. I’ll make timeline extraction recurse through groups and make all date-filter rewrites recurse while rebuilding nodes unchanged. Root-level default-boundary insertion will use a recursive “contains date filter” check, preventing an extra top-level date constraint when the date filter belongs inside an
ORgroup. - Assistant
Python is not installed, so no files changed. I’ll apply the same focused edits with the repository’s
editcommand, starting with recursive extraction and then the tree-mapping utility. - Assistant
I’ll now replace the exact line ranges. The recursive mapper applies only to leaves and reconstructs each node with the same logical operator and child ordering, so repository SQL grouping remains identical.
- Assistant
One range shifted after the earlier insertion, causing a duplicated declaration and dropping the
ifline inupdateFilters; I caught this in the immediate review. I’ll replace complete method blocks (rather than shifted partial ranges), add the recursive predicate, and then update end-date and trigger rewriting. - Assistant
The corrected start-date block is now structurally sound. I’ll finish the two remaining flat mappings and use normal imports for the functional/stream types to match Java style. Then I’ll compile and run focused tests; compilation will also detect switch exhaustiveness or formatting mistakes.
- Assistant
The second partial edit again overlapped the old multi-line lambda, and the import edit duplicated
ZonedDateTimewhile displacingQueryFilter. I’ll avoid further incremental overlap by replacing the complete import section and complete affected methods based on their current line numbers. - Assistant
The imports and end-date method now review cleanly. I’ll replace the full trigger return expression, add a standard
Streamimport inTimeLineSearch, then rungit diff --checkand compile before considering behavior refinements. - Assistant
Compilation succeeds. I’ll now execute a temporary standalone reproduction (outside the repository, not a test modification): construct the exact
OR(timeRange, labels)tree, confirm raw repository validation produces the reported unsupportedTIME_RANGE, run the fixed normalization, and confirm recursive validation then succeeds while theORnode and label remain intact. Afterward I’ll run the existing utility, timeline, binder, and execution-controller tests. - Assistant
The standalone reproduction confirms the exact pre-normalization error and that the normalized group validates, and all 45 focused existing tests pass. I’ll inspect the final diff and run the module’s formatting/static checks. I’ll also verify only the two intended source files are modified and no generated artifacts are tracked.
- Assistant
The project-wide Spotless check fails on 84 pre-existing files (starting with
FlowToolSchemaMapper), not specifically on these changes; it also did not modify additional files. I’ll determine the configured formatter and run it only against the two changed files if supported, then re-run diff checks. - Assistant
The convention resolves to Google Java Format 1.24.0. I’ll invoke that cached formatter directly on only the two changed files, avoiding the unrelated pre-existing violations, then recompile/focused utility tests if formatting changes code.
- Assistant
The formatter jar is not standalone and lacks its Guava runtime when invoked directly. Since Git confirms only our two files are currently modified, I can safely run module Spotless Apply, retain formatting changes to these two files, and restore every other file it touches from Git. Then a project-wide check should either pass for ours and continue reporting only unchanged baseline violations outside the module/configuration scope.
- Assistant
Spotless applied successfully and all unrelated files were restored; only the intended two remain. I’ll inspect the formatter-adjusted diff, run Spotless Check once more (to document whether baseline failures persist after our files are clean), and rerun the focused utility tests because formatting may have changed line wrapping only.
- Assistant
Final validation status:
- Reproduced reported error: The temporary standalone program produced the exact
Field TIME_RANGE is not supported for resource EXECUTIONvalidation message forOR(timeRange, labels). - Confirmed fix: The same program normalized nested
TIME_RANGEtoSTART_DATE, retainedORandLABELS, and passed execution-resource validation. - Edge cases considered: Traversal is recursive for arbitrary allowed nesting depth; node operators/order are preserved; nested date filters prevent accidental addition of a root default date; start-date, end-date, and trigger date rewrite modes all handle groups.
- Existing tests: The first run passed all 45 focused tests, including
ExecutionControllerTest; after formatting, all 22 utility/timeline/binder tests passed again. Compilation passed. Spotless formatted the changed files successfully; the aggregate check remains red solely because 83 unrelated existing files violate current formatting. - Repository hygiene: No tests were added or modified, the temporary reproduction lives under , and only two intended source files are modified.
- Reproduced reported error: The temporary standalone program produced the exact
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.