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

6126 deactivated leases #6127

Merged
merged 57 commits into from
Aug 4, 2023
Merged

6126 deactivated leases #6127

merged 57 commits into from
Aug 4, 2023

Commits on Jul 14, 2023

  1. decouple the deactivated lease work from the deactivated embargo work.

    technically the lease work is not part of #5844, however, it will need to updated similarly to embargoes and I do not see a ticket for it. so the work is being done here wile the embargo work is fresh on our minds.
    
    co-authored-by: braydon <braydon.justice@1268456bcltd.ca>
    alishaevn and sephirothkod committed Jul 14, 2023
    Configuration menu
    Copy the full SHA
    6cc1544 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2023

  1. move over a few more lease related changes from #6098.

    co-authored-by: braydon <braydon.justice@1268456bcltd.ca>
    alishaevn and sephirothkod committed Jul 17, 2023
    Configuration menu
    Copy the full SHA
    7b19cca View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2023

  1. Configuration menu
    Copy the full SHA
    b8789d1 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2023

  1. Configuration menu
    Copy the full SHA
    42d504b View commit details
    Browse the repository at this point in the history
  2. merge upstream changes

    alishaevn committed Jul 26, 2023
    Configuration menu
    Copy the full SHA
    ed8f13a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d26467d View commit details
    Browse the repository at this point in the history
  4. wip: update more of the lease code to look like the embargo code so t…

    …hat we can create and deactivate them too.
    alishaevn committed Jul 26, 2023
    Configuration menu
    Copy the full SHA
    16cdbfa View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8061f33 View commit details
    Browse the repository at this point in the history
  6. rubocop fixes

    alishaevn committed Jul 26, 2023
    Configuration menu
    Copy the full SHA
    bf1b1eb View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d413323 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    fac77c3 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    0362456 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2023

  1. Configuration menu
    Copy the full SHA
    c886e64 View commit details
    Browse the repository at this point in the history
  2. verify that the lease_expiration_date and embargo_release_date ar…

    …e in the future before saving an embargo/lease.
    
    ref: #6126
    ref: #5844
    alishaevn committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    0c86b0f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1f979dc View commit details
    Browse the repository at this point in the history
  4. rubocop fixes

    alishaevn committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    4b5b054 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2023

  1. only check for the embargo and lease, if they exist on the change_set…

    … being passed to Hyrax::Transactions::Steps::Save#call
    alishaevn committed Jul 31, 2023
    Configuration menu
    Copy the full SHA
    6314351 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    33ebb3d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9975ac8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3154b19 View commit details
    Browse the repository at this point in the history
  5. remove outdated comment

    alishaevn committed Jul 31, 2023
    Configuration menu
    Copy the full SHA
    6a59d45 View commit details
    Browse the repository at this point in the history
  6. rubocop

    alishaevn committed Jul 31, 2023
    Configuration menu
    Copy the full SHA
    5a8398f View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2023

  1. disable validation on the Active Fedora object in Wings::Valkyrie::Pe…

    …rsister#save because we have already done validation as a Valkyrie object.
    
    co-authored-by: rob <rob@scientist.com>
    alishaevn and orangewolf committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    9b64c54 View commit details
    Browse the repository at this point in the history
  2. allow for spec/wings/active_fedora_converter_spec.rb:37 to pass.

    af_object.lease.class has the same name as resource.lease.class; however, each class has a different object_id.
    so a type mismatch happens. the code below coerces the one object into the other.
    TODO: fix this!
    
    co-authored-by: jeremy <jeremy.n.friesen@gmail.com>
    alishaevn and jeremyf committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    530750c View commit details
    Browse the repository at this point in the history
  3. skip spec/wings/active_fedora_converter_spec.rb:36 when using valkyri…

    …e because valkyrie does not respond to `valid?`
    alishaevn committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    cfc5d91 View commit details
    Browse the repository at this point in the history
  4. make sure that af_object responds to lease before fetching it ins…

    …ide Wings::ActiveFedoraConverter#apply_attributes_to_model
    alishaevn committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    cef578a View commit details
    Browse the repository at this point in the history
  5. update spec/services/hyrax/admin_set_create_service_spec.rb:294to exp…

    …ect "ActiveRecord::RecordNotFound" isntead of "RuntimeError".
    
    previously running `Hyrax.persister.save(resource: admin_set)` in Hyrax::AdminSetCreateService#create! would have failed. however, with the change in commit 9b64c54 we are no longer validating valkyrie turned active fedora objects.
    this means a failure happens in app/models/sipity/workflow.rb:55 since the admin set is invalid.
    alishaevn committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    10215f0 View commit details
    Browse the repository at this point in the history
  6. we no longer need to set embargo_history and lease_history to emp…

    …ty arrays in Wings::ModelTransformer#append_embargo and Wings::ModelTransformer#append_lease. we are now setting the values to empty arrays in Hyrax::Forms::Embargo/Lease and Hyrax::Forms::WorkLeaseForm/WorkEmbargoForm
    alishaevn committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    6b76967 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    753d216 View commit details
    Browse the repository at this point in the history
  8. rubocop

    alishaevn committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    82bb390 View commit details
    Browse the repository at this point in the history
  9. more rubocop things

    alishaevn committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    cee247a View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2023

  1. Configuration menu
    Copy the full SHA
    5fdc19f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ff52b95 View commit details
    Browse the repository at this point in the history
  3. reindex the file set with the correct lease related properties when a…

    … lease has been added to its parent work
    alishaevn committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    d315ec2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8ea729a View commit details
    Browse the repository at this point in the history
  5. rubocop

    alishaevn committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    b3bd3cc View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2023

  1. also remove the :id attribute when coercing the resource lease into…

    … the af_object lease inside #apply_attributes_to_model.this avoids the "Attempting to recreate existing ldp_source" error in dozens of specs
    alishaevn committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    ad4f247 View commit details
    Browse the repository at this point in the history
  2. yet again...update #apply_attributes_to_model. make sure that the res…

    …ource responds to the `lease` method before calling it
    alishaevn committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    5c4486d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ef3f8e2 View commit details
    Browse the repository at this point in the history
  4. update the active_fedora_converter_spec example that expected the con…

    …verted item to have the same lease_id as the original resource
    alishaevn committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    6c071cb View commit details
    Browse the repository at this point in the history
  5. adjust Hyrax::WorksControllerBehavior#create_valkyrie_work error hand…

    …ling so that generic_works_controller_json_spec.rb:58 passes. should be a green pipeline!
    
    co-authored-by: jeremy <jeremy.n.friesen@gmail.com>
    alishaevn and jeremyf committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    3c503bf View commit details
    Browse the repository at this point in the history
  6. rubocop

    alishaevn committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    45f586b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    77f7ac0 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    720b140 View commit details
    Browse the repository at this point in the history
  9. remove another comment

    alishaevn committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    796a1f6 View commit details
    Browse the repository at this point in the history
  10. conditionally validate Wings::Valkyrie::Persister#save.

    by default we will not validate the converted af_object because validations should have been run on the Valkyrie created object. however, there are situations where we will have created an ActiveFedora object while `Hyrax.config.use_valkyrie?` is TRUE. (see: spec/controllers/hyrax/generic_works_controller_json_spec.rb:59)
    
    this change accounts for that use case.
    alishaevn committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    9896d7a View commit details
    Browse the repository at this point in the history
  11. also skip the Hyrax::Actors::CollectionsMembershipActor specs if Hyra…

    …x.config.use_valkyrie is true
    alishaevn committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    04c9c2e View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    9d54048 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2023

  1. better comments

    alishaevn committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    a1ea69c View commit details
    Browse the repository at this point in the history
  2. able to add leases to newly added file sets too, not just preexisting…

    … ones.
    
    accounting for a work with file set that did not have a lease, then added one.
    a work that was created with a file set and lease,
    plus a work that already had a lease and added a file set.
    alishaevn committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    b2a9f23 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3e28096 View commit details
    Browse the repository at this point in the history
  4. restore spec/services/hyrax/admin_set_create_service_spec.rb:294 to i…

    …ts previous expectations by passing `perform_af_validation: true` in `Hyrax::AdminSetCreateService#create!`
    alishaevn committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    8970a44 View commit details
    Browse the repository at this point in the history
  5. I am not sure what changed along the way....but we no longer need thi…

    …s funny business in Wings::ActiveFedoraConverter#apply_attributes_to_model in order for spec/wings/active_fedora_converter_spec.rb:365 to pass! 🎉
    
    now lets hope it also passes in ci. 😩
    alishaevn committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    580d817 View commit details
    Browse the repository at this point in the history
  6. update Hyrax::Actors::BaseActor#save to pass the correct argument/par…

    …ameter combo to #valkyrie_save, and therfore Persister#save
    alishaevn committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    04fac65 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b16bace View commit details
    Browse the repository at this point in the history
  8. revert the changes from 8970a44 and update the assertion to spec/serv…

    …ices/hyrax/admin_set_create_service_spec.rb:294
    alishaevn committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    f992e10 View commit details
    Browse the repository at this point in the history
  9. converting a valkyrie resource lease into an active fedora lease is r…

    …idiculously tricky and I wish we did not have to.
    alishaevn committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    96f5719 View commit details
    Browse the repository at this point in the history