-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor error handling in Preservation Submission Job
Why these changes are being introduced: The Preservation Submission Job currently handles exceptions during SIP creation by setting the SIP's status to 'error' and saving it. This allows us to see failed SIPs in the administrate dashboard, but it also causes preservation to fail silently. Relevant ticket(s): https://mitlibraries.atlassian.net/browse/ETD-647 How this addresses that need: This refactors the Preservation Submission Job to create SIPs using `create!` instead of `create`, so that exceptions are raised during the object creation. When exceptions are raised, they are logged and added to the `results` array. Since no SIP is created when an exception is raised by `create!`, the logic in the `rescue` block around updating `preservation_status` has been removed. Side effects of this change: * Fixtures have been adjusted to accommodate testing. * A quasi-related test that had no assertions has been updated to actually test something. * The `preservation_status` of 'error' has been removed, as it is no longer used in the app. There are currently no SIPs in production that have this status. * Unrelated to this change, the `baggable` module has been moved from `app/models` to `app/lib`. This to be consistent with where we store our other module, and to make it clear that it is not a model.
- Loading branch information
Showing
7 changed files
with
36 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,7 @@ june_2018: | |
june_2021: | ||
grad_month: 'June' | ||
grad_year: '2021' | ||
|
||
june_2022: | ||
grad_month: 'June' | ||
grad_year: '2022' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters