Bug #16565

Searches with global parameters and overrides returning incorrect results

Added by Tomer Brisker almost 2 years ago. Updated 7 days ago.

Status:Closed
Priority:Normal
Assignee:Tomer Brisker
Category:Search
Target version:1.13.0
Difficulty: Team Backlog:
Triaged: Fixed in Releases:
Bugzilla link:1372069 Found in Releases:
Pull request:https://github.com/theforeman/foreman/pull/3847

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1372069
Description of problem:
Searches with global parameters not working as expected. The hammer host list --search "params.globalparameter = value1" returns all hosts even when we override these values for some hosts. From WebUI also we get same results.

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

How reproducible:
Everytime

Steps to Reproduce:
1. hammer global-parameter set --name myparam --value one

2. hammer host set-parameter --host-id 3 --name myparam --value two

3. hammer host list --search "params.myparam = two"
---|-------------------|------------------|------------|-----------------|------------------
ID | NAME | OPERATING SYSTEM | HOST GROUP | IP | MAC
---|-------------------|------------------|------------|-----------------|------------------
3 | testvm.labs.local | RedHat 7.2 | provhg | 192.168.124.100 | 52:54:00:79:93:27
---|-------------------|------------------|------------|-----------------|------------------

4. hammer host list --search "params.myparam = one"
---|----------------------|------------------|------------|-----------------|------------------
ID | NAME | OPERATING SYSTEM | HOST GROUP | IP | MAC
---|----------------------|------------------|------------|-----------------|------------------
1 | satellite.labs.local | RedHat 7.2 | | 192.168.124.10 | 52:54:00:98:78:a0
3 | testvm.labs.local | RedHat 7.2 | provhg | 192.168.124.100 | 52:54:00:79:93:27
---|----------------------|------------------|------------|-----------------|------------------

Expected results: Hosts with values overridden should not be listed


Related issues

Related to Foreman - Bug #17272: Searches on `parameters` with "!=" does not work as expected Closed 11/08/2016
Copied to Foreman - Bug #16600: Searches with global parameters and overrides returning i... Rejected 09/15/2016

Associated revisions

Revision a29f3e39
Added by Tomer Brisker almost 2 years ago

Fixes #16565 - Correct host search by parameters

Overrides for parameters values caused incorrect results for when
searching by parameter value. This commit fixes those results, and
improves the handling of parameter priorities in general. A new rake
task, `parameters:reset_priorities` is introduced that should be invoked
every time priorities are changed to update to the correct values.

Revision c53daba1
Added by Tomer Brisker almost 2 years ago

Fixes #16565 - Correct host search by parameters

Overrides for parameters values caused incorrect results for when
searching by parameter value. This commit fixes those results, and
improves the handling of parameter priorities in general. A new rake
task, `parameters:reset_priorities` is introduced that should be invoked
every time priorities are changed to update to the correct values.

(cherry picked from commit a29f3e3937ac366d3e16ac40f395189a552f4e27)

History

#1 Updated by Tomer Brisker almost 2 years ago

  • Priority changed from High to Normal

#2 Updated by The Foreman Bot almost 2 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3847 added

#3 Updated by Anonymous almost 2 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Dominic Cleal almost 2 years ago

  • Subject changed from [BUG] Searches with global parameters not working as expected to Searches with global parameters and overrides returning incorrect results
  • Legacy Backlogs Release (now unused) set to 189

Contains priorities schema (numbering) change, so will split into a separate 1.13.x compatible fix.

#5 Updated by Dominic Cleal almost 2 years ago

  • Copied to Bug #16600: Searches with global parameters and overrides returning incorrect results added

#6 Updated by Daniel Lobato Garcia almost 2 years ago

  • Target version set to 1.5.2

#7 Updated by Dominic Cleal almost 2 years ago

  • Legacy Backlogs Release (now unused) changed from 189 to 160

The priority changes are necessary to fix missing org/loc entries, they're not just a refactoring. Since it's a schema change, I'm moving it forward to the .0 release.

#8 Updated by Tomer Brisker over 1 year ago

  • Related to Bug #17272: Searches on `parameters` with "!=" does not work as expected added

Also available in: Atom PDF