action #53402
open[beginner] Not possible to search for test suites (again?) using regex, e.g. `^gnome$`
0%
Description
Steps to reproduce¶
- Go to https://openqa.opensuse.org/admin/test_suites
- Enter
^gnome$
in the search field - Observe that no test suite shows up
Problem¶
Is this a regression from https://github.com/os-autoinst/openQA/pull/2089 or https://github.com/os-autoinst/openQA/pull/2084 ?
Further details¶
entrance level issue
Updated by okurz over 5 years ago
- Related to action #51719: "New Test Suite " button in admin/test_suites can not be used with filter added
Updated by okurz over 5 years ago
- Related to action #52232: UI: search for testsuite settings only on current page vs. only 100 jobs per page possible added
Updated by mkittler over 5 years ago
Regex works but for some reason but for some reason a whitespace is appended to the end. So e.g. ^gnome $
would do what you've expected.
Updated by mkittler over 5 years ago
- Priority changed from Normal to Low
Likely a data tables bug, e.g. one can reproduce it as well in their examples: https://datatables.net/examples/api/regex.html
But it is only reproducible using the global search. They somehow implemented that "column boundaries" can be "crossed" using one ore more white spaces, e.g. ^value1 value2 $
would match if one column contains value1
and a subsequent (but not necessarily adjacent) column contains value2
. Likely this extra handling adds the requirement to put a space before $
. Not sure whether this can be easily fixed from our side and whether it is worth the effort.
Since regex works in general I'm lowering the priority.
Updated by ilausuch over 4 years ago
Checking on the datatables JS
https://cdn.datatables.net/v/dt/dt-1.10.21/datatables.js
I found that in the function https://cdn.datatables.net/v/dt/dt-1.10.21/datatables.js that I think is the used for this purpose.
If the smart flag is on (I checked to search in more than one column is necessary to simplify the search) then the search add the ^ and $ symbols. And the strings we put on the search field are joined using this structure:
search = '?=.*?'+a.join( '(?=.?' )+').$';
But I if I am not wrong in the code we have only regex flag
https://github.com/os-autoinst/openQA/blob/26396b3e9397dad3644c4868b4a112ebe9dc053c/assets/javascripts/admintable.js#L441
search: {
regex: true,
},
But testing the search input it is working as if smart flag is active. For instance searching for: gnome clone
Updated by okurz over 2 years ago
- Tags set to ui, ux, beginner, entrace level
- Subject changed from Not possible to search for test suites (again?) using regex, e.g. `^gnome$` to [beginner] Not possible to search for test suites (again?) using regex, e.g. `^gnome$`
- Description updated (diff)