Project

General

Profile

Actions

Feature #31147

closed

Extend StatusCalculator to make use of 64 bits

Added by Lukas Zapletal over 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Reporting
Target version:
-
Fixed in Releases:
Found in Releases:

Description

ConfigReportStatusCalculator class is too tightly coupled with ConfigReport (using MAX and other constants). This needs to be decoupled there is no reason to have it like that, this will also enable using this class in the modernized report engine.

Also we currently do not indicate that the maximum number has been reached (e.g. 63 currently for puppet). There should be a helper method that returns numbers as strings returning "63+" in case the ceiling is reached. This should be used in templates to render those number correctly so users can actually recognize this hidden fact.

Next up, status is a "BIG INT" in our database schema which is 64 bits however currently the class does not make use of all bits for some reason: 36 bits are used for some strange reason in Puppet case. This will allow larger numbers. Migration must be done to convert current reports into the wider format.

Finally, there is an existing index named index_reports_on_status on the status column, but this is useless - this will never be used since scoped_search use bitwise shift and and operators: https://github.com/wvanbergen/scoped_search/blob/6fe6b86c223d7ba8eb14207bae8f4c28f676d9d0/lib/scoped_search/query_builder.rb#L343

In order to use an index, it would have to be a dynamic index on (status >> 8) but this can't be done since it is unknown how many bits are used in each plugin. The index should be simply dropped as unused.


Related issues 1 (0 open1 closed)

Related to Foreman - Feature #31145: Create ReportTranscript model, import API and Puppet importer and view APIRejectedLukas ZapletalActions
Actions #1

Updated by Lukas Zapletal over 3 years ago

  • Related to Feature #31145: Create ReportTranscript model, import API and Puppet importer and view API added
Actions #2

Updated by Lukas Zapletal over 3 years ago

  • Description updated (diff)
Actions #3

Updated by The Foreman Bot over 3 years ago

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

Updated by The Foreman Bot over 3 years ago

  • Fixed in Releases 2.4.0 added
Actions #5

Updated by Lukas Zapletal over 3 years ago

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

Updated by The Foreman Bot about 3 years ago

  • Pull request https://github.com/theforeman/foreman/pull/8406 added
Actions #7

Updated by The Foreman Bot about 2 years ago

  • Pull request https://github.com/theforeman/foreman/pull/9184 added
Actions

Also available in: Atom PDF