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

Refactor AdminSetCreateService to work with both AdminSet and AdministrativeSet #5224

Merged
merged 11 commits into from
Oct 28, 2021

Conversation

elrayle
Copy link
Contributor

@elrayle elrayle commented Oct 25, 2021

This is part of the work to address Issue #5130 (Val MVP: Create AdministrativeSet as a valkyrie resource through UI ).

Refactors:

  • move creation process out of deprecated #create_default_admin_set method to private #create_default_admin_set! method
  • add call! and create! returning a Hyrax::AdministrativeSet instead of Boolean as returned by #call and #create
  • methods work with Hyrax::AdministrativeSet by default, but continue to support ActiveFedora AdminSet
  • always use FactoryBot before build and create

@samvera/hyrax-code-reviewers

@elrayle elrayle marked this pull request as ready for review October 25, 2021 20:09
@elrayle
Copy link
Contributor Author

elrayle commented Oct 25, 2021

This PR is ready for review in spite of the CCI failures. The failures are the same as those seen on other PRs. Branch storage_failure which is main branch + a comment has the same failures.

This is in prep of the next step that will be able to create a `Hyrax::AdministrativeSet`.
Since this method doesn’t do any of the real work, only check that it passes through.  The real work will be tested in the method that performs the work.
Since this method doesn’t do any of the real work, only check that it passes through.  The real work will be tested in the method that performs the work.
update comments to reference `Hyrax::AdminstrativeSets` instead of `AdminSet`
@@ -1,38 +1,34 @@
# frozen_string_literal: true
RSpec.describe Hyrax::AdminSetCreateService do
Copy link
Contributor

Choose a reason for hiding this comment

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

i think it would be nice to rebase these changes on #5213. some of the changes overlap, but i think that does a more complete job of fixing up the stubs, indirection, and multi-expectations in these specs.

i'd be willing to take on that rebase today if that PR could be reviewed.

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 am open to even more refactoring of the tests. It would be easier to review another round of refactoring if this PR were merged with the tests as is and follow that with an update to #5213 or a new PR that makes additional changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

i think reworking #5213 in light of these changes would amount to doing the work in it over again. on the other hand, the substantive changes in this PR are in another file, and it will likely continue to pass, or possibly require minor adjustments, if rebased on #5213.

i feel willing to do the work involved in latter, but not the former.

Copy link
Contributor Author

@elrayle elrayle Oct 28, 2021

Choose a reason for hiding this comment

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

My preference to overlay the #5213 changes is that the specs are rearranged in this PR to closer match that actual methods. The primary tests are only run for #create! since it is the only method that does any work beyond passing through data related to the new admin set. Other methods, including a few new methods, are only tested to ensure they pass through expected data and return expected values.

I am taking on the work to overlay #5213 over this PR in PR #5227.

`.call` and `#create` methods return Boolean and may hide runtime errors.  Instead, use `.call!` and `#create!` respectively.
@no-reply no-reply merged commit 4b488ef into main Oct 28, 2021
@no-reply no-reply deleted the as_create_service branch October 28, 2021 21:51
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