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

Add tracking logs #206

Merged
merged 13 commits into from
Jun 20, 2024
Merged

Add tracking logs #206

merged 13 commits into from
Jun 20, 2024

Conversation

pomegranited
Copy link
Member

@pomegranited pomegranited commented Jun 13, 2024

Description:

This PR is the first step for openedx/openedx-aspects#222

It is a rebase of #173 plus:

  • emitted event prefix is openedx instead of edx
  • removed openedx.completion_aggregator.completion.* events -- only emitting progress
  • edx-completion upgraded to edx-platform version

Progress events will be emitted indicating any changes to aggregated progress for these block types:

    openedx.completion_aggregator.progress.course
    openedx.completion_aggregator.progress.chapter
    openedx.completion_aggregator.progress.sequential
    openedx.completion_aggregator.progress.vertical

JIRA: FAL-3766 (private link)

Dependencies: dependencies on other outstanding PRs, issues, etc.

Merge deadline: ASAP -- there's follow-up work to come soon.

Installation instructions:

  1. Install this package in your LMS venv
  2. Ensure completion is enabled : should be a waffle switch enabled for completion.enable_completion_tracking
  3. Create a course with one or two subsections, sections, blocks.

Testing instructions:

  1. Watch the tracking.log file generated by your LMS for completion events, e.g tail -f $(tutor config printroot)/data/lms/logs/tracking.log | grep completion_aggregator
  2. Enrol in your test course and complete some blocks.
    • You should see openedx.completion_aggregator.progress.* events coming through to mark the progress towards completion of the units (vertical), subsections (sequential), sections (chapter), and course.
    • When you've completed the children of these blocks, you should see corresponding openedx.completion_aggregator.completion.* events.

Reviewers:

Merge checklist:

  • All reviewers approved
  • CI build is green
  • Version bumped
  • Changelog record added
  • Documentation updated (not only docstrings)
  • Commits are squashed
  • PR author is listed in AUTHORS

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)

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.
Ordinary completion events are simply "progress" events with a recorded
progress %, so we should do the same here -- no need for "completed"
events.
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, before merging this, could you please add information about the tracking logs to the README along with a warning that this can generate plenty of additional events? We should also mention how to turn this off. Please see the "Synchronous vs. Asynchronous calculations" for an example format of this warning.

👍

  • I tested this: checked that the tracking events are emitted correctly in sync/async modes, and that they can be turned off
  • I read through the code
  • I checked for accessibility issues: n/a
  • Includes documentation: ⚠️

completion_aggregator/__init__.py Outdated Show resolved Hide resolved
test_settings.py Outdated Show resolved Hide resolved
test_settings.py Show resolved Hide resolved
requirements/base.in Outdated Show resolved Hide resolved
completion_aggregator/models.py Outdated Show resolved Hide resolved
completion_aggregator/models.py Show resolved Hide resolved
@pomegranited
Copy link
Member Author

Thank you for your review @Agrendalath !

before merging this, could you please add information about the tracking logs to the README along with a warning that this can generate plenty of additional events? We should also mention how to turn this off.

Good point -- I added a section to the README -- is that clear enough?

test_settings.py Outdated Show resolved Hide resolved
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. I just left some minor suggestions.

README.rst Outdated Show resolved Hide resolved
README.rst Outdated Show resolved Hide resolved
completion_aggregator/settings/common.py Outdated Show resolved Hide resolved
test_settings.py Outdated Show resolved Hide resolved
@pomegranited
Copy link
Member Author

Thank you @Agrendalath :) I've addressed your comments, thank you! Will merge and tag this change.

@pomegranited pomegranited merged commit 27d448a into master Jun 20, 2024
6 checks passed
@pomegranited pomegranited deleted the jill/nelc/and/add_tracking_logs branch June 20, 2024 05:52
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