Bug #25017

Searching by user with ~ is not properly handled.

Added by Adam Ruzicka over 3 years ago. Updated over 2 years ago.

Target version:
Bugzilla link:


Cloned from

Description of problem:

While testing bz 1468388 i noticed that the ~ operator is not handled properly

Version-Release number of selected component (if applicable):

How reproducible: Always

Steps to Reproduce:
1. Create multiple users (eng-user1, eng-user2, bob, sam)
2. Perform some tasks with each of the users.
3. Monitor -> Tasks.
4. Search user ~ eng

Actual results:
Empty search results

Expected results:
Tasks run by users with "eng" anywhere in their user name are returned. See docs [1] "... If no wildcard is specified, the string is treated as if surrounded by wildcards: rhel7"

Additional info:
The workaround here is to add wildcards to the search like:
user ~ eng-*

This could be an issue for customer who use usernames that contain other information they wish to search on, other then a literal username. For example all service accounts may be prefixed by "serv-servname-".

Associated revisions

Revision c2615b8f (diff)
Added by Adam Ruzicka over 2 years ago

Fixes #25017 - Support all operators for search tasks by user (#363)

Apparently when using an alias like 'user' (without the dot), it makes
scoped search pass anything starting with 'user.' into the external
search method. For this reason, we have to do another round of checking
if the key is actually allowed for searching.

The issue doesn't happen with aliases in the dot format (user.login).


#1 Updated by The Foreman Bot over 3 years ago

  • Assignee set to Adam Ruzicka
  • Status changed from New to Ready For Testing
  • Pull request added

#2 Updated by The Foreman Bot over 2 years ago

  • Fixed in Releases foreman-tasks-0.17.1 added

#3 Updated by Marek Hulán over 2 years ago

  • Subject changed from Searching by user with ~ is not properly handled. to Searching by user with ~ is not properly handled.
  • Fixed in Releases foreman-tasks-0.16.2 added

#4 Updated by Anonymous over 2 years ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF