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 to understand the issue.
- Assistant
Let me search for TIME_RANGE and conditional group related code more carefully.
- Assistant
rg is not available, let me use grep instead.
- Assistant
I'll inspect QueryFilter field validation and how TIME_RANGE is handled for executions.
- Assistant
Let me look at the Field enum and the validation logic for resources.
- Assistant
Let me read the EXECUTION resource definition and the validateQueryFilters method, as well as TIME_RANGE field.
- Assistant
Let me look at the Resource enum and the validation method.
- Assistant
So TIME_RANGE is not in the EXECUTION supported fields. Looking at QueryFilterUtils, it seems TIME_RANGE is supposed to be resolved into START_DATE/END_DATE. The issue is that when conditional groups ...
- Assistant
Now let me look at QueryFilterUtils and how TIME_RANGE is supposed to be transformed before validation. Also, the issue says "conditional groups" are not accepted. Let me ...
- Assistant
Let me see how the executione controller validates filters and how the binder handles nested filters.
- Assistant
The
@QueryFilterFormat(Resource.EXECUTION)is what validates. Let me look at QueryFilterFormat and QueryFilterFormatBinder. - Assistant
Let me read the rest of the binder, especially where validation happens.
- Assistant
Interesting - the binder doesn't validate anymore. Let me see where validateQueryFilters is called.
- Assistant
The convert function likely doesn't recurse into group children — let me inspect that path and how JDBC validation behaves with nested filters.
- Assistant
Let me look at TimeLineSearch.extractFrom - maybe nested groups cause TIME_RANGE not to get converted.
- Assistant
Let me check how the UI sends conditional groups and look for related recent changes.
- Assistant
The design system has filter components. Let me look at how filters are encoded to query params.
- Assistant
Let me look at how query filters are encoded for the API - search for the encode/decode of filters format.
- Assistant
Hmm nothing for filters[? The grep might have issues with brackets. Let me try differently.
- Assistant
There's useFilterGroups.ts has multi-filtering — let me inspect those and related helpers.
- Assistant
Found the group encoding path. Let me re-read NodeBuilder.build and how nested TIME_RANGE is handled.
- Assistant
Nested TIME_RANGE isn't rewritten before validation. I'll inspect JDBC handling and testsnext.
- Assistant
I'll also check timeRangeCondition and related DateUtils validation.
- Assistant
So TIME_RANGE is intentionally not supported at the JDBC level - it should always be rewritten. The fix is clearly to make the rewrite recursive for conditional groups.
- Assistant
I'll check how memory repositories handle filters and look for other recursive needs.
- Assistant
I've identified the root cause: nested
TIME_RANGEinside conditional groups isn't rewritten before validation. I'll fix recursive handling in the filter utilities. - Assistant
That edit went to the wrong file — I'll restore DateUtils and apply the change to TimeLineSearch instead.
- Assistant
Good — DateUtils is restored. Now I'll edit TimeLineSearch properly.
- Assistant
Now I'll update QueryFilterUtils to recursively rewrite filters inside groups.
- Assistant
The edit landed on the wrong file again. Restoring TimeLineSearch and writing QueryFilterUtils correctly.
- Assistant
Re-applying both changes using the
--fileoption so they land on the correct files. - Assistant
I'll use replace with --file option to be safe.
- Assistant
TimeLineSearch looks good. Now updating QueryFilterUtils the same way.
- Assistant
Checking other EXECUTION endpoints that may skip TIME_RANGE rewriting:
- Assistant
I'll write a temporary reproduction script and run the related unit tests.
- Assistant
Checking whether those tests passed:
- Assistant
Tests show UP-TO-DATE — forcing a rebuild so our changes are actually compiled.
- Assistant
All existing tests passed. Verifying the conditional-group case with a temporary reproduction script.
- Assistant
There's a compilation error—checking what went wrong.
- Assistant
I'll build the QueryFilter tree manually without the binder.
- Assistant
python3 isn't available — writing the test with a heredoc instead.
- Assistant
Now I'll edit this file with the test content.
- Assistant
Fixing typos introduced in the test file.
- Assistant
File looks clean — running the reproduction test.
- Assistant
Reproduction passes. Removing the temporary test and reviewing the final diff.
- Assistant
Confirming temp test is gone and sources still compile cleanly.
- Assistant
The test output was truncated - let me check if tests passed.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.