Bug 1658566 - [RFE] Generated report file has MIME type text/plain
Summary: [RFE] Generated report file has MIME type text/plain
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Reporting
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 6.7.0
Assignee: satellite6-bugs
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
: 1677618 1700009 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-12 12:29 UTC by Lukáš Hellebrandt
Modified: 2023-12-15 16:16 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-14 13:23:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 25732 0 Normal Closed Generated report file has MIME type text/plain 2020-11-23 02:56:40 UTC
Red Hat Knowledge Base (Solution) 5496351 0 None None None 2020-10-18 13:47:33 UTC
Red Hat Product Errata RHSA-2020:1454 0 None None None 2020-04-14 13:23:59 UTC

Internal Links: 1701062

Description Lukáš Hellebrandt 2018-12-12 12:29:28 UTC
Description of problem:
Generated report file has MIME type text/plain rather than text/csv (as opposed to e.g. exported host list [Hosts -> All Hosts -> Export] which is correctly text/csv).

Version-Release number of selected component (if applicable):
Tried on Sat 6.5 snap 7

How reproducible:
Deterministic

Steps to Reproduce:
1. Monitor -> Report Templates
2. Click Generate for some template
3. Submit

Actual results:
Download starts, type is shown as text/plain

Expected results:
Download starts, type is shown as text/csv

Comment 3 Marek Hulan 2018-12-19 13:40:19 UTC
For reports that use report_render macro this can be achieved quite easily. For any custom report, this is hard to autodetect as the result does not have to be csv. We'd need let user specify the mime type on template level or even during generating the report. It would probably have to be free text field. Let's limit scope of this RFE to only reports shipped in the product which all use the macro.

Comment 4 Marek Hulan 2018-12-19 13:41:03 UTC
Created redmine issue https://projects.theforeman.org/issues/25732 from this bug

Comment 7 Bryan Kearney 2019-01-21 09:03:36 UTC
Upstream bug assigned to akarsale

Comment 8 Bryan Kearney 2019-01-21 09:03:38 UTC
Upstream bug assigned to akarsale

Comment 9 Lukáš Hellebrandt 2019-02-18 09:17:58 UTC
*** Bug 1677618 has been marked as a duplicate of this bug. ***

Comment 11 Lukáš Hellebrandt 2019-04-15 15:11:04 UTC
*** Bug 1700009 has been marked as a duplicate of this bug. ***

Comment 13 Bryan Kearney 2019-10-09 02:02:37 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25732 has been resolved.

Comment 14 Lukáš Hellebrandt 2020-01-16 13:30:27 UTC
This BZ is similar to bug 170062 which I failed. I'm failing this one for the same reasons:

---

This basically works, but there are issues for templates that don't use the report_render macro:

1) Downloaded files have the file extension of ".text" rather than expected ".txt"
2) The format selection field is greyed out (as expected) with the value of "CSV" selected (which is confusing, the resulting file is not a CSV)
3) I think it should be possible to set MIME type to all reports, not just those that contain string "report_render" - even if it doesn't change the actual file contents, the MIME type and extension should be selectable (for instance to tell the browser how to treat the downloaded file)

Also, I think it should be possible to select TXT format. It's not possible now and I'd go as far as calling it regression because previous versions (only) supported generating .txt reports.

One more point, Marek mentioned he wants available formats to be a property of each template. This is not the case.

Comment 15 Lukáš Hellebrandt 2020-01-16 13:32:17 UTC
* bug 1701062

Comment 16 Lukáš Hellebrandt 2020-01-17 12:34:53 UTC
After discussion with Marek, I am verifying this and filing a BZ against 1) because while there is no standard specifying text file extension, ".txt" is commonly used.

Marek narrowed the scope of this BZ to only those shipped with Satellite in comment 3. All the shipped reports use macro report_render. Points 1, 2, 3 are all about macros that don't use it. Also, point 3) can be bypassed by writing the macro in a comment.

Furthermore, while the behavior change might be unexpected and I think it would be better to allow TXT format to be selected, it's OK to remove this behavior in favor of the enhancement.

Comment 19 errata-xmlrpc 2020-04-14 13:23:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:1454


Note You need to log in before you can comment on or make changes to this bug.