Skip to content

Conversation

Serj-N
Copy link
Contributor

@Serj-N Serj-N commented Sep 10, 2025

Note

Depends on: #37342

Description

This PR adds support for redirecting users from legacy catalog-related pages to their new Catalog MFE equivalents, based on a site configuration key (ENABLE_CATALOG_MICROFRONTEND) and the appropriate settings feature as a fallback.

Key changes:

  • Adds redirect logic to the legacy index, courses, and course_about views:
    • Home/index page redirects to MFE when ENABLE_CATALOG_MICROFRONTEND is enabled.
    • Courses page redirects to MFE when ENABLE_CATALOG_MICROFRONTEND is enabled.
    • Course about page redirects to the Catalog MFE when ENABLE_CATALOG_MICROFRONTEND is enabled.
  • Uses the newly added get_catalog_mfe_course_about_url helper for accurate about-page URL construction.
  • Comprehensive tests are added for all redirection scenarios to ensure correct redirect behavior.

Testing Instructions

Before testing, make sure you have the changes from #37342.

Test Case 1: ENABLE_CATALOG_MICROFRONTEND=False

  1. Go to Django Site Configurations in the admin panel.
  2. Add the following code snippet to the local.openedx.io:8000 site configuration:
{
    "ENABLE_CATALOG_MICROFRONTEND": false
}
  1. (Re)start the platform.
  2. Go to the home page: http://local.openedx.io:8000/.
  3. Ensure that no redirect occurred and the legacy page is displayed.
  4. Repeat steps 4 and 5 for the course about page (http://local.openedx.io:8000/<course_id/about>) and the course catalog page (http://local.openedx.io:8000/courses).

Test Case 2: ENABLE_CATALOG_MICROFRONTEND=True

  1. Go to Django Site Configurations in the admin panel.
  2. Add the following code snippet to the local.openedx.io:8000 site configuration:
{
    "ENABLE_CATALOG_MICROFRONTEND": true
}
  1. (Re)start the platform.
  2. Go to the home page: http://local.openedx.io:8000/.
  3. Ensure that a redirect occurred and the MFE url is seen in the browser's address bar (http://apps.local.openedx.io:1998/catalog/).
  4. Repeat steps 4 and 5 for the course about page (http://apps.local.openedx.io:1998/catalog/<course_id/about>) and the course catalog page (http://apps.local.openedx.io:1998/catalog/courses).

@openedx-webhooks
Copy link

openedx-webhooks commented Sep 10, 2025

Thanks for the pull request, @Serj-N!

This repository is currently maintained by @openedx/wg-maintenance-edx-platform.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.


Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Sep 10, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Sep 10, 2025
@Serj-N Serj-N changed the title feat: add redirects to mfe for catalog-related legacy pages feat [FC-86]: add redirects to mfe for catalog-related legacy pages Sep 10, 2025
@Serj-N Serj-N self-assigned this Sep 10, 2025
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Sep 10, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Sep 10, 2025
@PKulkoRaccoonGang
Copy link
Contributor

PKulkoRaccoonGang commented Sep 19, 2025

@Serj-N currently, I have noticed the following problems that we should fix:

If ENABLE_CATALOG_MICROFRONTEND=false, the link http://local.edly.io:8000/courses redirects to http://apps.local.openedx.io:1998/catalog/courses

At http://local.openedx.io:8000/ there is a correct transition to http://local.openedx.io:8000/courses/<course_id>/about


If ENABLE_CATALOG_MICROFRONTEND=false at the link:


If the user is logged in and ENABLE_CATALOG_MICROFRONTEND=true, when going to the home page http://apps.local.openedx.io:1998/catalog/, a redirect to http://apps.local.openedx.io:1996/learner-dashboard/ should occur.

@Serj-N Serj-N marked this pull request as ready for review September 23, 2025 17:29
@Serj-N Serj-N requested a review from a team as a code owner September 23, 2025 17:29
@Serj-N
Copy link
Contributor Author

Serj-N commented Sep 24, 2025

@PKulkoRaccoonGang On local.openedx.io the redirects should be working correctly now.
As for local.edly.io and 0.0.0.0: these are considered different hostnames (aka Sites in the Django admin), and if we want them to have the same redirect behavior as local.openedx.io, we will need to add the same site configuration (with the ENABLE_CATALOG_MICROFRONTEND key) for each of those sites. However, as far as I know, local.edly.io is considered a legacy hostname, and 0.0.0.0 isn't normally used during development, so I believe using local.openedx.io (with a corresponding site configuration) should be enough.

@mphilbrick211 mphilbrick211 moved this from Waiting on Author to Ready for Review in Contributions Sep 24, 2025
@@ -175,6 +217,28 @@ def get_learning_mfe_home_url(
return mfe_link


def get_catalog_mfe_course_about_url(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this new function? Why can't we use the get_link_for_about_page function that already exists and that you have already updated to work with the catalog MFE in #37342

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good observation, it does look like we can get rid of this function. However, to use the one from #37342, we will have to wait until that other PR is merged, so that we can pull the changes here.

Copy link
Contributor

Choose a reason for hiding this comment

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

That PR has now merged, so let me know when the new version of this PR is ready to go.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, I refactored this PR now:

  • get_link_for_about_page - now using this function
  • get_catalog_mfe_course_about_url - removed

@Serj-N Serj-N force-pushed the nanai/axm-2159/add-redirects branch from 25bace7 to b4e1d42 Compare September 30, 2025 07:23
@Serj-N Serj-N force-pushed the nanai/axm-2159/add-redirects branch from b4e1d42 to 6c31268 Compare September 30, 2025 08:01
@feanil feanil merged commit 8d95c32 into openedx:master Oct 1, 2025
65 checks passed
@github-project-automation github-project-automation bot moved this from Ready for Review to Done in Contributions Oct 1, 2025
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

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

Labels

FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants