Skip to content

Remove micromasters ETL - #3663

Merged
mbertrand merged 2 commits into
mainfrom
remove-micromasters-etl
Jul 23, 2026
Merged

Remove micromasters ETL#3663
mbertrand merged 2 commits into
mainfrom
remove-micromasters-etl

Conversation

@mbertrand

@mbertrand mbertrand commented Jul 22, 2026

Copy link
Copy Markdown
Member

What are the relevant tickets?

N/A - all micromasters programs are now ingested via the mitxonline ETL

Description (What does it do?)

Removes all code related to the MicroMasters ETL:

  • The micromasters ETL module and its tests
  • The micromasters_etl pipeline
  • The get_micromasters_data celery task and its celerybeat schedule entry
  • The backpopulate_micromasters_data management command
  • The MICROMASTERS_CATALOG_API_URL setting and related env/devcontainer entries

Adds a data migration that unpublishes any remaining learning resources with etl_source=micromasters and deindexes them from OpenSearch/Qdrant via the standard resource_unpublished_actions plugin hooks.

Kept (not part of the ETL): ETLSource.micromasters enum (referenced by migration 0052), CertificationType.micromasters (used by the mitxonline ETL), and MICROMASTERS_CMS_API_URL (used for program letters).

How can this be tested?

  • Run the migration: docker compose run --rm web python manage.py migrate learning_resources — any published micromasters resources should be unpublished and deindex tasks dispatched.
  • docker compose run --rm web uv run pytest learning_resources/etl/pipelines_test.py learning_resources/tasks_test.py -n logical

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

OpenAPI Changes

No changes detected

View full changelog

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

@mbertrand
mbertrand marked this pull request as ready for review July 22, 2026 19:16
Copilot AI review requested due to automatic review settings July 22, 2026 19:16

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

This PR removes the deprecated MicroMasters ETL pipeline and its operational hooks (Celery task + beat schedule, management command, settings/env wiring), and adds a cleanup migration to unpublish any remaining etl_source=micromasters resources while triggering the standard unpublish/deindex plugin flow.

Changes:

  • Removed MicroMasters ETL pipeline code (learning_resources/etl/micromasters.py), pipeline composition, Celery task + beat schedule entry, and related tests.
  • Removed MICROMASTERS_CATALOG_API_URL configuration and associated dev/env references, plus the devcontainer startup command that invoked the removed backpopulate command.
  • Added a data migration to unpublish remaining MicroMasters resources and trigger deindexing via resource_unpublished_actions.

Reviewed changes

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

Show a summary per file
File Description
main/settings_course_etl.py Removes the MicroMasters catalog API setting.
main/settings_celery.py Removes the Celery beat schedule entry for MicroMasters updates.
learning_resources/tasks.py Removes the get_micromasters_data Celery task.
learning_resources/tasks_test.py Updates cache-clearing test expectations and removes the MicroMasters task test.
learning_resources/migrations/0117_unpublish_micromasters_resources.py Adds a cleanup migration to unpublish/deindex remaining MicroMasters resources.
learning_resources/management/commands/backpopulate_micromasters_data.py Removes the backpopulate management command.
learning_resources/etl/pipelines.py Removes micromasters import and micromasters_etl pipeline composition.
learning_resources/etl/pipelines_test.py Removes micromasters_etl pipeline test.
learning_resources/etl/micromasters.py Removes the MicroMasters ETL implementation.
learning_resources/etl/micromasters_test.py Removes tests for the MicroMasters ETL module.
env/codespaces.env Removes MicroMasters catalog/course env vars from codespaces env.
env/app_vars.sh Removes MicroMasters catalog API var from app var generation script.
.devcontainer/devcontainer.json Removes the MicroMasters backpopulate command from the devcontainer post-start bootstrap.

Comment thread learning_resources/migrations/0117_unpublish_micromasters_resources.py Outdated
@mbertrand mbertrand added the Needs Review An open Pull Request that is ready for review label Jul 22, 2026

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

Should you remove references to micromasters in learning/resources/etl/constants.py now or will they be removed in a followup

@mbertrand

Copy link
Copy Markdown
Member Author

Leaving EtlSource.micromasters because it is referenced by a migration and existing LearningResource records

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

Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.

Comment on lines +4 to +8
def delete_micromasters_resources(apps, schema_editor):
"""Deindex and delete any remaining micromasters resources"""
# Deindex synchronously rather than via the async plugin hooks: the
# OpenSearch/Qdrant removal serializers query the DB by id, so the rows
# must still exist when they run
Comment on lines 80 to 84
class ETLSource(ExtendedEnum):
"""Enum of ETL sources"""

micromasters = "micromasters"
mit_edx = "mit_edx"
mitpe = "mitpe"
@mbertrand
mbertrand force-pushed the remove-micromasters-etl branch from 6fae9e6 to 43bda3d Compare July 23, 2026 18:36
mbertrand and others added 2 commits July 23, 2026 14:36
MicroMasters programs are no longer ingested from the micromasters
catalog API. Removes the ETL module, celery task, beat schedule entry,
backpopulate command, settings, and tests. Adds a data migration that
unpublishes any remaining micromasters resources and deindexes them
from OpenSearch/Qdrant via the standard unpublished plugin hooks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Address review: query/update via apps.get_model so the migration stays
valid as the schema evolves, and dispatch deindexing through the
id-based bulk_resources_unpublished_actions instead of passing model
instances to the per-resource hook.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mbertrand
mbertrand force-pushed the remove-micromasters-etl branch from 43bda3d to dd2f598 Compare July 23, 2026 18:36
@mbertrand

mbertrand commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

will delete existing ETLSource.micromasters records, remove that constant, update affected earlier migrations in a followup PR

@mbertrand
mbertrand merged commit 5cd79df into main Jul 23, 2026
14 checks passed
@mbertrand
mbertrand deleted the remove-micromasters-etl branch July 23, 2026 18:46
@odlbot odlbot mentioned this pull request Jul 23, 2026
2 tasks
@odlbot odlbot mentioned this pull request Jul 24, 2026
4 tasks
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