-
Notifications
You must be signed in to change notification settings - Fork 4
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
Adjust AWS keys for Archivematica SIPs #1233
Conversation
I'd like the code reviewer's input on that line length flag. In my mind, it's more readable in a single line since it's only four characters over the limit, but I could be persuaded. |
@@ -19,7 +19,7 @@ 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" | |||
"etdsip/#{sip.thesis.graduation_year}/#{sip.thesis.graduation_month}-#{sip.thesis.accession_number}/#{sip.bag_name}.zip" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because you asked...
I think:
def keygen(sip)
thesis = sip.thesis
"etdsip/#{thesis.graduation_year}/#{thesis.graduation_month}-#{thesis.accession_number}/#{sip.bag_name}.zip"
end
retains readability and addresses the line length. I'm never one to force a change because a bot whined about it though, so I wouldn't say this is a required change.
Another option I feel is less readable (but you may disagree so I'll share it as well) is:
['etdsip',
sip.thesis.graduation_year,
"#{sip.thesis.graduation_month}-#{sip.thesis.accession_number}",
sip.bag_name].join('/')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good on the code side. Let's make sure the preservation bucket has what we expect before merging (on slack there is an open question as to whether both were fully preserved at this time of this message).
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.
4a7b538
to
3ab83b5
Compare
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.
Developer
our guide and
all issues introduced by these changes have been resolved or opened as new
issues (link to those issues in the Pull Request details above)
Code Reviewer
(not just this pull request message)
Requires database migrations?
NO
Includes new or updated dependencies?
NO