-
Notifications
You must be signed in to change notification settings - Fork 10
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
oaisys: change etdms date source to graduation date as per LAC spec #2298 #2510
Conversation
Generated by 🚫 Danger |
73a40c0
to
a82bdd8
Compare
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.
I think you're on the right track with this.
config/locales/en.yml
Outdated
spring_num: '06' | ||
fall_num: '11' |
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.
Seems like it might be redundant with
jupiter/app/models/draft_thesis.rb
Lines 5 to 12 in 3e2d4ae
# Metadata team prefers we store and use a number (e.g. '06' or '11') | |
# to represent the graduation term (e.g. Spring or Fall) | |
# This TERMS constant is used by the graduation term dropdown on the deposit form, | |
# mapping the string label to the number value that we wish to use. | |
TERMS = [ | |
[I18n.t('admin.theses.graduation_terms.spring'), '06'], | |
[I18n.t('admin.theses.graduation_terms.fall'), '11'] | |
].freeze |
Can we consolidate to use one or the other?
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.
My struggle here is developing a mental model how Thesis
and DraftThesis
objects relate. Is there a document that describes the two at a high level contrasting the differences? My naive first assumption was that the Thesis
and DraftThesis
would be very similar models with only minor differences owning to the draftiness of a DraftThesis. Looking through the codebase, I see multiple areas that transition dates (e.g., graduation date) from a text representation to a number (string or numerical datatype) version, for example, the conversions ( 6 => Spring, '06 (Spring)' => '06'
, 'Spring' => '06'
, '06' => 'Spring'
). The above code in the context of DraftThesis
is using the text 06 (Spring)
whereas the data in the Thesis
context is Spring
(no round brackets etc.) so I unsure if a consolidation can happen due to differences in the string. I like the idea of consolidation but I not confident I have an understanding of the nuances in the aforementioned and following locations spread across different models.
jupiter/app/helpers/items_helper.rb
Lines 53 to 56 in a82bdd8
SEASON = { | |
6 => I18n.t('items.thesis.graduation_terms.spring'), | |
11 => I18n.t('items.thesis.graduation_terms.fall') | |
}.freeze |
jupiter/lib/tasks/batch_ingest.rake
Lines 202 to 203 in d1c8fb1
graduation_term = '11' if graduation_term_string == 'Fall' | |
graduation_term = '06' if graduation_term_string == 'Spring' |
Lines 353 to 354 in d1c8fb1
spring: '06 (Spring)' | |
fall: '11 (Fall)' |
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.
Effort was made so that the underlying data was consistent: ualbertalib/metadata#383 and I believe this is still the case. I reviewed the graduation_date
on staging and can confirm that all are YYYY
or YYYY-MM
. So now I'm curious where the Fall YYYY
or Spring YYYY
came from. It might be possible to use the graduation date directly.
The public presentation of these dates (Fall 2017) was discussed #1003 where OAI was out of scope.
The admin deposit interface should show the number (06 for spring and 11 for fall) #804 #709
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.
I can see that our seeds data is spitting out Fall. That looks like a bad rebase b0f53cb. It was fixed before that commit.
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.
Thx for checking the underlying DB. I can confirm, the graduation_date
appears to work as the DB contents conforms to the LAC format. The Fall/Spring YYYY
was from me looking at the DB created from the seeds.rb file and a conversation with Mariana on Theses inputs which I'd falsely assumed aligned with the DB storage format. I'm updating the seeds.rb
* format correct in prior commit (perhaps rebase mistake): b0f53cb * revert format to prior commit https://github.com/ualbertalib/jupiter/blob/fa44471da977863283ad9b6179ba23525f95c373/db/seeds.rb#L199
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.
👍
@@ -19,8 +19,7 @@ def type | |||
end | |||
|
|||
def date | |||
# TODO: need to talk to metadata about fallback if date accepted is not present, which it isn't for legacy theses | |||
object.date_accepted || object.created_at | |||
object.graduation_date |
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 should be present so feel pretty good about using graduation_date
Line 27 in d1c8fb1
validates :graduation_date, presence: true |
Context
Update decorator for theses that provides the specified LAC etdms date and format replacing the the current date_accepted and created_at dates that don't meet the LAC requirements
Related to #2298
What's New
jupiter/db/seeds.rb
Line 199 in fa44471