Skip to content

Delete micromasters resources and remove ETLSource constant - #3670

Merged
mbertrand merged 2 commits into
mainfrom
mb/delete-micromasters-resources
Jul 27, 2026
Merged

Delete micromasters resources and remove ETLSource constant#3670
mbertrand merged 2 commits into
mainfrom
mb/delete-micromasters-resources

Conversation

@mbertrand

Copy link
Copy Markdown
Member

What are the relevant tickets?

N/A — follow-up to #3663

Description (What does it do?)

Follow-up cleanup to #3663, which removed the micromasters ETL pipeline and unpublished/deindexed all remaining etl_source=micromasters resources from OpenSearch and Qdrant.

  • Deletes all LearningResource rows with etl_source="micromasters" via a new data migration (0118). No deindexing is needed — the resources were already removed from OpenSearch/Qdrant by the 0117 migration in Remove micromasters ETL #3663; related runs, content files, and relationship rows are removed by FK cascades.
  • Removes the now-unused ETLSource.micromasters constant.
  • Updates migration 0052 to use the "micromasters" string literal instead of ETLSource.micromasters.name, so historical migrations no longer depend on the removed enum member.

How can this be tested?

  • docker compose run --rm web python manage.py migrate learning_resources0118 should apply cleanly and delete any remaining micromasters resources.
  • docker compose run --rm web python manage.py makemigrations --check --dry-run — no model changes detected (etl_source is a plain CharField, so removing the enum member causes no schema drift).
  • LearningResource.objects.filter(etl_source="micromasters").count() should be 0 after migrating.

Copilot AI review requested due to automatic review settings July 23, 2026 19:08
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

OpenAPI Changes

8 changes: 7 error, 0 warning, 1 info

View full changelog

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

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

Cleanup follow-up to the prior removal of the MicroMasters ETL by removing remaining database rows and eliminating the now-unused ETLSource.micromasters enum member so the codebase no longer exposes or depends on that source.

Changes:

  • Add a data migration (0118) to delete all LearningResource rows with etl_source="micromasters".
  • Update historical migration 0052 to use the "micromasters" string literal (removing dependency on ETLSource.micromasters).
  • Remove micromasters from the ETLSource enum.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
learning_resources/migrations/0118_delete_micromasters_resources.py Deletes remaining DB rows for etl_source="micromasters" after the prior unpublish/deindex migration.
learning_resources/migrations/0052_learningresource_certification_type.py Removes the migration’s dependency on ETLSource.micromasters by using a string literal.
learning_resources/etl/constants.py Removes the ETLSource.micromasters enum member.

Comment on lines 80 to 85
class ETLSource(ExtendedEnum):
"""Enum of ETL sources"""

micromasters = "micromasters"
mit_edx = "mit_edx"
mitpe = "mitpe"
mitxonline = "mitxonline"
@mbertrand
mbertrand force-pushed the mb/delete-micromasters-resources branch from e5354c0 to b05c9ff Compare July 24, 2026 20:17
@mbertrand mbertrand added Needs Review An open Pull Request that is ready for review and removed Work in Progress labels Jul 24, 2026

@shanbady shanbady 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.

change looks good just needs an update to the openapi spec

@shanbady shanbady added Waiting on author and removed Needs Review An open Pull Request that is ready for review labels Jul 27, 2026
@mbertrand
mbertrand force-pushed the mb/delete-micromasters-resources branch from b05c9ff to 3ebe46d Compare July 27, 2026 15:09
@mbertrand

Copy link
Copy Markdown
Member Author

openapi spec is up to date, errors are due to this being considered a breaking change ( "micromasters" is no longer a valid value for the source parameter of the content_files webhook endpoint).

@mbertrand mbertrand added Needs Review An open Pull Request that is ready for review and removed Waiting on author labels Jul 27, 2026

@shanbady shanbady 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.

LGTM

@shanbady shanbady added Waiting on author and removed Needs Review An open Pull Request that is ready for review labels Jul 27, 2026
mbertrand and others added 2 commits July 27, 2026 15:46
@mbertrand
mbertrand force-pushed the mb/delete-micromasters-resources branch from 3ebe46d to 4856d0f Compare July 27, 2026 19:46
@mbertrand
mbertrand merged commit 7b73b40 into main Jul 27, 2026
12 of 13 checks passed
@mbertrand
mbertrand deleted the mb/delete-micromasters-resources branch July 27, 2026 20:14
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