Bug 1205386

Summary: Assets are not precompiled on appliance builds
Product: Red Hat CloudForms Management Engine Reporter: Jan Krocil <jkrocil>
Component: BuildAssignee: Dávid Halász <dhalasz>
Status: CLOSED ERRATA QA Contact: Dave Johnson <dajohnso>
Severity: medium Docs Contact:
Priority: high    
Version: 5.4.0CC: dclarizi, jhardy, jrafanie, obarenbo, tcarlin
Target Milestone: GA   
Target Release: 5.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-06-16 12:54:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Precompile output in dev setup in production environment none

Description Jan Krocil 2015-03-24 19:59:37 UTC
Description of problem:
Assets are not precompiled; production.log is full of INFO-level "Compiled XY" messages.

Version-Release number of selected component (if applicable):
5.4.0.0.13

How reproducible:
Always

Steps to Reproduce:
-

Actual results:
Assets are not precompiled.

Expected results:
Assets should be precompiled in the build.

Additional info:
...
[----] I, [2015-03-24T14:45:38.025683 #2284:130dea4]  INFO -- : Compiled less.min.js  (3ms)  (pid 2284)
[----] I, [2015-03-24T14:45:44.073037 #2284:130dea4]  INFO -- : Compiled miq_jquery_ujs_rails3.js  (0ms)  (pid 2284)
[----] I, [2015-03-24T14:45:44.297898 #2284:130dea4]  INFO -- : Compiled jquery.form.js  (0ms)  (pid 2284)
[----] I, [2015-03-24T14:45:44.680239 #2284:130dea4]  INFO -- : Compiled jquery.cookie.js  (0ms)  (pid 2284)
[----] I, [2015-03-24T14:45:44.869243 #2284:130dea4]  INFO -- : Compiled dhtmlx_gpl_36/dhtmlxcontainer.js  (1ms)  (pid 2284)
[----] I, [2015-03-24T14:45:45.552775 #2284:130dea4]  INFO -- : Compiled dynatree_1.2.4/jquery.dynatree.js  (1ms)  (pid 2284)
[----] I, [2015-03-24T14:45:46.365702 #2284:130dea4]  INFO -- : Compiled miq_dynatree.js  (0ms)  (pid 2284)
...

Comment 2 Joe Rafaniello 2015-03-24 21:00:27 UTC
Created attachment 1005996 [details]
Precompile output in dev setup in production environment

included/excluded assets from precompilation

Comment 3 Joe Rafaniello 2015-03-24 21:07:29 UTC
According to this [1], we precompile all assets in app/assets to public/assets that are NOT *.js or *.css.  The only .js or css that are precompiled are productization.js, productization.css, application.js, application.css.

[1]
https://github.com/ManageIQ/manageiq/blob/master/vmdb/lib/vmdb/productization.rb#L30-31

Dan, can you have someone confirm that none of the items excluded from precompile are needed to be precompiled?  I don't know WHY all js and css are excluded but NOT application and productization.  

I ran this locally after linking in the cfme_productization master branch with my current upstream master and attached the output.

DEBUG_PRECOMPILE=true RAILS_ENV=production be rake assets:clean assets:precompile

Comment 4 Joe Rafaniello 2015-03-24 21:13:48 UTC
At this point, it appears the build rpm seems to be following the rule as mentioned in comment 3.  Once we know what is supposed to be compiled, we can make sure the build results comply with any changes to the rules as to what gets precompiled.

Comment 6 CFME Bot 2015-04-07 12:20:45 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/1b2273f45111ff31e54758b054228e35f6a4a746

commit 1b2273f45111ff31e54758b054228e35f6a4a746
Author:     Dávid Halász <dhalasz>
AuthorDate: Tue Mar 31 15:31:31 2015 +0200
Commit:     Dávid Halász <dhalasz>
CommitDate: Tue Mar 31 15:35:20 2015 +0200

    Moved separately included JS files into application.js with //= require
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1205386

 vmdb/app/assets/javascripts/application.js       | 22 ++++++++++++++++++++
 vmdb/app/views/layouts/_global_header.html.haml  | 26 ------------------------
 vmdb/app/views/layouts/application.html.haml     |  1 -
 vmdb/app/views/layouts/login.html.haml           | 16 ---------------
 vmdb/app/views/vm_common/console_spice.html.haml |  1 -
 vmdb/app/views/vm_common/console_vnc.html.haml   |  1 -
 6 files changed, 22 insertions(+), 45 deletions(-)

Comment 8 Thom Carlin 2015-05-04 21:17:05 UTC
Verified in 5.4.0.0.24.20150427192818_1fd9e49

Comment 10 errata-xmlrpc 2015-06-16 12:54:39 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://rhn.redhat.com/errata/RHBA-2015-1100.html