eduNEXT / tutor-contrib-edunext-distro

A tool to facilitate the customization of an Openedx instance, adding commands and settings to have an easy-to-use and a ready-to-deploy in local or in development openedx distribution.
2 stars 1 forks source link

(DS-534) feat: add syntax validator command #52

Closed JuanDavidBuitrago closed 11 months ago

JuanDavidBuitrago commented 1 year ago

Description

This PR adds a command to validate the syntax in the config.yml file. The command checks:

Testing instructions

In a Tutor Olive environment run:

  1. pip install git+https://github.com/eduNEXT/tutor-contrib-edunext-distro@jdb/syntax_validator
  2. tutor plugins enable distro
  3. Adds in your config.yml file something like:
    DISTRO_EOX_CORE_DPKG:
    domain: github.com
    index: git
    name: eox-core
    path: eduNEXT
    private: false
    protocol: https
    repo: eox-core
    variables:
      development:
        EOX_CORE_ENROLLMENT_BACKEND: eox_core.edxapp_wrapper.backends.enrollment_o_v1
        EOX_CORE_PRE_ENROLLMENT_BACKEND: eox_core.edxapp_wrapper.backends.pre_enrollment_l_v1
        EOX_CORE_USERS_BACKEND: eox_core.edxapp_wrapper.backends.users_m_v1
      production:
        EOX_CORE_ENROLLMENT_BACKEND: eox_core.edxapp_wrapper.backends.enrollment_o_v1
        EOX_CORE_PRE_ENROLLMENT_BACKEND: eox_core.edxapp_wrapper.backends.pre_enrollment_l_v1
        EOX_CORE_USERS_BACKEND: eox_core.edxapp_wrapper.backends.users_m_v1
    version: v8.0.0
    DISTRO_EOX_MANAGE_DPKG:
    domain: github.com
    index: git
    name: eox-manage
    path: eduNEXT
    private: true
    protocol: ssh
    repo: eox-manage
    version: v3.4.0
    DISTRO_THEMES:
    - domain: github.com
    name: ednx-saas-themes
    path: eduNEXT
    protocol: ssh
    repo: ednx-saas-themes
    version: edunext/olmo.master
    DISTRO_THEMES_NAME:
    - bragi
    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
    INSTALL_EXTRA_FILE_REQUIREMENTS:
    files:
    - /edunext/base.txt
    - /nelp/test.txt
    path: ./requirements/extra_file/
    OPENEDX_EXTRA_PIP_REQUIREMENTS:
    - eox-hooks==4.0.0
    - eox-tagging==5.0.0
    - eox-audit-model==2.0.0
    - openedx-scorm-xblock==14.0.0
    - git+https://github.com/openedx/schoolyourself-xblock.git
    OPENEDX_EXTRA_SETTINGS:
    cms_env:
    - USE_EOX_TENANT: true
    lms_env:
    - USE_EOX_TENANT: true
    - ENABLE_EOX_THEMING_DERIVE_WORKAROUND: true
    pre_init_lms_tasks:
    - ./manage.py lms migrate contenttypes
    - ./manage.py lms migrate eox_core
  4. tutor config save
  5. tutor distro syntax-validator
  6. Change the configurations in your config file and make again steps 4 and 5. The idea is to validate different cases, for example when the configuration is wrong. You can find the schema validation in structure_validator.py

Additional information

Jira Card: https://edunext.atlassian.net/browse/DS-534

Checklist for Merge

luisfelipec95 commented 12 months ago

looks good to me

Alec4r commented 12 months ago

@JuanDavidBuitrago https://app.eraser.io/workspace/P1LlaYzweGzXmleyMpL4

JuanDavidBuitrago commented 11 months ago

@JuanDavidBuitrago https://app.eraser.io/workspace/P1LlaYzweGzXmleyMpL4

Hi @Alec4r Can you review again?