Assets precompilation failures in foreman/develop

Hi foreman devs,

On Thursday I merged https://github.com/theforeman/foreman/commit/418e709df58c4114ddf77fc88aed8da31f1e63ff.
This commit applies Rails default environment configurations to our
project, what you get after running 'rails new'.

One of the new options in the development environment is:

  • config.assets.raise_runtime_errors = true

This setting:

  1. Precompiles assets on development
  2. Raises errors when an asset is missing on the precompile
    list and is required. Before, Rails would work on development
    but on production it would fail.

Overall I think the change is positive because it forces us to ensure
assets are precompiled and we follow best practices. It raises an
error when we add '/assets' to the path of an asset, which is
unnecessary on Sprockets 3, for instance.

I tested that PR using the author branch w/o pulling Patternfly
and it worked. However, with Patternfly it raises one of these errors.
Moreover, assets from plugins need to be added to the
config.assets.precompile list in order to be used, but they were not.

I fixed this through https://github.com/theforeman/foreman/pull/3031,
which adds plugin asset paths to assets.precompile, and other minor
errors. An equivalent fix in Katello to add Bastion assets to precompile
is here: https://github.com/Katello/katello/pull/5696

Please also notice that debugging javascript becomes much harder when
assets are precompiled, so remember to turn this setting off to
not precompile javascript and debug normally.

In case you see any errors you can either work out of that branch, or
simply disable config.assets.raise_runtime_errors = false on
/config/environments/development.rb

In retrospective, I should have been more careful and tested that
setting with more plugins & Patternfly on, but I didn't foresee this.
Sorry for the havoc, and I hope it won't affect you at all with the
patches I posted above. Please reply to these PRs if you see any other
problems.

··· -- Daniel Lobato Garcia

@dLobatog
blog.daniellobato.me
daniellobato.me

GPG: http://keys.gnupg.net/pks/lookup?op=get&search=0x7A92D6DD38D6DE30
Keybase: https://keybase.io/elobato

> Hi foreman devs,
>
> On Thursday I merged
> https://github.com/theforeman/foreman/commit/418e709df58c4114ddf77fc88aed8da31f1e63ff
> .
> This commit applies Rails default environment configurations to our
> project, what you get after running 'rails new'.
>
> One of the new options in the development environment is:
> + config.assets.raise_runtime_errors = true
>
> This setting:
> 1. Precompiles assets on development
> 2. Raises errors when an asset is missing on the precompile
> list and is required. Before, Rails would work on development
> but on production it would fail.
>
> Overall I think the change is positive because it forces us to ensure
> assets are precompiled and we follow best practices. It raises an
> error when we add '/assets' to the path of an asset, which is
> unnecessary on Sprockets 3, for instance.
>
> I tested that PR using the author branch w/o pulling Patternfly
> and it worked. However, with Patternfly it raises one of these errors.
> Moreover, assets from plugins need to be added to the
> config.assets.precompile list in order to be used, but they were not.
>
> I fixed this through https://github.com/theforeman/foreman/pull/3031,
> which adds plugin asset paths to assets.precompile, and other minor
> errors. An equivalent fix in Katello to add Bastion assets to precompile
> is here: https://github.com/Katello/katello/pull/5696
>
> Please also notice that debugging javascript becomes much harder when
> assets are precompiled, so remember to turn this setting off to
> not precompile javascript and debug normally.
>

can we use something like https://github.com/vhyza/sass-rails-source-maps ?

··· On Sat, Jan 9, 2016 at 12:58 PM, Daniel Lobato Garcia wrote:

In case you see any errors you can either work out of that branch, or
simply disable config.assets.raise_runtime_errors = false on
/config/environments/development.rb

In retrospective, I should have been more careful and tested that
setting with more plugins & Patternfly on, but I didn’t foresee this.
Sorry for the havoc, and I hope it won’t affect you at all with the
patches I posted above. Please reply to these PRs if you see any other
problems.


Daniel Lobato Garcia

@dLobatog
blog.daniellobato.me
daniellobato.me

GPG: http://keys.gnupg.net/pks/lookup?op=get&search=0x7A92D6DD38D6DE30
Keybase: https://keybase.io/elobato


You received this message because you are subscribed to the Google Groups
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

The Katello unit tests and thus PR testing is back online after this
multi-day outage. This also means that the Rails 4 packaging efforts for
packages that live in katello-packaging will resume. Thanks to those who
jumped on the various PRs to review and get this issue fixed and developers
unblocked.

Eric

··· On Sat, Jan 9, 2016 at 5:58 AM, Daniel Lobato Garcia wrote:

Hi foreman devs,

On Thursday I merged
https://github.com/theforeman/foreman/commit/418e709df58c4114ddf77fc88aed8da31f1e63ff
.
This commit applies Rails default environment configurations to our
project, what you get after running ‘rails new’.

One of the new options in the development environment is:

  • config.assets.raise_runtime_errors = true

This setting:

  1. Precompiles assets on development
  2. Raises errors when an asset is missing on the precompile
    list and is required. Before, Rails would work on development
    but on production it would fail.

Overall I think the change is positive because it forces us to ensure
assets are precompiled and we follow best practices. It raises an
error when we add ‘/assets’ to the path of an asset, which is
unnecessary on Sprockets 3, for instance.

I tested that PR using the author branch w/o pulling Patternfly
and it worked. However, with Patternfly it raises one of these errors.
Moreover, assets from plugins need to be added to the
config.assets.precompile list in order to be used, but they were not.

I fixed this through https://github.com/theforeman/foreman/pull/3031,
which adds plugin asset paths to assets.precompile, and other minor
errors. An equivalent fix in Katello to add Bastion assets to precompile
is here: https://github.com/Katello/katello/pull/5696

Please also notice that debugging javascript becomes much harder when
assets are precompiled, so remember to turn this setting off to
not precompile javascript and debug normally.

In case you see any errors you can either work out of that branch, or
simply disable config.assets.raise_runtime_errors = false on
/config/environments/development.rb

In retrospective, I should have been more careful and tested that
setting with more plugins & Patternfly on, but I didn’t foresee this.
Sorry for the havoc, and I hope it won’t affect you at all with the
patches I posted above. Please reply to these PRs if you see any other
problems.


Daniel Lobato Garcia

@dLobatog
blog.daniellobato.me
daniellobato.me

GPG: http://keys.gnupg.net/pks/lookup?op=get&search=0x7A92D6DD38D6DE30
Keybase: https://keybase.io/elobato


You received this message because you are subscribed to the Google Groups
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Eric D. Helms
Red Hat Engineering
Ph.D. Student - North Carolina State University