Project

General

Profile

Bug #28637

An empty report file doesn't show any headers

Added by Marek Hulán 7 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Reporting
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:

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

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 6 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.

History

#1 Updated by The Foreman Bot 7 months 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 6 months ago

  • Fixed in Releases 2.1.0 added

#3 Updated by Marek Hulán 6 months ago

  • Status changed from Ready For Testing to Closed

#4 Updated by Tomer Brisker 5 months ago

  • Category changed from Statistics to Reporting

#5 Updated by Tomer Brisker 2 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