Feature #31147
closedExtend StatusCalculator to make use of 64 bits
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.
Updated by Lukas Zapletal about 4 years ago
- Related to Feature #31145: Create ReportTranscript model, import API and Puppet importer and view API added
Updated by The Foreman Bot about 4 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/8118 added
Updated by Lukas Zapletal almost 4 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman|ef4f82592e47b1cd5a833948fd55e699f778c741.
Updated by The Foreman Bot over 3 years ago
- Pull request https://github.com/theforeman/foreman/pull/8406 added
Updated by The Foreman Bot over 2 years ago
- Pull request https://github.com/theforeman/foreman/pull/9184 added