Skip to content

Version 1.0.1

Compare
Choose a tag to compare
@jcoyne jcoyne released this 24 May 19:19
· 7735 commits to main since this release

Version 1.0.0 was accidentally released from the master branch. In order to correct this we yanked version 1.0.0 and pushed a version from the correct (1-0-stable) branch as 1.0.1.

This release provides a bridge from Sufia 7.3 to Hyrax.

Upgrade Notes

Getting started

  • Upgrade to Rails 5.0.x
  • Replace the sufia gem with hyrax (1.0.0) in your application's Gemfile, and run bundle install
  • Make sure any tweaks made in the Sufia or CC initializer move over into the Hyrax initializer. To do this, copy the Hyrax 1.0.0 initializer to config/initializers/hyrax.rb, then update it to include changes you have made to your CurationConcerns & Sufia initializers (at which point you should be able to safely remove the old initializers)
  • Global search & replace Sufia and CurationConcerns to Hyrax, on file names, folder names, and file contents. Note that while it should be safe to replace 'sufia' with 'hyrax', 'Sufia' with 'Hyrax', and 'CurationConcerns' with 'Hyrax', it is not safe to automate replacement of 'curation_concerns' with 'hyrax'. Lean on version control here to make sure you don't make any changes that will cause problems later. You may find that this process causes some duplicate lines -- go through and remove those now.

Routes

  • Remove Hydra::BatchEdit.add_routes(self)
  • Remove curation_concerns_collections

Models

  • Create a database migration to rename the sufia_features table to hyrax_features
  • Install Hyrax's database migrations: rails hyrax:install:migrations (You may see a bunch of warnings here about Hyrax's migrations looking similar to Sufia's. That's to be expected.)
  • Create a new migration via rails g migration RemoveWorkflowNameFromPermissionTemplates. Make sure it includes the following method definition:
  def change
    remove_column :permission_templates, :workflow_name, :string
  end
  • Run rails db:migrate

Controllers

  • Remove include CurationConcerns::CurationConcernController from all controllers.
  • Ensure that self.curation_concern_type = YourWorkTypeHere comes after include Hyrax::WorksControllerBehavior in your work type controllers
  • Remove include Hyrax::Catalog from app/controllers/catalog_controller.rb
  • Change config.search_builder_class in app/controllers/catalog_controller.rb to equal Hyrax::CatalogSearchBuilder
  • Remove include Hyrax::ApplicationControllerBehavior from app/controllers/application_controller.rb
  • Remove app/controllers/hyrax/admin_controller.rb since the AdminControllerBehavior no longer exists

Views

If you've overridden or created any static pages in your application, you will need to move them from app/views/static/ to app/views/hyrax/static/.

Minter state

  • Install the new database-backed identifier minter (if not already done) via rails generate active_fedora:noid:install
  • Migrate your database again via rails db:migrate
  • Migrate your file-based minter state to the new db-based minter state via rails active_fedora:noid:migrate:file_to_database

Other steps

AdminSet Workflow

  • Workflows changed subtly between Sufia 7.3 and Hyrax such that now an AdminSet has both available workflows and an active workflow. No tools have yet been built to automate mapping workflows into the new structure, so you should make sure workflows are loaded (rails hyrax:workflow:load) and then use the UI to make sure a workflow is selected for each of your AdminSets.
  • Ensure a Hyrax::PermissionTemplate exists for your each of your AdminSets. You can create this for the Default AdminSet via:
permission_template = Hyrax::PermissionTemplate.create!(admin_set_id: "admin_set/default")
Hyrax::Workflow::WorkflowImporter.method(:load_workflow_for).call(permission_template: permission_template)
workflow = Sipity::Workflow.activate!(permission_template: permission_template, workflow_name: Hyrax.config.default_active_workflow_name)
# Run the following steps only for the default AdminSet
permission_template.access_grants.create(agent_type: 'group', agent_id: 'registered', access: 'deposit')
deposit = Sipity::Role.find_by_name!('depositing')
workflow.update_responsibilities(role: deposit, agents: Hyrax::Group.new('registered'))

Data Migration

Sufia 7.3 utilized CurationConcerns 1.7, but Hyrax was created from CurationConcerns 2.0. Collection membership changed direction as part of CC 2.0. Run the data migration script that reverses this membershp on your objects:

rails hyrax:migrate:collections RAILS_ENV=production

Contributing to the Release Notes

As you are migrating your application from Sufia to Hyrax, if you encounter missed steps, please submit an issue to the Hyrax team.