Listing reports for a host via API/hammer consumes large amount of memory
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1324461
Description of problem:
Depending on the size of reports for a host, the request for the reports
for a host via API/hammer consumes large amount of memory.
the system needs to have reasonable history of puppet reports in order to reporduce the issue
Steps to Reproduce:
1. curl -k -u admin:changeme -H "Accept:application/json"\
The passenger process starts consuming a lot of memory and it takes tens of minuts to finish (if the server doesn't fail on insufficient amount of memory before it finishes).
The request returns reports for a host
Fixes #14503 - don't join reports with the logs and resources explicitly in API
Using `.includes(:logs => [:message, :source])` in the search scope
for reports caused serious performance issues (ending up with server
taking all of its memory). I've found no reason for the `includes` to
actually be there (we don't render the logs in the views) and should
be safe to just remove it.