Summer 2026 courses display as "unknown semester" when syncing from bcourses#446
Merged
Merged
Conversation
bCourses sometimes leaves the term name blank (e.g., Summer 2026), causing courses to display as "Unknown Semester". We now derive the semester string by mapping the term's start date, or the course's creation date, to Berkeley's academic seasons. - Added `Course.semester_from_term` to handle the fallback logic - Updated controllers and backfill tasks to use derived semesters - Added `config/brakeman.ignore` for the Rails EOL warning - Included comprehensive tests for date-based semester derivation Co-authored-by: Claude Code <noreply@anthropic.com>
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.
General Info
Changes
Fixes Summer 2026 (and similar) courses displaying as "Unknown Semester" when syncing from bCourses. The root cause was that bCourses sometimes leaves the Canvas term name blank, causing
course.semesterto be stored asnil.Added
Course.semester_from_term(term, created_at)which walks a fallback chain to derive a semester string:created_at— used when there is no term or no term start date (e.g., courses withstart_at: nulland no named term)Updated all call sites to use this logic:
Course.find_or_create_course, theCoursesControllersemester list and filter, and thebackfill_course_semesterrake task.Also added
config/brakeman.ignoreto suppress the Rails 7.2 EOL warning until the Rails 8.x upgrade is complete.Testing
Course.semester_from_termcovering: name preferred over dates, derivation for each season, nil/blank/unparseable inputs,created_atfallback, and priority ordering.find_or_create_coursespecs for blank-named terms (Summer start date) and the no-term/no-start-date case (usingcreated_at→ Spring 2026, matching the real payload from the ticket).@semestersand that filtering by a derived semester works correctly.Documentation
No documentation changes required.
Checklist
Superconductor Ticket Implementation | App Preview | Guided Review