[Notifications] Failed fetch jobs
Descriptive summary
This run of tickets is based on the discussion in #230.
- Failed Fetch Jobs
- An email should be sent to the depositor of the work
- Explore the option of digesting all of these to the head of metadeities
- Emails should come in batches at the beginning or end of the day
When a work has controlled metadata and the URI fails to resolve, a notification is sent to depositor of the work. We want those emails to come in batches at the beginning or end of the day. Head of metadeities should get a digest of these failed fetches as well; start with daily and see if we need to back off to weekly.
Expected behavior
Failed metadata fetch errors notify depositor and digest to head of metadeities
Related work
#230
Accessibility Concerns
None
QA: Same as ticket #1562 (Need dev to QA this)
QA Fail. #1562 is passing, but at the end of that email output, it looks like the failed fetch part starts and then aborts:
rake aborted!
Errno::ENOENT: No such file or directory @ dir_initialize - ./tmp/failed_fetch/
/data/lib/oregon_digital/failed_fetch_notification.rb:61:in `open'
/data/lib/oregon_digital/failed_fetch_notification.rb:61:in `foreach'
/data/lib/oregon_digital/failed_fetch_notification.rb:61:in `block in create_zip_file'
/usr/local/bundle/gems/rubyzip-2.3.2/lib/zip/file.rb:125:in `open'
/data/lib/oregon_digital/failed_fetch_notification.rb:59:in `create_zip_file'
/data/lib/tasks/oregon_digital/daily_email.rake:27:in `block (2 levels) in <top (required)>'
/usr/local/bundle/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
Tasks: TOP => oregon_digital:daily_email
(See full trace by running task with --trace)
Closed by #3341
FYI to help with QA I imported a new item with a creator that would fail to fetch a label: https://staging.oregondigital.org/concern/images/cf95jb59d?locale=en#data_sources
QA Fail.
Unless I'm missing something, still not seeing any failed fetch emails in the task response. Not seeing anything created in tmp either.