Skip to content

Commit

Permalink
perf: add compatibility with Open edX olive release (#244)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: add compatibility with olive
  • Loading branch information
mariajgrimaldi committed Jan 31, 2023
1 parent 10f4bdc commit 517b603
Show file tree
Hide file tree
Showing 18 changed files with 649 additions and 224 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:
token: ${{ secrets.PAT }}
- name: Get next version
id: tag_version
uses: mathieudutour/github-tag-action@v6.0
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: false
default_prerelease_bump: false
dry_run: true
- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: "3.8"
- name: Create bumpversion
Expand All @@ -33,14 +33,14 @@ jobs:
bumpversion --new-version ${{ steps.tag_version.outputs.new_version }} setup.cfg
- name: Update Changelog
if: steps.tag_version.outputs.new_version
uses: stefanzweifel/changelog-updater-action@v1.6.2
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ steps.tag_version.outputs.new_tag }}
release-notes: ${{ steps.tag_version.outputs.changelog }}
- name: Commit bumpversion
id: bumpversion
if: steps.tag_version.outputs.new_version
uses: stefanzweifel/git-auto-commit-action@v4.14.1
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: ${{ github.ref }}
commit_message: "docs(bumpversion): ${{ steps.tag_version.outputs.previous_tag }} → ${{ steps.tag_version.outputs.new_version }}"
Expand All @@ -58,7 +58,7 @@ jobs:
token: ${{ secrets.PAT }}
- name: Create tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.0
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_sha: ${{ needs.bumpversion.outputs.bump_commit_sha }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
name: Label the PR size
steps:
- uses: CodelyTV/pr-size-labeler@v1.8.1
- uses: CodelyTV/pr-size-labeler@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_max_size: '10'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ jobs:
django: ["32"]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Cache dependency
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements/test.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

Expand Down
40 changes: 24 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,23 @@ Installation on Open edX Devstack
Compatibility Notes
--------------------

+-------------------+-----------------+
| Open edX Release | Version |
+===================+=================+
| Ironwood | < 3.0 |
+-------------------+-----------------+
| Juniper | >= 3.0 < 5.0 |
+-------------------+-----------------+
| Koa | >= 4.9 < 6.0 |
+-------------------+-----------------+
| Lilac | >= 4.9 < 6.0 |
+-------------------+-----------------+
| Maple | >= 6.0 |
+-------------------+-----------------+
| Nutmeg | >= 7.0 |
+-------------------+-----------------+
+------------------+--------------+
| Open edX Release | Version |
+==================+==============+
| Ironwood | < 3.0 |
+------------------+--------------+
| Juniper | >= 3.0 < 5.0 |
+------------------+--------------+
| Koa | >= 4.9 < 6.0 |
+------------------+--------------+
| Lilac | >= 4.9 < 6.0 |
+------------------+--------------+
| Maple | >= 6.0 |
+------------------+--------------+
| Nutmeg | >= 7.0 |
+------------------+--------------+
| Olive | >= 8.0 |
+------------------+--------------+

**NOTE**: The Maple version does not support Django 2.2 but it does support Django 3.2 as of eox-core 7.0.

Expand Down Expand Up @@ -141,7 +143,7 @@ not listed, then the accumulation of changes from previous releases is enough.
EOX_CORE_USERS_BACKEND: "eox_core.edxapp_wrapper.backends.users_m_v1"
EOX_CORE_PRE_ENROLLMENT_BACKEND: "eox_core.edxapp_wrapper.backends.pre_enrollment_l_v1"
EOX_CORE_ENROLLMENT_BACKEND: "eox_core.edxapp_wrapper.backends.enrollment_l_v1"
**Nutmeg**

.. code-block:: yaml
Expand All @@ -150,6 +152,12 @@ not listed, then the accumulation of changes from previous releases is enough.
EOX_CORE_PRE_ENROLLMENT_BACKEND: "eox_core.edxapp_wrapper.backends.pre_enrollment_l_v1"
EOX_CORE_ENROLLMENT_BACKEND: "eox_core.edxapp_wrapper.backends.enrollment_l_v1"
**Olive**

.. code-block:: yaml
EOX_CORE_ENROLLMENT_BACKEND: "eox_core.edxapp_wrapper.backends.enrollment_o_v1"
These settings can be changed in ``eox_core/settings/common.py`` or, for example, in ansible configurations.

**NOTE**: the current ``common.py`` works with Open edX Nutmeg version.
Expand Down
16 changes: 6 additions & 10 deletions docs/help_for_devs/0001-include-test-cases-files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,35 @@
Eox-core test cases
###################

Status
------

Accepted

Context
-------

In order to have a way to test the eox-core API endpoints manually, but quickly, two json files have been
created with the GET, POST, PATCH and DELETE requests. The `Eox-core-test.postman_collection.json`_ and
`Eox-core-test.postman_environment.json`_ files were created with the `Posman`_ application.

.. _Eox-core-test.postman_collection.json: ../resources/Eox-core-test.postman_collection.json
.. _Eox-core-test.postman_environment.json: ../resources/Eox-core-test.postman_environment.json
.. _eox-core-test.postman_collection.json: ../resources/Eox-core-test.postman_collection.json
.. _eox-core-test.postman_environment.json: ../resources/Eox-core-test.postman_environment.json
.. _Posman: https://www.postman.com/

Instructions
------------

To test the endpoints it is necessary to have the Open Edx platform running with the eox-core plugin installed.

#. Once your environment is set up, create a new admin user: ``tutor dev createuser -staf - superuser admin <custom-mail> -p <password>``.
#. Once your environment is set up, create a new admin user: ``tutor dev do createuser --staf --superuser admin <custom-mail> --password <password>``.
#. Log into Django's admin site using the user created in the previous step.
#. Create a testing user without staff permissions, you could do this in the Django admin page. Some of the test will require you to be staff user, specifically those for the support API. In case you want to run the test collection once, then user your admin user and skip the permission assignment steps.
#. On the Site Administration panel go to *Authentication and Authorization* > *Users*.
#. Click on the admin user created on the first step.
#. Click on the testing user created on the third step.
#. Go to User permissions and look for auth **user** *can access eox-core API* and add it with a double click or one click and right arrow.
#. Click Save at the bottom of the page.
#. On the Site Administration panel go to *Django Oauth Toolkit* > *Applications*.
#. You should be redirected to a table with a bunch of applications and on the right upper corner there's a button to Add *Application*, click on it.
#. Once again, you should be redirected to a new page with a bunch of blank spaces, nevertheless, *client id* and *client secret* are given. Save them, as you will need these later.
#. Fill the left spaces with the following rules:

- For *User id* click on the magnifier icon next to the blank space, a window should show up with the app's users, pick the one you created in the first step.
- For *User id* click on the magnifier icon next to the blank space, a window should show up with the app's users, pick the one you created for tests.
- On the *Redirect to URL* section add your app's url.
- Pick *Confidential* on the *Client type* dropdown menu.
- Pick *Client credentials* for *Authorization grant type*.
Expand Down
Loading

0 comments on commit 517b603

Please sign in to comment.