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

Potential Issues Around Knapsack and Rails.root #1

Open
14 tasks
jeremyf opened this issue Oct 5, 2023 · 0 comments
Open
14 tasks

Potential Issues Around Knapsack and Rails.root #1

jeremyf opened this issue Oct 5, 2023 · 0 comments

Comments

@jeremyf
Copy link
Contributor

jeremyf commented Oct 5, 2023

In Hyku and Hyrax there are long-standing references to Rails.root. This works when Hyku is the base application. However, with Knapsack, we need to consider an alternate approach to Rails.root.

The issue is as follows:

  • Rails.root resolves to the root of the Hyku application
  • Knapsack is intended to be an overlay of that application; meaning if I add a static file in Knapsack we would want Hyku to pick that up.

A proposed solution for Hyku is available here:

We'll also want to add a rubocop to indicate the Rails.root is an anti-pattern.

However, Hyrax also uses Rails.root to reference static files. I used rg Rails.root app lib --files-with-matches | awk '{ print "- [ ] " $1 } to generate the list of files that need reviewing:

  • app/services/hyrax/simple_schema_loader.rb
  • app/services/hyrax/analytics/google.rb
  • app/services/hyrax/analytics/matomo.rb
  • app/services/hyrax/workflow/workflow_importer.rb
  • app/controllers/hyrax/downloads_controller.rb
  • lib/hyrax/configuration.rb
  • lib/hyrax/controlled_vocabulary/importer/language.rb
  • lib/tasks/universal_viewer.rake
  • lib/generators/hyrax/templates/config/initializers/redis_config.rb
  • lib/generators/hyrax/templates/config/initializers/hyrax.rb
  • lib/generators/hyrax/templates/config/initializers/riiif.rb
  • lib/hyrax/arkivo/config.rb
  • lib/hyrax/zotero/config.rb
  • lib/hyrax/specs/capybara.rb

This is repeated in:

jeremyf added a commit to scientist-softserv/adventist_knapsack that referenced this issue Oct 9, 2023
This is now obviated by upstream Hyku.  Prior to this commit, we were
looking in `Rails.root` but we needed to first interogate the Knapsack
and then Rails.root.

Related to:

- samvera/hyku#2010
- samvera/hyku#2012
- #60
- samvera-labs/hyku_knapsack#1
jeremyf added a commit to scientist-softserv/adventist_knapsack that referenced this issue Oct 10, 2023
This is now obviated by upstream Hyku.  Prior to this commit, we were
looking in `Rails.root` but we needed to first interogate the Knapsack
and then Rails.root.

Related to:

- samvera/hyku#2010
- samvera/hyku#2012
- #60
- samvera-labs/hyku_knapsack#1
kirkkwang pushed a commit that referenced this issue Mar 15, 2024
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

No branches or pull requests

1 participant