Rename department 21M from Music and Theater Arts to Music - #3669
Rename department 21M from Music and Theater Arts to Music#3669zawan-ila wants to merge 4 commits into
Conversation
Update the DEPARTMENTS constant and the departments fixture, and add a data migration that renames the existing 21M department (and its channel title/slug) 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
Rename the 21M department display name to Music in the OpenAPI specs and the generated TypeScript client, regenerated against the current main. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AWziwfKikfpbH3DpfZUABM
6db86e0 to
ae0e7a6
Compare
OpenAPI ChangesNo changes to report, but the specs are different. Unexpected changes? Ensure your branch is up-to-date with |
There was a problem hiding this comment.
Pull request overview
Renames department 21M’s display name from “Music and Theater Arts” to “Music” across backend constants/fixtures and generated OpenAPI + TypeScript client artifacts, and includes a data migration to update existing DB rows (including the associated department channel title/slug).
Changes:
- Update
DEPARTMENTSconstant anddepartments.jsonfixture to use21M → Music. - Add a data migration to rename the existing
LearningResourceDepartment(21M)and update its department channel title/slug. - Regenerate OpenAPI specs (
v0.yaml,v1.yaml) and generated TS API clients to reflect the new display name.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| openapi/specs/v1.yaml | Updates 21M enum documentation to “Music”. |
| openapi/specs/v0.yaml | Updates 21M enum documentation to “Music”. |
| learning_resources/constants.py | Updates DEPARTMENTS["21M"] display name. |
| frontends/api/src/generated/v1/api.ts | Regenerated client types/docs reflecting “Music”. |
| frontends/api/src/generated/v0/api.ts | Regenerated client types/docs reflecting “Music”. |
| data_fixtures/migrations/0025_rename_department_21M_to_music.py | Data migration to rename department + update channel title/slug. |
| data_fixtures/fixtures/departments.json | Fixture value updated for 21M name. |
| channel = Channel.objects.filter(department_detail__department=department).first() | ||
| if channel: | ||
| channel.title = name | ||
| channel.name = slugify(name) | ||
| channel.save() |
There was a problem hiding this comment.
I don't think we associated multiple channels with the same Department so this is a non-issue.
There was a problem hiding this comment.
Looks great overall! Noticed a few things:
-
Search facet still says "Music and Theater Arts." The department filter label comes from
@mitodl/course-search-utils, which has its own hardcoded department map. Rename department 21M to Music course-search-utils#213 fixes it — this PR needs to pin@mitodl/course-search-utilsto whatever version that gets released in. -
Old department name is cached in
Course.course_numbers.etl/utils.py:1023writes the department name into that JSON field, and it's served on the v1 API — so 21M courses will still report "Music and Theater Arts" there. The next ETL run overwrites it for courses still in the upstream feed, but archived ones keep the old name forever. Either update that JSON in the migration too, or say in the PR description that we're accepting the stale value on archived courses. -
/c/department/music-and-theater-artswill 404.next.config.jsalready has legacy redirects; this is a few lines in the same array.
Also, I think the update_index command will need to be run after migrations to get the new label in opensearch. Also maybe generate_embeddings --courses?
What are the relevant tickets?
Part of https://github.com/mitodl/hq/issues/5616
Description (What does it do?)
Renames department 21M from "Music and Theater Arts" to Music in mit-learn:
21M→Musicin theDEPARTMENTSconstant and thedepartmentsfixture.0025_rename_department_21M_to_musicthat renames the existing department row and updates its channel title/slug.v0.yaml,v1.yaml) and the generated TypeScript client for the renamed department display name.How can this be tested?
docker compose run --rm web python manage.py migrate— the 21M department name is Music and its channel title/slug are updated../scripts/generate_openapi.shproduces no diff against this branch.Additional Context
music-and-theater-arts→music), which changes the department's channel URL.0025_*; whichever merges second will need renumbering.