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: adds xApiTransforms for completion aggregator events #205

Merged
merged 28 commits into from
Jun 21, 2024

Conversation

pomegranited
Copy link
Member

@pomegranited pomegranited commented Jun 11, 2024

Description: Describe in a couple of sentence what this PR adds

Defines xAPI event transformers and tests for the aggregator events using the base event-routing-backends transformers.

Based heavily on openedx/event-routing-backends#377 -- thank you @andrey-canon!

Part of openedx/openedx-aspects#222

JIRA: FAL-3766 (private link)

Dependencies:

Installation instructions:

  1. Install the https://github.com/openedx/tutor-contrib-aspects plugin
  2. Add this repo+PR branch to OPENEDX_EXTRA_PIP_REQUIREMENTS.
  3. Add the repo+PR branch for Allow event-routing-backends to be used when transforming non-openedx events openedx/event-routing-backends#431 to OPENEDX_EXTRA_PIP_REQUIREMENTS too -- have to do this otherwise Aspects will install its own version.
  4. Create a course with sections, and subsections, units, and blocks.

Testing instructions:

  1. In the LMS: complete some blocks, units, subsections and sections.
  2. In Superset: login as a superuser, and visit the SQL tab.
    You should be able to see progressed and completed events corresponding to chapter, sequential, vertical, and unit objects in the xapi.xapi_events_all_parsed_mv table.

Reviewers:

Merge checklist:

Post merge:

  • Create a tag
  • Check new version is pushed to PyPI after tag-triggered build is
    finished.
  • Delete working branch (if not needed anymore)

@pomegranited pomegranited force-pushed the jill/nelc/and/add_completion_events branch 2 times, most recently from 1e6e047 to f886219 Compare June 11, 2024 08:15
* adds dependency on edx-event-routing-backends
* adds transformers to xapi.completion and xapi.progress
* adds the completion_aggregator events to the event tracking whitelist
@pomegranited pomegranited force-pushed the jill/nelc/and/add_completion_events branch from f886219 to 7652429 Compare June 12, 2024 06:32
and adds CHANGELOG entry.
test settings and plugin settings.

The previous commit resulted in the
COMPLETION_AGGREGATOR_ASYNC_AGGREGATION flag being flipped for some
tests -- it was True in test_settings, but False in plugin_settings()

So for these tests, we're now overriding that setting as needed.
and rearrange INSTALLED_APPS to fix tests.
Uses transforms fixture test utilities from ERB to ensure that raw
aggregator events are transformed to xAPI as expected.

* test_output/ -- used by ERB to write failed event transforms for debugging
* adds 'factory' as a test requirement because ERB tests needs it.
Copy link

@bmtcril bmtcril left a comment

Choose a reason for hiding this comment

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

I am not sure if the changes I've suggested are the correct ones, and I have a suspicion that the version of ERB you're using here is before the settings refactor (but also didn't have time to look) but those changes did get tests to pass for me locally.

Copy link
Member

@Agrendalath Agrendalath left a comment

Choose a reason for hiding this comment

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

@pomegranited, is there a simple configuration to check the sent events without the tutor plugin? I'm getting the edx.devstack-palm.lms | 2024-06-17 15:50:18,680 INFO 3682 [eventtracking.backends.async_routing] [user 3] [ip 172.29.0.1] async_routing.py:41 - [EventEmissionExit] skipping event openedx.completion_aggregator.completion.vertical every time the event should be sent.

requirements/base.in Show resolved Hide resolved
requirements/constraints.txt Outdated Show resolved Hide resolved
test_settings.py Show resolved Hide resolved
test_settings.py Show resolved Hide resolved
completion_aggregator/settings/common.py Show resolved Hide resolved
completion_aggregator/transformers.py Outdated Show resolved Hide resolved
completion_aggregator/transformers.py Outdated Show resolved Hide resolved
completion_aggregator/transformers.py Outdated Show resolved Hide resolved
Base automatically changed from jill/nelc/and/add_tracking_logs to master June 20, 2024 05:52
…tings

Initialize EVENT_TRACKING_BACKENDS_ALLOWED_XAPI_EVENTS and
EVENT_TRACKING_BACKENDS_ALLOWED_CALIPER_EVENTS if they aren't
already, and append our events to them.

ERB will do the same to preserve our settings if they're loaded first.
Copy link
Member

@Agrendalath Agrendalath left a comment

Choose a reason for hiding this comment

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

@pomegranited, the changes look good to me. Could you please expand the readme section from #206 to include a note about the xAPI events and update the changelog (I think we should bump the minor version once again).

👍

  • I tested this: I can see the xapi_tracking INFO logs with the Successfully processed event "openedx.completion_aggregator.progress.{block_type}" message without any additional configuration on the devstack.
  • I read through the code
  • I checked for accessibility issues: n/a
  • Includes documentation: ⚠️ not yet

@pomegranited
Copy link
Member Author

@Agrendalath I've fixed the event-routing-backends requirement (812188c), bumped the package version to 4.2.0 (a4858e5) and added a note about xAPI transforms to the README (3850789).

Thank you so much for your thorough reviews! I'll merge this now.

@pomegranited pomegranited merged commit 2dfb6e2 into master Jun 21, 2024
6 checks passed
@pomegranited pomegranited deleted the jill/nelc/and/add_completion_events branch June 21, 2024 00:42
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