Handle additional cases in GraduationJob #2138
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have diagnosed a long-standing bug that leaves ETDs in a published
but inactive state after the graduation job runs. This occurs when
the embargo expiration date for the work occurrs before the date of
the graduation job run. This can happen
because of department or registrar issues
submission was later edited to remove the embargo request before
graduation - this leaves a default six year embargo on the work
which was trunctated to end on the graduation date by
the graduation job
Because of the process used to generate the registrar feed, graduation
dates always occur in the past in relation to the date of the graduation
job run - i.e. the registrar feed never contains future dated graduation
reocrds. Therefore in case 2 above, the embargo expiration is set to a
date some number of days or weeks in the past. The same situation can
occur for case when when there is a multi-semester delay between the
ETD submission & approval in relation to the final graduation date.
Hyrax includes a validation that prevents works from being saved
if they have an active embargo with an expiration date in the past.
A handful of works each month were failing this validation and the save
operation in the GraduationJob was silently failing due to this
validation failure.
This change set adds tests for the two cases described and makes
the necessary code modifications to successfully handle each case.
We have run the code against historical datasets loaded on the QA
environment and the publication bug did not occur for works that
are currently in the error state in the production environment.
To diagnose the problem, we added additional logging to GraduationJob
and were able to clearly see the issue as follows:
Relevant data from two ETDs processed on 2021-04-11 show the date conflict
In each case, the embargo_release_date prior to the processing date was
triggering the "Embargo release date Must be a future date" validation
failure. Because of the version of the save method being called by the
GraduationJob, these validations were silently failing and the ETDs'
workflow state was being updated to
published
but the updatedgraduation date and visibility were not being saved successfully.