Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ Add handling for Knapsack theme overrides #2010

Merged
merged 1 commit into from
Oct 5, 2023

Commits on Oct 4, 2023

  1. ♻️ Add handling for Knapsack theme overrides

    Prior to this commit, we were looking for themes yaml files relative to
    the directory of the spawning script.  For Hyku that was always the
    `Rails.root` directory.  However, when running specs in Knapsack, that
    directory was `Knapsack::Engine.root`.
    
    This unearthed a potential configuration issue; namely that we want
    Knapsack's to control what themes are available, meaning we don't want
    to require amending Hyku's themes.
    
    So, we introduce a mechanism for looking up files first in the Knapsack
    then in Hyku.
    
    I discovered this bug in the specs for knapsack (below is the *Error stack trace*)
    
    <details>
    <summary>Error stack trace</summary>
    
    ```
    2) Hyrax::Admin::AppearancesController with an administrator GET #show assigns the requested site as @site
         Failure/Error: get :show, params: {}
    
         Errno::ENOENT:
           No such file or directory @ rb_sysopen - config/home_themes.yml
         # /usr/local/bundle/gems/psych-3.3.4/lib/psych.rb:582:in `initialize'
         # /usr/local/bundle/gems/psych-3.3.4/lib/psych.rb:582:in `open'
         # /usr/local/bundle/gems/psych-3.3.4/lib/psych.rb:582:in `unsafe_load_file'
         # ./hyrax-webapp/app/controllers/hyrax/admin/appearances_controller.rb:19:in `show'
         # /usr/local/bundle/gems/rails-controller-testing-1.0.5/lib/rails/controller/testing/template_assertions.rb:62:in `process'
         # /usr/local/bundle/gems/devise-4.9.2/lib/devise/test/controller_helpers.rb:35:in `block in process'
         # /usr/local/bundle/gems/devise-4.9.2/lib/devise/test/controller_helpers.rb:104:in `catch'
         # /usr/local/bundle/gems/devise-4.9.2/lib/devise/test/controller_helpers.rb:104:in `_catch_warden'
         # /usr/local/bundle/gems/devise-4.9.2/lib/devise/test/controller_helpers.rb:35:in `process'
         # /usr/local/bundle/gems/rails-controller-testing-1.0.5/lib/rails/controller/testing/integration.rb:16:in `block (2 levels) in <module:Integration>'
         # ./spec/controllers/hyrax/hyrax/admin/appearances_controller_spec.rb:31:in `block (4 levels) in <top (required)>'
         # /usr/local/bundle/gems/webmock-3.19.1/lib/webmock/rspec.rb:39:in `block (2 levels) in <top (required)>'
         # ./hyrax-webapp/spec/support/multitenancy_metadata.rb:50:in `block (2 levels) in <top (required)>'
         # /usr/local/bundle/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:124:in `block in run'
         # /usr/local/bundle/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `loop'
         # /usr/local/bundle/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `run'
         # /usr/local/bundle/gems/rspec-retry-0.6.2/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
         # /usr/local/bundle/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:37:in `block (2 levels) in setup'
         # ./spec/spec_helper.rb:10:in `block (2 levels) in <top (required)>'
    ```
    
    </details>
    
    Related to:
    
    - #2007
    - #2008
    
    The above two commits will require some reconciliation once this is incorporated.
    jeremyf committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    5e0cc2c View commit details
    Browse the repository at this point in the history