Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Get microfrontend URLs from site configuration - tests #30186

Conversation

javiboo
Copy link

@javiboo javiboo commented Apr 6, 2022

Description

Since Maple release, Learning Micro-Frontend (MFE) becomes the default courseware experience, but Multisites have not been considered.
The Learning MFE URL cannot be conifgured per site because the value is not being retrieved through the site configuration
by using the site configuration helper, as it is being done in other points of the platform to obtain other values from the settings.
This commit changes this behaviour introducing the retrieval of Learning but also Account, Profile and Authn MFE URLs through the helper.

This change has impact in "Operator" roles, because they can override MFE URLs in every site configuration.

Supporting information

We have an open discussion about this topic:
https://discuss.openedx.org/t/how-to-use-microfrontend-in-a-multitenant-instance/6936/1

Testing instructions

  1. Create a Site in LMS administration: http(s)://{{ LMS_BASE }}/admin/sites/site/
  2. Create a Site Configuration: http(s)://{{ LMS_BASE }}/admin/site_configuration/siteconfiguration/
  3. Provide a Site value for the LEARNING_MICROFRONTEND_URL property
  4. Browse the dashboard of the Site you have created at first step and check that the link of the course corresponds with the LEARNING_MICROFRONTEND_URL value

Deadline

May 1, 2022 We have commitments with our customers in next month that cannot address without Multisites and we have done the migration to Maple release and now go back would be painful.

Other information

This change would be complemented by extending the initialization handler for config runtime in the microfrontends platform to get the site configuration values through a REST API with a new handler, as mentioned in the discussion by dcoa

Since Maple release, Learning Micro-Frontend (MFE) becomes the default courseware experience, but Multisites have not been considered.
The Learning MFE URL cannot be conifgured per site because the value is not being retrieved through the site configuration
by using the site configuration helper, as it is being done in other points of the platform to obtain other values from the settings.
This commit changes this behaviour introducing the retrieval of Learning but also Account, Profile and Authn MFE URLs through the helper.
@openedx-webhooks
Copy link

openedx-webhooks commented Apr 6, 2022

Thanks for the pull request, @javiboo! I've created OSPR-6579 to keep track of it in JIRA, where we prioritize reviews. Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@natabene
Copy link
Contributor

natabene commented Apr 6, 2022

@javiboo Thank you for the contribution! Once you have signed the Contributor Agreement and it has been processed, you will receive a confirmation via email from our Legal team. We then will be able to review this and all your future code contributions.

@javiboo
Copy link
Author

javiboo commented Apr 6, 2022 via email

@natabene
Copy link
Contributor

natabene commented Apr 7, 2022

@javiboo Thank you, your CLA check will clear soon. I will let you know once it happens.

@openedx-webhooks
Copy link

Hello @javiboo: We are unable to continue with review of your submission at this time. Please see the associated JIRA ticket for more explanation.

@natabene
Copy link
Contributor

@javiboo Apologies for a delay, we are good with the CLA check now.

Copy link
Contributor

@nsprenkle nsprenkle left a comment

Choose a reason for hiding this comment

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

Proposed refactor: should probably use a urljoin to do this more robustly (see example)

@nsprenkle
Copy link
Contributor

Also, open question, does this also need to be merged to master or just the named release?

@nsprenkle
Copy link
Contributor

Want to also ping @davidjoy to make sure we're not missing anything from an architectural/config standpoint.

FYI: @muselesscreator and @leangseu-edx

@davidjoy
Copy link
Contributor

I don't have a lot of input here w/r/t how this config works. @openedx/tcril-engineering, are you able to sanity check whether this is the direction we want to go, re: MFE config? I feel like you all were able to dig into this more fully in the recent MFE config API PRs, or could point us at a subject matter expert who could weigh in.

@kdmccormick
Copy link
Member

Thanks for the ping @davidjoy .

As I understand it, this PR would allow the backend Django settings that specify MFE URLs to be overriden via site_configuration, so it's orthogonal to the MFE Config API. (although, for what it's worth, the MFE Config API also currently supports overriding MFE config values via site_configuration).

I will admit that it does pain me to see site_configuration still in use, because it's another layer on top of our already-complex configuration stack, and it's totally opt-in. That is, features are not aware of site_configuration unless the feature developer particularly goes out of their way to make their feature site_configuration-aware. I would love to see an alternative multi-site config feature that overrides the Django settings directly. I think @felipemontoya says that eduNEXT uses an alternative like that?

However, all that said, we (the community) have not endorsed any alternative yet, and site_configuration is not technically deprecated yet. So I am not against this PR merging.

@felipemontoya
Copy link
Member

I would love to see an alternative multi-site config feature that overrides the Django settings directly

We have been using a plugin called eox-tenant to do exactly that. This plugin is currently proposed as the alternative once site_configurations is completely deprecated.

features are not aware of site_configuration unless the feature developer particularly goes out of their way to make their feature site_configuration-aware

Spot on. This was our main motivation for writing that plugin. I wrote many PRs such as this here and eventually started working on something that would let us run multi-tenancy without depending on feature developers to be in the loop of the site_config feature.

@arbrandes
Copy link
Contributor

I'll second @kdmccormick's opinion here. We don't like site_configuration, but until we deprecate it officially it's what we have, and if the PR itself is sound... I don't have any objections.

For starters, @javiboo, looks like we have a few failing checks. Are these due to the PR?

@bradenmacdonald
Copy link
Contributor

@javiboo Thanks again for this contribution. Are you planning to continue with this PR? (Get the CI checks passing)

@mphilbrick211 mphilbrick211 added the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Dec 16, 2022
@mphilbrick211
Copy link

Hi @javiboo - please let us know if you plan to pursue this PR as we may need to close it due to inactivity. Thank you!

@mphilbrick211 mphilbrick211 removed the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Dec 27, 2022
@mphilbrick211 mphilbrick211 added the inactive PR author has been unresponsive for several months label Dec 27, 2022
@e0d e0d changed the title feat: Get microfrontend URLs from site configuration feat: Get microfrontend URLs from site configuration - tests Jan 12, 2023
@mphilbrick211 mphilbrick211 added closed inactivity PR was closed because the author abandoned it and removed inactive PR author has been unresponsive for several months labels Jan 23, 2023
@mphilbrick211
Copy link

Hi @javiboo - I am closing this PR due to inactivity, though it can be reopened if needed in the future.

@openedx-webhooks
Copy link

@javiboo Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed inactivity PR was closed because the author abandoned it open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

10 participants