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

refine Hyrax::EmbargoSearch behavior to find only enforced embargoes #6241

Merged
merged 5 commits into from
Sep 6, 2023

Conversation

no-reply
Copy link
Contributor

@no-reply no-reply commented Aug 29, 2023

since sometime in 2014, Hyrax::EmbargoSearch has looked for ALL resources that have ANY embargo date when determining which objects are under embargo. the actual embargo object metadata is indexed (under both AF and Valkyrie), so there's no need to be this aggressive about it.

for the UI, find only the objects that are actually under a currently enforced embargo (according to the index). as a first pass at implementing this, we find all the objects that have indexed embargo dates, then drop any that aren't currently being enforced (where the indexed visibility differs from the embargo's prescribed visibility).

we could probably improve upon this, but this should suit as a first pass.

related to ##6235

Changes proposed in this pull request:

  • change how the Hyrax UI determines which objects are under embargo from the index to match Hyrax::EmbargoManager definitions
  • ensures EmbargoManager#release sets #embargo_history correctly; after running this method, it's necessary to save both the Embargo and the AccessControl to persist the changes.

@samvera/hyrax-code-reviewers

@no-reply
Copy link
Contributor Author

if this looks good. similar changes are needed for Lease.

@no-reply
Copy link
Contributor Author

@alishaevn if this solves the UI problem for #6235, i'd suggest we move the embargo_history behavior from #deactivate! into #release (i think we want this history data anytime an embargo is released), and deprecate that method for removal.

@no-reply no-reply added the notes-minor Release Notes: Non-breaking features label Aug 29, 2023
@no-reply
Copy link
Contributor Author

no-reply commented Aug 29, 2023 via email

@no-reply
Copy link
Contributor Author

no-reply commented Aug 29, 2023

@alishaevn i added tests for the rake task in 1660516

@no-reply no-reply force-pushed the refine-embargo-search branch 3 times, most recently from b28a252 to 9502ad1 Compare August 30, 2023 05:07
tamsin johnson added 5 commits August 31, 2023 10:05
since sometime in 2014, `Hyrax::EmbargoSearch` has looked for ALL resources that
have ANY embargo date when determining which objects are under embargo. the
actual embargo object metadata is indexed (under both AF and Valkyrie), so
there's no need to be this agressive about it.

instead, find only the objects that are actually under a currently enforced
embargo (according to the index). as a first pass at implementing this, we find
all the objects that have indexed embargo dates, then drop any that aren't
currently being enforced (where the indexed visibility differs from the
embargo's presribed visibility).

we could probably improve upon this, but this should suit as a first pass.
there has been some question about whether this rake task actually releases
expired embargoes. this tests that it does, and ensures that it integrates with
the UI correctly by checking against `Hyrax::EmbargoHelper` (which lists
enforced embargoes for use by views).
Hyrax counts on the `embargo_history` being present after an embargo is
released. move the logic for setting it to `EmbargoManager#release`. since
`#release` now involves updating both the `Hyrax::Embargo` and the
`Hyrax::AccessControl`, it's necessary to persist both after a release for it to
take effect. so far we've avoided having `EmbargoManager` handle persistence,
but maybe we want to change that to make this easier to use correctly at this
point?

----

this keeps the `nullify` call in `deactivate`, even though it should no longer
be needed. it's arguably a good idea if a user manually deletes an embargo to
empty the embargo's data---but then a little inconsistent to continue to use
that embargo to host the Work's embargo history(?).
@no-reply
Copy link
Contributor Author

no-reply commented Sep 6, 2023

just want to bump this to see if we can resolve this issue.

Copy link
Contributor

@dlpierce dlpierce left a comment

Choose a reason for hiding this comment

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

Let's get this merged and do some more QA on it, see where that leaves us on the other behavior brought up in this discussion.

@dlpierce dlpierce merged commit 0ac9c4c into main Sep 6, 2023
@dlpierce dlpierce deleted the refine-embargo-search branch September 6, 2023 20:56
@alishaevn alishaevn mentioned this pull request Sep 19, 2023
@alishaevn
Copy link
Contributor

I tested this locally and it's working! (ref: this comment)

the same will need to be done for leases.

alishaevn added a commit to scientist-softserv/atla-hyku that referenced this pull request Sep 26, 2023
This code is copied from samvera/hyrax#6241
to solve #121. In
that PR, the ability to expire embargoes using a rake task works.

The copied code has not been included in a release yet. At the time of
this writing, September 26, 2023, it is in hyrax main. The latest
release is `hyrax-v4.0.0`.

This app is currently using hyrax-v3.5.0. However, since the changes
being brought in are coming from hyrax main, I'm including the entire
files instead of writing decorators.
no-reply pushed a commit that referenced this pull request Sep 27, 2023
repeats the work in #6241, but with the lease infrastructure.

it would still be really nice to flatten these into one concept, but the data
layer is still an issue (stored data has different names for functionally
identical Embargo and Lease abstractions).
no-reply pushed a commit that referenced this pull request Oct 26, 2023
repeats the work in #6241, but with the lease infrastructure.

it would still be really nice to flatten these into one concept, but the data
layer is still an issue (stored data has different names for functionally
identical Embargo and Lease abstractions).
no-reply pushed a commit that referenced this pull request Oct 26, 2023
repeats the work in #6241, but with the lease infrastructure.

it would still be really nice to flatten these into one concept, but the data
layer is still an issue (stored data has different names for functionally
identical Embargo and Lease abstractions).
no-reply pushed a commit that referenced this pull request Oct 26, 2023
repeats the work in #6241, but with the lease infrastructure.

it would still be really nice to flatten these into one concept, but the data
layer is still an issue (stored data has different names for functionally
identical Embargo and Lease abstractions).
dlpierce pushed a commit that referenced this pull request Nov 14, 2023
repeats the work in #6241, but with the lease infrastructure.

it would still be really nice to flatten these into one concept, but the data
layer is still an issue (stored data has different names for functionally
identical Embargo and Lease abstractions).
dlpierce pushed a commit that referenced this pull request Nov 30, 2023
repeats the work in #6241, but with the lease infrastructure.

it would still be really nice to flatten these into one concept, but the data
layer is still an issue (stored data has different names for functionally
identical Embargo and Lease abstractions).
dlpierce added a commit that referenced this pull request Nov 30, 2023
* refine Hyrax::LeaseService behavior to find only enforced leases

repeats the work in #6241, but with the lease infrastructure.

it would still be really nice to flatten these into one concept, but the data
layer is still an issue (stored data has different names for functionally
identical Embargo and Lease abstractions).

* fin

---------

Co-authored-by: Daniel Pierce <dlpierce@indiana.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notes-minor Release Notes: Non-breaking features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants