Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Append two additional facts to the graylist #3520

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pkoprda
Copy link
Contributor

@pkoprda pkoprda commented Feb 27, 2025

  • Card ID: CCT-1023

This update appends two additional CPU-related facts to the graylist. The graylist currently includes cpu.cpu_mhz and lscpu.cpu_mhz, but RHEL 9.6 and 10.0 add more CPU facts that also vary frequently.

Copy link
Contributor

@ptoscano ptoscano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not bad, however there is duplicate code/information /o\

Since we are changing this, what about doing a small refactor to make this kind of change easier in the future? What I'm thinking is:

  • make the graylist in FactsDict a class constant, i.e. naming it UPPERCASE_LIKE_THIS,
  • use that contant in the Facts class; interesting bit is that Facts.graylist is a list, but then when used a new set is created from it...

I recommend splitting this in two commit:

  • one commit doing the refactoring for the constant and using it in the other class as set already
  • adding the new facts to the de-duplicated graylist of facts

Thanks!

Copy link
Contributor

@debarshiray debarshiray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The libdnf (Fedora Rawhide, registry.fedoraproject.org/fedora:rawhide) test failed with:

CMake Error at CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 3.5 has been removed from CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.

  Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.

It might be fixed by #3521

pkoprda added 2 commits March 4, 2025 10:43
* Card ID: CCT-1023

Variable for graylist of facts is known to change frequently. To reduce
the code duplication, this commit changes the variable graylist of facts
to class constant, which can be easily used in other classes.
* Card ID: CCT-1023

This update appends two additional CPU-related facts to the graylist.
The graylist currently includes `cpu.cpu_mhz` and `lscpu.cpu_mhz`, but
RHEL 9.6 and 10.0 add more CPU facts that also vary frequently.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants