Rename department 21M to Music - #213
Conversation
Update the 21M DEPARTMENTS label from Music and Theater Arts to Music. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AWziwfKikfpbH3DpfZUABM
There was a problem hiding this comment.
Pull request overview
Updates the department-label mapping used by course-search-utils facets by renaming department code 21M to display as “Music”, aligning the UI label with the desired department naming.
Changes:
- Updated
DEPARTMENTS["21M"]from “Music and Theater Arts” to “Music”.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "21H": "History", | ||
| "21L": "Literature", | ||
| "21M": "Music and Theater Arts", | ||
| "21M": "Music", |
There was a problem hiding this comment.
Bug: Renaming a department causes sanitizeFacets to silently drop filters from bookmarked URLs or saved sessions that use the old department name during a transitional period.
Severity: MEDIUM
Suggested Fix
To ensure backward compatibility during the transition, update sanitizeFacets to temporarily recognize the old department name "Music and Theater Arts" and map it to the correct department code. This will prevent saved states and bookmarks from silently failing until all dependent services are updated.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: src/constants.ts#L24
Potential issue: Renaming the department from "Music and Theater Arts" to "Music" in the
`DEPARTMENTS` constant creates a temporary backward compatibility issue. The
`sanitizeFacets` function uses a reverse map of this constant to validate department
filters. During the transition period before a dependent API library is updated, any
user with a bookmarked URL or saved session containing the old department name
(`?department=Music%20and%20Theater%20Arts`) will have their filter silently fail. The
function will not find the old name in its map and will drop the filter value, leading
to missing results without any warning to the user.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
Yup. This is a very similar concern to mitodl/ocw-hugo-themes#1838 (comment). I am not sure if solving for this is worth it, I'll ask Peter if we care about this.
What are the relevant tickets?
Part of https://github.com/mitodl/hq/issues/5616
Description (What does it do?)
Renames the
21Mlabel in theDEPARTMENTSconstant from "Music and Theater Arts" to Music.How can this be tested?
To be tested together with mitodl/mit-learn#3669. See the testing instructions for that PR