Skip to content

Implement similar changes that @cbeer made in https://github.com/sul-… - #2266

Closed
mejackreed wants to merge 1 commit into
masterfrom
appease-webpacker
Closed

Implement similar changes that @cbeer made in https://github.com/sul-…#2266
mejackreed wants to merge 1 commit into
masterfrom
appease-webpacker

Conversation

@mejackreed

Copy link
Copy Markdown
Contributor

…dlss/sul_styles/pull/35/files to support a default sprockets approach that will still support webpacker

This only changes the test app generated.

Comment thread spec/test_app_templates/lib/generators/test_app_generator.rb
@jrochkind

jrochkind commented Mar 19, 2020

Copy link
Copy Markdown
Member

Can you leave a comment, perhaps in source, but at least here, about why empty_directory 'app/assets/images' is necessary to appease webpacker? What difference does it make? And why are there things in app/assets/images to begin with, and why do they need to be deleted?

When trying to debug engine_cart problems, which I've done my fair share of, I find it enormously helpful to have 'breadcrumbs' left explaining why non-obvious things were done. Even more so when wanting to make changes to the setup, to give you a fighting chance of understanding what you might break by changing something.

…dlss/sul_styles/pull/35/files to support a default sprockets approach that will still support webpacker
mejackreed added a commit to geoblacklight/geoblacklight that referenced this pull request Mar 19, 2020
mejackreed added a commit to geoblacklight/geoblacklight that referenced this pull request Mar 19, 2020
mejackreed added a commit to geoblacklight/geoblacklight that referenced this pull request Mar 20, 2020
mejackreed added a commit to geoblacklight/geoblacklight that referenced this pull request Mar 20, 2020
@cdmo

cdmo commented Mar 21, 2020

Copy link
Copy Markdown
Member

I ran rake locally and all the feature specs failed with:

  70) Search Results has for an empty query
      Failure/Error: <%= javascript_include_tag "application" %>

      ActionView::Template::Error:
        Asset `application.js` was not declared to be precompiled in production.
        Declare links to your assets in `app/assets/config/manifest.js`.

          //= link application.js
        and restart your server
      # ./app/views/layouts/blacklight/base.html.erb:15:in `block in ___sers_cdm____esktop_blacklight_app_views_layouts_blacklight_base_html_erb__3329786505906691760_70199829967220'
      # ./app/views/layouts/blacklight/base.html.erb:2:in `___sers_cdm____esktop_blacklight_app_views_layouts_blacklight_base_html_erb__3329786505906691760_70199829967220'
      # ./app/views/layouts/blacklight.html.erb:17:in `___sers_cdm____esktop_blacklight_app_views_layouts_blacklight_html_erb__2742037008966264949_70199877634540'
      # ./spec/features/search_results_spec.rb:62:in `search_for'
      # ./spec/features/search_results_spec.rb:5:in `block (2 levels) in <top (required)>'
      # ------------------
      # --- Caused by: ---
      # Sprockets::Rails::Helper::AssetNotPrecompiled:
      #   Asset `application.js` was not declared to be precompiled in production.
      #   Declare links to your assets in `app/assets/config/manifest.js`.
      #
      #     //= link application.js
      #   and restart your server
      #   ./app/views/layouts/blacklight/base.html.erb:15:in `block in ___sers_cdm____esktop_blacklight_app_views_layouts_blacklight_base_html_erb__3329786505906691760_70199829967220'

Is rake passing specs for everyone else locally on this branch?

@mjgiarlo

Copy link
Copy Markdown
Member

@cdmo 💬

I ran rake locally and all the feature specs failed with:

...

I haven't run it locally w/ this branch, but a hunch: did you regenerate the EngineCart test app after pulling this branch? If so, can you say what Ruby and Rails versions you tested with? (I'm guessing whatever the defaults are when running rake but thought it worth asking.)

@cdmo

cdmo commented Mar 23, 2020

Copy link
Copy Markdown
Member

Started with a completely fresh clone, checked out this branch, ran docker-compose up solr, waited til that was initialized, separate tab ran bundle exec rake. Got 70 failing specs again, all with the same report I got above (the one that says # --- Caused by: --- # Sprockets::Rails::Helper::AssetNotPrecompiled) Maybe just me, I dont know.

EDIT: looks like 2.6.5, going by the DEPRECATED notices in the log, like:
[DEPRECATED] Bundler.clean_system has been deprecated in favor of Bundler.unbundled_system. If you instead want to run the command in the environment before bundler was originally loaded, use Bundler.original_system (called at /Users/cdm32/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/engine_cart-2.3.0/lib/engine_cart/tasks/engine_cart.rake:115)

full log

@mjgiarlo

Copy link
Copy Markdown
Member

Started with a completely fresh clone, checked out this branch, ran docker-compose up solr, waited til that was initialized, separate tab ran bundle exec rake. Got 70 failing specs again, all with the same report I got above (the one that says # --- Caused by: --- # Sprockets::Rails::Helper::AssetNotPrecompiled) Maybe just me, I dont know.

EDIT: looks like 2.6.5, going by the DEPRECATED notices in the log, like:
[DEPRECATED] Bundler.clean_system has been deprecated in favor of Bundler.unbundled_system. If you instead want to run the command in the environment before bundler was originally loaded, use Bundler.original_system (called at /Users/cdm32/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/engine_cart-2.3.0/lib/engine_cart/tasks/engine_cart.rake:115)

full log

I'll give this a spin today, @cdmo, once I'm done responding to reviews of #2263

Thanks!

@mjgiarlo

mjgiarlo commented Mar 27, 2020

Copy link
Copy Markdown
Member

@cdmo @mejackreed I was able to pull this branch and see all specs pass. Here's what I did:

# start off clean
$ rm -rf .internal_test_app Gemfile.lock 
# specify Rails version
$ export RAILS_VERSION=6.0.2.1
# tell EngineCart to skip webpack
$ export ENGINE_CART_RAILS_OPTIONS="--skip-webpack-install"
# install dependencies
$ bundle 
# spin up solr in background
$ docker-compose up -d solr
# run default task (build app, run specs)
$ rake

Worked like a charm.

Incidentally, these are the same steps I've been using as part of work on docker-compose. See also the new documentation for that: https://github.com/projectblacklight/blacklight/wiki/Testing-and-Developing-Blacklight

@mjgiarlo

Copy link
Copy Markdown
Member

@cdmo can you give ☝️ a run-through and confirm it works and is sensible? And then, assuming so, mind re-reviewing? Want to make sure we have 💯 approvals before merging.

@mjgiarlo
mjgiarlo requested a review from cdmo March 27, 2020 20:48
@mjgiarlo

Copy link
Copy Markdown
Member

@cdmo Amending what I wrote above: these steps worked because the Rails server did not get spun up. Running rake blacklight:server instead of just rake shows that the changes in this branch don't yet 💯 fix the problem. @mejackreed and I are pairing now to see if we can make improvements.

@mejackreed

Copy link
Copy Markdown
Contributor Author

Closing this for now. I think we have some other options to resolve Blacklight / Rails 6 / Webpacker

@mejackreed mejackreed closed this Mar 27, 2020
@mejackreed
mejackreed deleted the appease-webpacker branch March 27, 2020 21:19
mjgiarlo added a commit that referenced this pull request Mar 28, 2020
Now when the test app is generated with Rails 6, the `blacklight:server` actually spins up instead of screaming about webpacker. Related to #2266
mjgiarlo added a commit that referenced this pull request Mar 28, 2020
Now when the test app is generated with Rails 6, the `blacklight:server` actually spins up instead of screaming about webpacker. Related to #2266
mjgiarlo added a commit that referenced this pull request Mar 30, 2020
Now when the test app is generated with Rails 6, the `blacklight:server` actually spins up instead of screaming about webpacker. Related to #2266
mjgiarlo added a commit that referenced this pull request Mar 30, 2020
Now when the test app is generated with Rails 6, the `blacklight:server` actually spins up instead of screaming about webpacker. Related to #2266
mjgiarlo added a commit that referenced this pull request Mar 30, 2020
Now when the test app is generated with Rails 6 (and Sprockets 4), the `blacklight:server` actually spins up instead of screaming about webpacker. Related to #2266
mjgiarlo added a commit that referenced this pull request Mar 30, 2020
Now when the test app is generated with Rails 6 (and Sprockets 4), the `blacklight:server` actually spins up instead of screaming about webpacker. Related to #2266
mjgiarlo added a commit that referenced this pull request Mar 30, 2020
Now when the test app is generated with Rails 6 (and Sprockets 4), the `blacklight:server` actually spins up instead of screaming about webpacker. Related to #2266
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants