-
Notifications
You must be signed in to change notification settings - Fork 124
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
Removes FileSet related objects when work deleted (#6334). #6357
Conversation
The pattern for transactions/steps has been to put all of the actual work in a step and keep transactions contain only a list of steps to take, so this should be moved to a step. I wonder if UpdateWorkMembers could be of use? |
@dlpierce I've added my best attempt of rspec here. I tried to get a work with a fileset that contained a file with an associated FileMetadata object, but I couldn't get one going. |
I tried this out on clean koppie and sirenia.
It looks like the steps do not actually remove the FileSet as it is now, so I'm curious how it was removed from Fedora |
I forgot to check Koppie--apologies for that. When we last discussed the work deletion behavior, I commented how it appears the object created by the |
For the Solr objects--should I just kick off a full reindex? |
The resource factory here creates a graph that references the FileSet when forming the object to send to the Fedora API. Apparently, the API takes that as a deletion dependency...I guess. But that's my best guess. |
Should I reverse tactics and experiment with explictly deleting all FileSets attached to a Work before deleting the Work itself? See if that takes care of all of the FileSets' children without having to call all of the other steps? |
d96404a
to
81fc50f
Compare
The deletion dependency seems possible. The way I see it working is the destroy work steps should include a call to a step to destroy the FileSet, which then destroys its FileMetadata objects. I think the generic delete resource step can be used at each level to carry out the actual deletion? That way the number of places in code concerned with doing a given action is kept to a minimum. |
Alrighty, I'll see how making a call to delete all FileSets before deleting the Work goes. |
@dlpierce When attempting to call the This "fix" doesn't fix everything, though. An ACL for the FileSet is still left behind. And, for some reason, Solr is left with the AdminSet and 2 FileMetadata objects (which are gone from Fedora.) I think I'll add a full reindex call into the same method I've already altered. |
@dlpierce I've removed all of the errant objects (Solr and Fedora) on the Sirenia side. I've run out of time for today, so I couldn't get to Koppie testing or rspec. See you on Monday the 16th. |
This should be ready for review. The Koppie side of thing is affected by the Work being removed before queried for its child members. |
If the list of member file sets is no longer available after a work resource is deleted, it will not be possible to perform the cleanup. Therefore file sets (and their file metadata) must be deleted prior to the work's deletion during the transaction call. The member cleanup listener is no long concerned with deleting file sets.
…_adapter spec metadata
Fixes
Fixes #6334
Summary
Adds transaction triggers that removes FileSets' Hyrax::FileMetadata and AccessControl objects.
Guidance for testing, such as acceptance criteria or new user interface behaviors:
Type of change (for release notes)
notes-valkyrie
Valkyrie ProgressDetailed Description
Adds transaction triggers that removes FileSets' Hyrax::FileMetadata and AccessControl objects.
Changes proposed in this pull request:
@samvera/hyrax-code-reviewers