Project

General

Profile

action #53402

Not possible to search for test suites (again?) using regex, e.g. `^gnome$`

Added by okurz about 2 years ago. Updated about 1 year ago.

Status:
Workable
Priority:
Low
Assignee:
-
Category:
Concrete Bugs
Target version:
Start date:
2019-06-21
Due date:
% Done:

0%

Estimated time:
Difficulty:

Description

Steps to reproduce

Problem

Is this a regression from https://github.com/os-autoinst/openQA/pull/2089 or https://github.com/os-autoinst/openQA/pull/2084 ?


Related issues

Related to openQA Project - action #51719: "New Test Suite " button in admin/test_suites can not be used with filter Resolved2019-05-21

Related to openQA Project - action #52232: UI: search for testsuite settings only on current page vs. only 100 jobs per page possibleResolved2019-05-28

History

#1 Updated by okurz about 2 years ago

  • Related to action #51719: "New Test Suite " button in admin/test_suites can not be used with filter added

#2 Updated by okurz about 2 years ago

  • Related to action #52232: UI: search for testsuite settings only on current page vs. only 100 jobs per page possible added

#3 Updated by mkittler about 2 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.

#4 Updated by mkittler about 2 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.

#5 Updated by mkittler almost 2 years ago

  • Assignee deleted (mkittler)

#6 Updated by okurz over 1 year ago

  • Status changed from New to Workable

#7 Updated by ilausuch about 1 year 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

#8 Updated by okurz about 1 year ago

  • Target version set to future

Also available in: Atom PDF