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

remove the indexer initializer generator #4294

Merged
merged 2 commits into from
May 6, 2020
Merged

Conversation

no-reply
Copy link
Contributor

@no-reply no-reply commented Apr 28, 2020

the code this generator injects isn't really necessary (if we want to register
this indexer for the generic Hyrax::Work, we can do it in Hyrax
directly). including it complicates the upgrade process for existing
apps. instead, while we need to manually register indexers for specific
works (maybe we can do this with configuration soon, instead?), inject them into
the hyrax initializer when the work generator runs.

additionally, generate basic metadata into the indexer.

@samvera/hyrax-code-reviewers

tom johnson added 2 commits April 28, 2020 14:40
the code this generator injects isn't really necessary (if we want to register
this indexer for the generic `Hyrax::Work`, we can do it in Hyrax
directly). including it complicates the upgrade process for existing
apps. instead, while we need to manually register indexers for specific
works (maybe we can do this with configuration soon, instead?), inject them into
the hyrax initializer when the work generator runs.
when we generate valkyrie works with hyrax basic metadata, so we should also
generate the indexer with that schema loaded in.
@@ -16,6 +16,7 @@
require 'hyrax/engine'
require 'hyrax/version'
require 'hyrax/inflections'
require 'hyrax/name'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unclear why this is added.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it turned out that actually running this generator and starting an app caused NameError on this module. it seems like it should have just always been there.

@@ -3,7 +3,7 @@
# Generated via
# `rails generate hyrax:work_resource <%= class_name %>`
class <%= class_name %>Indexer < Hyrax::ValkyrieWorkIndexer
Hyrax::ValkyrieIndexer.register self, as_indexer_for: <%= class_name %>
include Hyrax::Indexer(:basic_metadata)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change, will those that ran previous generators need to change their registration logic? What is the process for people to do that? Do we have documentation in the upgrade notes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change, will those that ran previous generators need to change their registration logic?

yes.

What is the process for people to do that? Do we have documentation in the upgrade notes?

this code has never been released (even in an RC), so i think we might be in the clear here? i'm open to counter views on that point, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess i'll also add: they only need to make this change if they want :basic_metadata.

if they do want that, it's likely they've already made this change.

@jeremyf jeremyf merged commit f63b1f1 into master May 6, 2020
@jeremyf jeremyf deleted the valkyrie-indexing-no-gen branch May 6, 2020 14:15
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.

2 participants