Skip to content

Rename department 21M from Music and Theater Arts to Music - #3669

Open
zawan-ila wants to merge 4 commits into
mainfrom
anawaz/rename-mta-to-music
Open

Rename department 21M from Music and Theater Arts to Music#3669
zawan-ila wants to merge 4 commits into
mainfrom
anawaz/rename-mta-to-music

Conversation

@zawan-ila

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

Copy link
Copy Markdown
Contributor

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:

  • Updates 21MMusic in the DEPARTMENTS constant and the departments fixture.
  • Adds a data migration 0025_rename_department_21M_to_music that renames the existing department row and updates its channel title/slug.
  • Regenerates the OpenAPI specs (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.sh produces no diff against this branch.

Additional Context

  • The migration also updates the department channel slug (music-and-theater-artsmusic), which changes the department's channel URL.
  • This branch and the companion "add 21T" branch each add a migration numbered 0025_*; whichever merges second will need renumbering.

zawan-ila and others added 2 commits July 24, 2026 00:25
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
@zawan-ila
zawan-ila force-pushed the anawaz/rename-mta-to-music branch from 6db86e0 to ae0e7a6 Compare July 23, 2026 20:15
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

OpenAPI Changes

No changes to report, but the specs are different.

View full changelog

Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

@zawan-ila
zawan-ila marked this pull request as ready for review July 24, 2026 19:23
Copilot AI review requested due to automatic review settings July 24, 2026 19:23
@zawan-ila zawan-ila added the Needs Review An open Pull Request that is ready for review label Jul 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 DEPARTMENTS constant and departments.json fixture to use 21M → 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.

Comment on lines +22 to +26
channel = Channel.objects.filter(department_detail__department=department).first()
if channel:
channel.title = name
channel.name = slugify(name)
channel.save()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think we associated multiple channels with the same Department so this is a non-issue.

Comment thread openapi/specs/v1.yaml

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.

Looks great overall! Noticed a few things:

  1. 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-utils to whatever version that gets released in.

  2. Old department name is cached in Course.course_numbers. etl/utils.py:1023 writes 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.

  3. /c/department/music-and-theater-arts will 404. next.config.js already 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?

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

Labels

Needs Review An open Pull Request that is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants