Project

General

Profile

Actions

Bug #39503

closed

CVEnvs displayed in wrong order in UI due to CVECF priorities not set during initial host registration

Added by Nofar Kirshon 2 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Hosts
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Description of problem:

When a host is first registered with multiple content view environments, all CVECF records get priority: 0. The content_view_environments= setter calls reprioritize_for_content_facet
immediately after super, but for a new (unsaved) content facet, the CVECF join records only exist in memory — not in the database. Since reprioritize_for_content_facet uses find_by (a
database query), it finds nothing and sets no priorities. When content_facet.save! runs later in populate_content_facet, all CVECFs are persisted with the default priority of 0.

Fix: Call reprioritize_for_content_facet again in populate_content_facet after content_facet.save! when the content facet was a new record.

How reproducible:

100%

Is this issue a regression from an earlier version:

no? but not sure how we missed it

Steps to Reproduce:

Create an AK that assigns multiple CVEnvs

register a host

look at myhost.content_view_environment_content_facets

Actual behavior:
All CVECFs have a priority of 0

CVEnvs are displayed in a random order in Web UI

subscription-manager environments --list-enabled shows correct order.

Expected behavior:
Priority should be unique (0, 1, etc)

CVEnvs are displayed in Web UI in the same order as subscription-manager environments --list-enabled

Actions #1

Updated by The Foreman Bot 2 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/11794 added
Actions #2

Updated by The Foreman Bot 2 months ago

  • Fixed in Releases Katello 5.0.0 added
Actions #3

Updated by Anonymous 2 months ago

  • Status changed from Ready For Testing to Closed
Actions #4

Updated by Ian Ballou 2 months ago

  • Category set to Hosts
  • Target version set to Katello 4.21.1
  • Triaged changed from No to Yes
Actions #5

Updated by The Foreman Bot about 1 month ago

  • Fixed in Releases Katello 4.21.1 added
Actions

Also available in: Atom PDF