Skip to content

Add automatic Fastly cache purging to MFE pipelines#4209

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/add-fastly-purge-to-mfe
Draft

Add automatic Fastly cache purging to MFE pipelines#4209
Copilot wants to merge 2 commits into
mainfrom
copilot/add-fastly-purge-to-mfe

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 18, 2026

MFE deployments to S3 were not invalidating Fastly CDN cache, causing stale content to be served after builds.

Changes

  • pipeline.py: Added purge_fastly_cache and fastly_service_prefix fields to OpenEdxVars model
  • pipeline.py: Conditional purge task appended to mfe_build_plan after S3 sync, calls Fastly /purge_all API
  • values.py: Enabled purging for all deployments with environment-specific prefixes:
    • mitx: mitx_
    • mitx-staging: mitx_staging_
    • mitxonline: learn_
    • xpro: xpro_

Implementation

Follows existing pattern from mitlearn_nextjs pipeline. Service IDs resolved from Concourse secrets via ((fastly.{prefix}service_id_{env})) (e.g., ((fastly.mitx_service_id_ci))).

if open_edx.purge_fastly_cache and open_edx.fastly_service_prefix:
    fastly_service_id_key = (
        f"{open_edx.fastly_service_prefix}service_id_"
        f"{open_edx.environment_stage.lower()}"
    )
    mfe_build_plan.append(TaskStep(...))  # curl POST to Fastly API

Applies to all environment stages (CI, QA, Production) across all four deployments.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • astral.sh
    • Triggering command: /usr/bin/curl curl -LsSf REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>automatic fastly purge to MFE builds</issue_title>
<issue_description>### Description/Context
Add automatic fastly cache purging to the MFE build + deployment jobs
https://cicd.odl.mit.edu/teams/main/pipelines/mfe-meta-pipeline
https://cicd.odl.mit.edu/teams/mitx-staging/pipelines/mitx-staging-master-mfe-pipeline
https://cicd.odl.mit.edu/teams/mitxonline/pipelines/mitxonline-master-mfe-pipeline
https://cicd.odl.mit.edu/teams/xpro/pipelines/xpro-ulmo-mfe-pipeline
etc

Plan/Design

</issue_description>

<agent_instructions>Refer to the mitlearn_nextjs pipeline for an example of an automatic Fastly purge in the pipeline. </agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: blarghmatey <479088+blarghmatey@users.noreply.github.com>
Copilot AI changed the title [WIP] Add automatic Fastly cache purging to MFE builds Add automatic Fastly cache purging to MFE pipelines Feb 18, 2026
Copilot AI requested a review from blarghmatey February 18, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

automatic fastly purge to MFE builds

2 participants