Skip to content

Rename department 21M to Music - #213

Open
zawan-ila wants to merge 1 commit into
mainfrom
anawaz/rename-mta-to-music
Open

Rename department 21M to Music#213
zawan-ila wants to merge 1 commit into
mainfrom
anawaz/rename-mta-to-music

Conversation

@zawan-ila

@zawan-ila zawan-ila commented Jul 23, 2026

Copy link
Copy Markdown

What are the relevant tickets?

Part of https://github.com/mitodl/hq/issues/5616

Description (What does it do?)

Renames the 21M label in the DEPARTMENTS constant 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

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
@zawan-ila
zawan-ila marked this pull request as ready for review July 24, 2026 19:42
@zawan-ila
zawan-ila requested a review from Copilot July 24, 2026 19:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/constants.ts
"21H": "History",
"21L": "Literature",
"21M": "Music and Theater Arts",
"21M": "Music",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@zawan-ila zawan-ila Jul 24, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mbertrand mbertrand left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants