Bug #28637
An empty report file doesn't show any headers
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1705097
Description of problem:
When you generate a report template, it doesn't show any CSV headers (name, label, severity, etc...) on the top of the file if no results are found. This is just a blank file and is confusing as it makes one think the file wasn't generated correctly, also it may break automation that users build around this.
We should keep the headers on the file even if its blank
Version-Release number of selected component (if applicable):
6.5.0
How reproducible:
Always
Steps to Reproduce:
1.Navigate to Report Templates
2.Click "Generate" for applicable errata and search with a host that has no errata applicable (name = myhost).
3.view blank report
Actual results:
report is blank
Expected results:
report has headers
Additional info:
Related issues
Associated revisions
History
#1
Updated by The Foreman Bot about 1 year ago
- Assignee set to Marek Hulán
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/community-templates/pull/675 added
#2
Updated by The Foreman Bot 11 months ago
- Fixed in Releases 2.1.0 added
#3
Updated by Marek Hulán 11 months ago
- Status changed from Ready For Testing to Closed
Applied in changeset community-templates|bc1362bf712971658ac6d63c661f3841ab727046.
#4
Updated by Tomer Brisker 11 months ago
- Category changed from Statistics to Reporting
#5
Updated by Tomer Brisker 8 months ago
- Related to Bug #30039: Host - Registered Content Hosts report: "Safemode doesn't allow to access 'report_hraders' on #<Safemode::ScopeObject>" added
Fixes #28637 - set minimal headers for empty reports
When the report does not render any row, resulting file does not have
any headers. This can be confusing for users, so render_headers macro
was added. It should specify column names that user should always see.
In case some columns are added dynamically, and report_row adds some
additional columns, they are added on demand. Meaning, if we iterate
over some data, new columns can be still added.