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(DS-368): add support for olive Open edX release #24

Merged
merged 1 commit into from
Jan 27, 2023

Conversation

mariajgrimaldi
Copy link
Contributor

@mariajgrimaldi mariajgrimaldi commented Jan 23, 2023

Description

This PR adds support for the olive release maintaining the current support for nutmeg. It was tested on the two local environments.

Testing instructions

Setting up the environment:

  1. Install eox-core in LMS/LMS worker:
pip install git+https://github.com/eduNEXT/eox-core.git@MJG/DS-364-olive-compatibility#egg=eox_core==8.0.0_1
  1. Install eox-audit-model:
pip install git+https://github.com/eduNEXT/eox-audit-model.git@MJG/olive-support#egg=eox_audit_model==2.0.0_1
  1. Migrate eox-audit-model: python manage.py lms migrate eox_audit_model (LMS)
  2. Restart services
  3. Add CELERY_ALWAYS_EAGER = False to your development settings.

Generating audit entries using eox-core:

  1. Go to http://lms-url/eox-core/api-docs
  2. Create a user and then create the same user for the 2nd time
  3. Go to /admin and search for audit. You'll see the new record generated by the transaction.

Additional information

Detailed test cases:
https://docs.google.com/document/d/1v6mxFSf1k7JrxU36Ok9uVDFBhtxVuGmhFLtxtbIsPFs

Checklist for Merge

  • Tested in a remote environment
  • Updated documentation
  • Rebased master/main
  • Squashed commits

@mariajgrimaldi mariajgrimaldi requested a review from a team January 23, 2023 21:19
@MaferMazu
Copy link
Contributor

MaferMazu commented Jan 25, 2023

The code looks good; I had a comment but no critical one.

About tests, I tried without the CELERY_ALWAYS_EAGER configuration, and it works well ✅

But when I set CELERY_ALWAYS_EAGER = False, the audit model didn't create an audit track, and I received this:
Screenshot from 2023-01-25 17-24-02

Do you have any idea what could be happening? Does it happen to someone else, or is it just me?

@dcoa
Copy link
Contributor

dcoa commented Jan 26, 2023

Do you have any idea what could be happening? Does it happen to someone else, or is it just me?

I've been testing the plugin and works as expected, no errors.

@dcoa dcoa self-requested a review January 26, 2023 08:37
@mariajgrimaldi
Copy link
Contributor Author

@MaferMazu: can you include the complete traceback from the lms-worker?

@MaferMazu
Copy link
Contributor

MaferMazu commented Jan 27, 2023

Here is the output from the lms-worker:

2023-01-27 01:03:59,953 ERROR 1 [celery.worker.consumer.consumer] [user None] [ip None] consumer.py:520 - Received unregistered task of type 'eox_audit_model.tasks.create_audit_register'.
The message has been ignored and discarded.

Did you remember to import the module containing this task?
Or maybe you're using relative imports?

Please see
http://docs.celeryq.org/en/latest/internals/protocol.html
for more information.

The full contents of the message body was:
b'{"task": "eox_audit_model.tasks.create_audit_register", "id": "3e7356a2-e7e0-4b43-b702-f408f8ba3545", "args": [], "kwargs": {"action": "Create edxapp user", "status": 1, "method_name": "eox_core_api_method", "captured_logs": "2023-01-27 01:03:59,922 INFO 30 [edx.student] [user 4] [ip 172.21.0.1] management.py:518 - user 15 originated from a white labeled \"Microsite\"", "traceback_log": "NoneType: None\n", "input_parameters": {"args": [{"email": "user12@example.com", "username": "string12", "fullname": "string", "password": "", "year_of_birth": "", "gender": "", "goals": "", "mailing_address": "", "level_of_education": "", "activate_user": "", "skip_password": ""}], "kwargs": {}}, "output_parameters": "<Response status_code=200, \"text/html; charset=utf-8\">", "site_id": 4, "performer": "admin", "ip": "172.21.0.1", "notes": null, "eox_tenant_sender": "lms.olive.edunext.link"}, "group": null, "group_index": null, "retries": 0, "eta": null, "expires": null, "utc":... (1118b)

Thw full contents of the message headers:
{'eox_tenant_sender': 'lms.olive.edunext.link'}

The delivery info for this task is:
{'exchange': '', 'routing_key': 'edx.lms.core.default'}
Traceback (most recent call last):
File "/openedx/venv/lib/python3.8/site-packages/celery/worker/consumer/consumer.py", line 591, in on_task_received
strategy = strategies[type_]
KeyError: 'eox_audit_model.tasks.create_audit_register'

We can take a look tomorrow.

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.

I could fix it with @mariajgrimaldi's help. We need to add eox-audit-model in INSTALLED_APPS, eox-core did it for us here. I installed eox-core in lms-worker and it's working.

This PR looks good to me ✨

@mariajgrimaldi mariajgrimaldi merged commit 6c789a5 into master Jan 27, 2023
mariajgrimaldi added a commit that referenced this pull request Jan 27, 2023
BREAKING CHANGE: add compatibility with olive
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.

3 participants