Skip to content
TheChatArchiveThe Chat Archive
xiaomi/mimo-v2.5-pro· unknownHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION [Filters] Backend do not accept conditional groups Describe the issue…

  1. 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

    1. Navigate to the Executions view
    2. Add a new conditional group to the default set of filters
    3. Keep the OR operator
    4. Add a new filer - e.g. labels foo:bar
    5. 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 using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to 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.

    Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!

    (Current directory: /kestra, current file: none) bash-$

  2. Assistant

    I'll start by exploring the repository structure to understand the codebase and locate relevant files for the issue. The issue mentions "Filters" and "conditional group filter query" causing HTTP 400 with error about TIME_RANGE not supported for resource EXECUTION. Let's first look at the repository.

  3. Assistant

    Let me explore the repository structure to understand what we're dealing with.

  4. Assistant

    The issue mentions "conditional group filter query" and an error about "TIME_RANGE is not supported for resource EXECUTION". Let me search for relevant filter-related code.

  5. Assistant

    Let me look at the error message: "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"

    The issue is about conditional groups. Let me search for "conditional group" in the codebase.

  6. Assistant

    Let me look at the filter-related files to understand the issue.

  7. Assistant

    Let me look at the QueryFilter class and the QueryFilterUtils class to understand the issue better.

  8. Assistant

    Let me look at the QueryFilter model and the QueryFilterUtils to understand how filters are processed. clash

  9. Assistant

    Now let me look at the TimeLineSearch and QueryFilterUtils to understand how TIME_RANGE is handled.

  10. Assistant

    Let me look at the TimeLineSearch class and also look at how the filter validation works, especially how the validation handles nested filters (conditional groups).

  11. Assistant

    Now I understand the issue better. Let me look at the EXECUTION resource definition and how filters are validated.

  12. Assistant

    Let me look at the EXECUTION resource definition in detail.

  13. Assistant

    Now let me understand the flow - the issue is that TIME_RANGE is not a supported field for EXECUTION resource, but when using conditional groups, the validation happens before the TIME_RANGE is converted to START_DATE/END_DATE. Let me look at where validation happens and where the conversion of TIME_RANGE happens.

  14. Assistant

    Now I see the issue. Let me look at the execution controller and the AbstractJdbcRepository to understand the flow better.

  15. Assistant

    Let me check where validation happens in the filter format binder or controller.

  16. Assistant

    Let me look at the QueryFilterFormatBinder to understand how filters are parsed.

  17. Assistant

    Now let me look at where the validation is called to understand the flow.

  18. Assistant

    Let me see how this method is called.

  19. Assistant

    Let me look at the toCondition method:

  20. Assistant

    Let me see the full toCondition method.

  21. Assistant

    Now I understand the issue. The problem is clear:

    1. TimeLineSearch.extractFrom() only iterates top-level filters, not recursing into conditional group children
    2. updateFilters() and updateFiltersForEndDate() only process top-level filters
    3. So when a TIME_RANGE filter is inside a conditional group (node with logical + children), it never gets replaced with START_DATE/END_DATE
    4. But validateQueryFilters() DOES recurse into children, so it finds the unsupported TIME_RANGE field

    The fix needs to make QueryFilterUtils methods recursive. Let me also look at the full updateFilters and updateFiltersForEndDate:

  22. Assistant

    Now let me look at the test files to understand expected behavior:

  23. Assistant

    Now I understand the issue clearly. When a filter contains a conditional group (node with logical + children), the TimeLineSearch.extractFrom() and updateFilters()/updateFiltersForEndDate() methods only iterate top-level filters and skip the node filters (where field() == null). They don't recurse into children. But validateQueryFilters() DOES recurse into children, so it finds the TIME_RANGE field which isn't in the EXECUTION resource's supported fields.

    The fix needs to make these methods recursive to handle TIME_RANGE filters inside conditional groups.

    Let me first check the TimeLineSearch.extractFrom method more carefully:

  24. Assistant

    Now I have a clear understanding. Let me look at the existing tests to make sure I understand the test structure:

  25. Assistant

    Now let me look at how rewriteTriggerDateFilters also works:

  26. Assistant

    Now let me look at the DateUtils.validateTimeline method:

  27. Assistant

    Let me check if DateUtils.validateTimeline(filters) also needs to recurse into children.

  28. Assistant

    Now I have a clear picture of the issue. Let me also look at the collectValidationErrors to confirm it handles nested filters:

  29. Assistant

    Now I understand the full issue. The problem is:

    1. TimeLineSearch.extractFrom() only looks at top-level filters and skips node filters (where field() == null), missing TIME_RANGE inside conditional groups
    2. updateFilters() and updateFiltersForEndDate() also only process top-level filters, not recursing into children of conditional groups
    3. But validateQueryFilters() DOES recurse into children (via collectValidationErrors), finding unsupported TIME_RANGE

    I need to make the filter replacement methods recursive. Let me fix TimeLineSearch.extractFrom first:

  30. Assistant

    Now let me fix TimeLineSearch.extractFrom to recurse into conditional groups:

  31. Assistant

    Now I have a complete understanding of the issue. Let me implement the fix. The core problem is that TimeLineSearch.extractFrom(), updateFilters(), updateFiltersForEndDate(), and rewriteTriggerDateFilters() don't recurse into conditional group children.

    Let me fix TimeLineSearch.extractFrom first:

  32. Assistant

    Now let me fix the QueryFilterUtils class. The updateFilters and updateFiltersForEndDate methods need to handle conditional groups:

  33. Assistant

    Now let me update updateFilters to handle conditional groups:

  34. Assistant

    Now update updateFiltersForEndDate:

  35. Assistant

    Now I need to add the hasDateFilterRecursive helper method and update rewriteTriggerDateFilters:

  36. Assistant

    Now I need to add the hasDateFilterRecursive helper and update rewriteTriggerDateFilters:

  37. Assistant

    I see there's an extra } at the end. Let me check and fix:

  38. Assistant

    There's an extra closing brace at the end. Let me fix that.

  39. Assistant

    Now let me also check the DateUtils.validateTimeline(List<QueryFilter>) to see if it needs to be recursive:

  40. Assistant

    I also need to update DateUtils.validateTimeline(List<QueryFilter>) to recurse into conditional groups since after our fix the date filters might be inside conditional groups:

  41. Assistant

    Now let me also check if DateUtils.validateTimeline needs to be updated. Actually, looking at it, it's called after the filters have already been transformed, so it should still work since the date filters it's looking for would be at the top level or within groups. But for correctness with the new recursive behavior, let me also make it recursive:

  42. Assistant

    I also need to make DateUtils.validateTimeline(List<QueryFilter>) recursive since date filters can now be inside conditional groups:

  43. Assistant

    Good. Now let me verify the changes compile and run the existing tests:

  44. Assistant

    Let me run the existing tests to make sure they pass:

  45. Assistant

    All existing tests pass. Let me also run the QueryFilterFormatBinder test and other related tests:

  46. Assistant

    All tests pass. Let me also run the QueryFilterTest:

  47. Assistant

    All tests pass. Now let me create a simple reproduction script to verify the fix works for the specific scenario described in the issue:

  48. Assistant

    Now let me try to compile and run this verification. I'll use Gradle to run it:

  49. Assistant

    Good, it compiles. Let me review the full diff of my changes:

  50. Assistant

    The diff looks correct. Let me also run the full test suite for the affected modules to make sure nothing is broken:

  51. Assistant

    All 96 tests pass. Let me also check if there are any JDBC repository tests that test filter validation:

  52. Assistant

    Let me also check if there are any related tests in the core module:

  53. Assistant

    All 194 core utility tests pass. Let me do a final review of the changed files:

  54. Assistant

    Let me now review the final state of all three files to make sure everything is correct.

  55. Assistant

    Let me also review the DateUtils file:

  56. Assistant

    Let me clean up and run all the related tests one final time:

  57. Assistant

    Let me run all the related tests one more time to make sure everything is good.

  58. Assistant

    All tests pass. Let me run the full diff one more time to confirm all changes:

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.