Skip to content

Commit

Permalink
Adjust AWS keys for Archivematica SIPs
Browse files Browse the repository at this point in the history
Why these changes are being introduced:

We recently merged a proposed solution to this. However, looking
back at ETD-600, I realized I have the spec wrong. The current keys
are missing the graduation year and month.

Relevant ticket(s):

https://mitlibraries.atlassian.net/browse/ETD-593

How this addresses that need:

This updates the keys to what Joe originally requested, so that
the SIP directory includes the grad month and is nested beneath
the grad year. For example: `etdsip/2023/June-2023_001`

Side effects of this change:

None.
  • Loading branch information
jazairi committed Oct 2, 2023
1 parent 50d597e commit 3ab83b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/models/submission_information_package_zipper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def initialize(sip)
# This key needs to be unique. By default, ActiveStorage generates a UUID, but since we want a file path for our
# Archivematica needs, we are generating a key. We handle uniqueness on the `bag_name` side.
def keygen(sip)
"etdsip/#{sip.thesis.accession_number}/#{sip.bag_name}.zip"
thesis = sip.thesis
"etdsip/#{thesis.graduation_year}/#{thesis.graduation_month}-#{thesis.accession_number}/#{sip.bag_name}.zip"
end

# bagamatic takes a sip, creates a temporary zip file, and returns that file
Expand Down
2 changes: 1 addition & 1 deletion test/models/submission_information_package_zipper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ def setup_thesis
SubmissionInformationPackageZipper.new(sip)

blob = thesis.submission_information_packages.last.bag.blob
assert blob.key.starts_with? "etdsip/#{thesis.accession_number}"
assert blob.key.starts_with? "etdsip/#{thesis.graduation_year}/#{thesis.graduation_month}-#{thesis.accession_number}"
end
end

0 comments on commit 3ab83b5

Please sign in to comment.