Repository navigation
fix: end classes at the end-of-term finals block, whatever its titles - #1056
Merged
Merged
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Classes now end at the term's end-of-term finals block, whatever the titles of its events.
UniversityCalendarEvent.finals_periodsselects everystudy_dayandfinalsevent. Before, it also needed "Final Exam Period" or "Study Day" in the title, so "Final Exams (...)" and "Finals Week" did not end classes.UniversityCalendarEvent.end_of_term_finals_startsgives the first day of each term's last finals block: the earliest finals period that starts no more than 14 days before the term's last one. A finals period for the first 7-week classes in October cancels classes on its own dates only. It does not end the 15-week classes.CourseCalendars::RecurrenceBuilderuses it in the per-term path and in the preload path.UniversityCalendar::TermDates.detecttakes the latestfinalsevent as the term end.UniversityCalendar::Categoryalready givesfinalsonly to exam-period titles.UniversityCalendar::Category.finals_period?is false for a title with "Midterm". Classes meet in a midterm exam period.Why it is safe now
The announcements that the feed stored as
finals("Final Exam Schedule Available to Students") would have ended terms early. #1052 moved new ones toacademic, and the recategorize task moved the 3 stored rows in production today.manual:rows keep the category that an admin gave them.After deploy
Run
bin/rails university_calendar:recategorize(dry run) once. It shows any stored "Midterm ..." row that now leavesfinals. Apply it withDRY_RUN=0if it lists one.Checks
CI=1, twice: 6665 examples. The first run had 1 failure innext_term_courses_spec.rb:656, an order-dependent query-count spec that does not touch this code. It passed alone with 3 seeds, and the second full run had 0 failures. Line coverage 96.18%, branch 86.29%.end_of_term_finals_startsfor two terms and a term with no finals, and a midterm exam period title.