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

perf: add redwood compatibility #68

Merged
merged 4 commits into from
Jul 10, 2024
Merged

perf: add redwood compatibility #68

merged 4 commits into from
Jul 10, 2024

Conversation

bra-i-am
Copy link
Contributor

@bra-i-am bra-i-am commented Jun 26, 2024

Description

This PR aims to give Distro support to Redwood's release. Additionally, taking advantage of this maintenance effort, it was solved a found bug with the command 'enable themes' when the command was executed before, if was executed again it stayed frozen because if it was not sent a 'yes', the command could not override the previous created folder.

Testing instructions

  • Create a Redwood environment with Tutor MFE installed and enabled
  • Install Distro using this branch pip install git+https://github.com/eduNEXT/tutor-contrib-edunext-distro@bc/add-redwood-support and enable it tutor plugins enable distro
  • Add this to the config.yml and run tutor config save
      MFE_DOCKER_IMAGE: docker.io/ednxops/ednx-mfe:redwood
      DOCKER_IMAGE_OPENEDX: docker.io/ednxops/distro-edunext-edxapp:redwood
      DISTRO_EOX_THEMING_DPKG:
        domain: github.com
        index: git
        name: eox-theming
        path: eduNEXT
        private: false
        protocol: https
        repo: eox-theming
        variables:
          development:
            EOX_THEMING_CONFIG_SOURCES:
            - from_eox_tenant_microsite_v2
            - from_django_settings
          production:
            EOX_THEMING_CONFIG_SOURCES:
            - from_eox_tenant_microsite_v2
            - from_django_settings
        version: v7.0.0
      DISTRO_EOX_MANAGE_DPKG:
        index: git
        name: eox-manage
        repo: eox-manage
        domain: github.com
        path: eduNEXT
        protocol: ssh
        private: true
        variables:
          development: {}
          production: {}
        version: v5.0.0
      DISTRO_EXTRA_COMMANDS:
      - tutor distro enable-themes
      - tutor distro enable-private-packages
      - tutor config save
      DISTRO_THEMES:
      - domain: github.com
        name: ednx-saas-themes
        path: eduNEXT
        protocol: ssh
        repo: ednx-saas-themes
        version: edunext/quince.master
      DISTRO_THEMES_NAME:
      - bragi
      - css-runtime
      DISTRO_THEMES_ROOT: /openedx/themes
      DISTRO_THEME_DIRS:
      - /openedx/themes/ednx-saas-themes/edx-platform
      - /openedx/themes/ednx-saas-themes/edx-platform/bragi-generator
      - /openedx/themes/ednx-saas-themes/edx-platform/bragi-children
  • Run the commands
      tutor distro syntax-validator
      tutor distro repository-validator
      tutor distro run-extra-commands
  • Verify the 2 first commands ran without showing errors and for the last one verify that the commands from DISTRO_EXTRA_COMMANDS in the config.yml are executed properly.; in this case will be run 2 Distro commands:
    • tutor distro enable-themes: you should find a folder ednx-saas-themes at env/build/openedx/themes
    • tutor distro enable-private-packages you should find a folder eox-manage at env/build/openedx/requirements

ADDITIONAL CASES

  • If there is a syntax error (i.g. DISTRO_EOX_THEMING_DPKG is missing the path key & value) you should watch an error
  • If there is an error with a repository (i.g. DISTRO_EOX_THEMING_DPKG has the value of repo misspelled) you should watch an error
  • When adding many themes (in this case bragi and css-runtime) if I set a default theme (i.g. DISTRO_DEFAULT_SITE_THEME = css-runtime) in the config.yml then I could access it in the LMS/CMS configuration.
  • When are added extra settings or middleware following the README they should be visible in the LMS/CMS configurations

At last, create an image with the new settings tutor images build openedx, and once this is finished, init the environment tutor local do init and start the environment in local mode tutor local start. To confirm everything goes as expected, besides creating the image without errors, it is important to confirm (1) that the versions of the EOXs that are installed correspond with the ones defined in the config.yml, accessing the container tutor local exec lms and watching the installed dependencies pip list and (2) that we can see bragi as the default theme.

Additional information

JIRA ISSUE DS-1007

@bra-i-am bra-i-am changed the title Bc/add redwood support perf: add redwood compatibility Jun 26, 2024
When 'enable-themes' was executed before, a new execution failed overriding the existing folder
@bra-i-am bra-i-am force-pushed the bc/add-redwood-support branch from 3bcb615 to 1924007 Compare June 27, 2024 13:54
@bra-i-am bra-i-am marked this pull request as ready for review June 27, 2024 14:40
@bra-i-am bra-i-am requested review from MaferMazu, magajh, mariajgrimaldi, luisfelipec95, Asespinel, a team and dcoa and removed request for a team June 27, 2024 14:42
Copy link
Contributor

@magajh magajh left a comment

Choose a reason for hiding this comment

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

@bra-i-am, thank you! I'll be testing this to ensure everything works smoothly, but in the meantime, I'm leaving some suggestions here.

tutordistro/patches/openedx-dockerfile-pre-assets Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@dcoa
Copy link
Contributor

dcoa commented Jul 4, 2024

Thank you @bra-i-am for this PR.

🔵 Changes:

Open a bash inside the container

tutor dev exec lms bash

Then compile the themes

  npm run compile-sass -- --theme-dir [THEME_DIR] --theme [THEME_NAME]

🔸I try with tutor dev run lms but it doesn't work.

🔵 As a suggestion, we can improve the testing instructions, for example

  • Validate an error is displayed if the syntax is not correct.
  • Validate an unexistent repository.
  • If I add a theme that is cloned in the build repository, if I define a default theme is set in the LMS/CMS configuration.
  • If I add extra settings or middleware that configuration is visible.
  • Creating an image is important but I suggest instead of adding a tenant, we can verify the version of the EOXs that are installed corresponds with the ones defined in the config.yml and we can see Bragi as the default theme.

🔸 The MFE reference could be unnecessary.

🔵 No blocker issues for this PR, but some improvements that I noticed with this testing for later (maybe):

  • By error, I forgot to add a version in a dpg_package and run the repository validator. This was the output:

image
It's not bad but might say "Run the syntax command for more information" or give a better context (some ideas).

* refactor: improve & update method of compiling themes
* refactor: enhance extra command logs
* docs: Clarify & complement changelog entry
@bra-i-am bra-i-am force-pushed the bc/add-redwood-support branch from 30aecc3 to e070250 Compare July 8, 2024 17:56
@magajh magajh self-requested a review July 10, 2024 00:39
@bra-i-am bra-i-am merged commit a63e585 into master Jul 10, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants