Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lazy migrate sipity entity with work
When lazy migration is used, the sipity entity cannot be found for works which are not yet migrated. Valkyrie resources have a `proxy_for_global_id` with the format: `gid://hyku/Hyrax::ValkyrieGlobalIdProxy/2f6da5dd-9314-421f-b0dd-fda84fec9ee3` while prior works used the model name such as: `gid://hyku/GenericWork/2f6da5dd-9314-421f-b0dd-fda84fec9ee3`. This commit introduces a lazy migration of the sipity entity via a job which is submitted after a work is migrated to valkyrie via the Freyja persister. Prior work in pull request samvera/hyku#2471 added some overrides in Hyku to resolve the sipity entity issues. These changes still needs to be backported. The prior work includes these changes: The MigrateResourceService introduced a migration of the entity along with the work's migration. This service is needed for direct migration calls, but is not adequate for lazy migration, as the Freyja persister does not call it for the work itself that was just migrated. Hyku overrides to sipity.rb support cases where the entity is not yet migrated and lazy migration is in use. This is necessary because the solr_document is used to find the Sipity::Entity. Due to the model mapping found in the solr document, the Entity method searches for the entity with the model name. This is problematic when the entity is not yet migrated and the entity is searched with a GenericWorkResource model rather than the model.
- Loading branch information