Bug #28637

An empty report file doesn't show any headers

Added by Marek Hulán about 1 year ago. Updated 11 months ago.

Target version:
Bugzilla link:
Fixed in Releases:
Found in Releases:


Cloned from

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):

How reproducible:

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

Related to Foreman - Bug #30039: Host - Registered Content Hosts report: "Safemode doesn't allow to access 'report_hraders' on #<Safemode::ScopeObject>"Closed

Associated revisions

Revision bc1362bf (diff)
Added by Marek Hulán 11 months ago

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.


#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 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

#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

Also available in: Atom PDF