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: add a new tenant setting to enable the Course Authoring MFE #808

Merged

Conversation

bra-i-am
Copy link

@bra-i-am bra-i-am commented Feb 22, 2024

Depends on

Description

This PR creates a handler for a new setting ENABLE_COURSE_AUTHORING_MFE that will allow to enable or disable the course authoring MFE according to the settings of the tenant

For you to take it into account, there is a set of tests failing that doesn't belong to the changes applied in this PR. Next, I let evidence of the tests ran in the base release branch ednx-release/palma.master and they are even failing there:

image

Supporting information

JIRA Issue DS-805

Testing instructions

Local

  1. Run a Palm environment using TVM or the Tutor docs in its Palm version
  2. Use this branch as your edx-platform version adding in the config.yml the following
EDX_PLATFORM_REPOSITORY: https://github.com/eduNEXT/edunext-platform.git
EDX_PLATFORM_VERSION: bc/enable_course_authoring_setting
  1. Install tutor-mfe directly in the Tutor environment tutor plugins install mfe, and enable it tutor plugins enable mfe
  2. Update the environment settings tutor config save to make the two above bullets available
  3. Clone the eox-tenant repository, git-checkout it to this branch, add it to your LMS and CMS tutor mounts add lms,cms:/path/to/eox-tenant/clone:/openedx/extra-deps/eox-tenant
  4. Init the environment again to install the MFE container, use the new edx-platform version and add the eox-tenant to the LMS+CMS containers tutor dev/local launch
  5. Go to both container tutor dev exec lms/cms bash, install eox-tenant pip install -e .../extra-deps/eox-tenant, and run the migrations ./manage.py lms makemigrations and ./manage.py lms migrate
  6. Restart the containers tutor dev restart
  7. Go to the admin panel and create 2 new routes:
  • Domain name: tenant-a.local.overhang.io
    {
        "COURSE_AUTHORING_MICROFRONTEND_URL": "http://apps.tenant-a.local.overhang.io:2001/course-authoring",
        "EDNX_USE_SIGNAL": true,
        "ENABLE_COURSE_AUTHORING_MFE": true,
        "LMS_BASE": "tenant-a.local.overhang.io:8000",
        "LMS_ROOT_URL": "http://tenant-a.local.overhang.io:8000",
        "MFE_CONFIG": {
            "EXAMS_BASE_URL": "",
            "LMS_BASE_URL": "http://tenant-a.local.overhang.io",
            "LOGIN_URL": "http://tenant-a.local.overhang.io/login",
            "LOGOUT_URL": "http://tenant-a.local.overhang.io/logout"
        },
        "PLATFORM_NAME": "Tenant A",
        "SITE_NAME": "tenant-a.local.overhang.io",
        "course_org_filter": [
            "tenantA"
        ]
    }
  • Domain name: tenant-b.local.overhang.io
    {
        "COURSE_AUTHORING_MICROFRONTEND_URL": "http://apps.tenant-b.local.overhang.io:2001/course-authoring",
        "EDNX_USE_SIGNAL": true,
        "ENABLE_COURSE_AUTHORING_MFE": false,
        "LMS_BASE": "tenant-b.local.overhang.io:8000",
        "LMS_ROOT_URL": "http://tenant-b.local.overhang.io:8000",
        "MFE_CONFIG": {
            "EXAMS_BASE_URL": "",
            "LMS_BASE_URL": "http://tenant-b.local.overhang.io",
            "LOGIN_URL": "http://tenant-b.local.overhang.io/login",
            "LOGOUT_URL": "http://tenant-b.local.overhang.io/logout"
        },
        "PLATFORM_NAME": "Tenant B",
        "SITE_NAME": "tenant-b.local.overhang.io",
        "course_org_filter": [
            "tenantB"
        ]
    }  
  1. Go to Studio and create two new courses one of them with the organization tenantA and the other one with the organization tenantB
  2. If everything went okay, once you access to the 'tenantA' course you have to see something like this pointing to the tenant-a (if you click it)

image

  1. Now if you go to the 'tenantB' course, because of the flag ENABLE_COURSE_AUTHORING: false, you have to see the legacy 'Pages' section...

image

... but, if you have the flag as ENABLE_COURSE_AUTHORING: true, then you'll see the MFE directioner, but this will point to the tenant-b

image

  1. Additionally, having the ENABLE_COURSE_AUTHORING_MFE as true, if you are adding a new component in a unit, the options 'Text', 'Video', and 'Problem' should send you to a route with course-authoring

image
image

Stage

First, meanwhile the PRs are approved, make sure that the 'TARGET REVISION' in ArgoCD is pointing to the branch
bc/test_course_authoring_setting of the manifest

image

Then make sure there are tenant configs one with ENABLE_COURSE_AUTHORING_MFE=true and another with false and start testing from 11 bullet in the above section

@Alec4r
Copy link
Member

Alec4r commented Feb 26, 2024

@bra-i-am I already approved it, but please make sure that tests are passing.

Copy link

@dcoa dcoa left a comment

Choose a reason for hiding this comment

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

After checking the behavior in Brayan's environment, that works as expected.

@bra-i-am bra-i-am force-pushed the bc/enable_course_authoring_setting branch 3 times, most recently from 4075dbe to 276b035 Compare February 28, 2024 19:13
cms/lib/utils.py Outdated Show resolved Hide resolved
@bra-i-am bra-i-am force-pushed the bc/enable_course_authoring_setting branch from 276b035 to 44f230c Compare March 1, 2024 16:21
* fix: modify some test to be according to the new behavior
@bra-i-am bra-i-am force-pushed the bc/enable_course_authoring_setting branch from 44f230c to 4232a54 Compare March 1, 2024 20:54
@bra-i-am bra-i-am requested a review from dcoa March 1, 2024 21:37
Copy link
Contributor

@MaferMazu MaferMazu left a comment

Choose a reason for hiding this comment

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

Thanks for this! Looks good to me! ✨

@bra-i-am bra-i-am merged commit 7d75f3d into ednx-release/palma.master Mar 7, 2024
35 of 36 checks passed
@bra-i-am bra-i-am deleted the bc/enable_course_authoring_setting branch March 7, 2024 13:33
bra-i-am added a commit that referenced this pull request Apr 16, 2024
)

* fix: modify some test to be according to the new behavior
bra-i-am added a commit that referenced this pull request Apr 16, 2024
)

* fix: modify some test to be according to the new behavior
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.

4 participants