Skip to content

Conversation

@Agrendalath
Copy link
Member

@Agrendalath Agrendalath commented Jan 27, 2026

Description: This adds support for optional completion implemented in open-craft/openedx-platform#823.

Dependencies:

  1. feat(redwood): implement optional completion openedx-platform#823

Merge deadline: None

Installation instructions: For now, this requires a Redwood instance, as the optional completion is implemented only in this release. Therefore, it may be easier to test this one on a sandbox instance.

Testing instructions:

  1. Add ENABLE_COURSE_ACTIVITY_SIGNALS = True to your instance configs.
  2. Change some sections, subsections, or units to be optional and check the results under http://local.openedx.io:8000/completion-aggregator/v1/course/course-v1:edX+DemoX+Demo_Course/?include_optional=true.

Reviewers:

  • tag reviewer

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)

Private-ref: BB-9331

@Agrendalath Agrendalath changed the base branch from agrendalath/bb-10290-ulmo to master January 27, 2026 19:35
@Agrendalath Agrendalath mentioned this pull request Jan 27, 2026
11 tasks
@Agrendalath Agrendalath self-assigned this Jan 27, 2026
@Agrendalath Agrendalath force-pushed the agrendalath/bb-9331-optional-completion branch from eef91da to 53473df Compare January 28, 2026 14:50
@Agrendalath Agrendalath force-pushed the agrendalath/bb-9331-optional-completion branch from 80c26d7 to e1a6a84 Compare February 4, 2026 18:38
@Agrendalath Agrendalath changed the title feat: ignore XBlocks with optional_completion feat: count XBlocks with optional_completion Feb 4, 2026
@Agrendalath Agrendalath requested a review from Copilot February 4, 2026 18:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for tracking optional completion of XBlocks in the completion-aggregator service. The feature enables separate tracking and reporting of optional vs. required blocks in Open edX courses, with optional blocks identified by the optional_completion XBlock field.

Changes:

  • Added three new fields to the Aggregator model: optional_earned, optional_possible, and optional_percent with corresponding database migration
  • Extended the aggregation logic to separately track completion of optional blocks
  • Added include_optional API parameter to optionally expose optional completion data in API responses
  • Updated serializers to conditionally include optional completion data
  • Added comprehensive test coverage for the new functionality

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
completion_aggregator/models.py Added three new fields for tracking optional completions and updated SQL query to include them
completion_aggregator/migrations/0007_aggregator_optional_completion.py Migration to add optional completion fields to Aggregator model
completion_aggregator/core.py Updated aggregation logic to separately track optional blocks and calculate their completion stats
completion_aggregator/compat.py Added is_block_optional() function to check if a block is optional
completion_aggregator/transformers.py Updated to request optional_completion XBlock field
completion_aggregator/serializers.py Added optional completion serializer and updated existing serializers to conditionally include optional data
completion_aggregator/api/common.py Added get_include_optional() method to parse the include_optional parameter
completion_aggregator/api/v0/views.py Updated views to pass include_optional parameter and documented the new parameter
completion_aggregator/api/v1/views.py Updated views to pass include_optional parameter and documented the new parameter
test_utils/compat.py Added test implementation of is_block_optional()
tests/test_models.py Added tests for optional completion field defaults, validation, and get_values behavior
tests/test_core.py Added tests for optional block aggregation with full and partial completion
tests/test_serializers.py Added tests for optional completion serialization in various scenarios
tests/test_views.py Added tests for include_optional parameter in list and detail views
completion_aggregator/init.py Version bumped to 4.4.0rc
CHANGELOG.rst Added changelog entry for version 4.4.0
codecov.yml Reduced patch coverage target from 100% to 75%
.coveragerc Updated coverage omit patterns

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Agrendalath Agrendalath force-pushed the agrendalath/bb-9331-optional-completion branch from e1a6a84 to e265b71 Compare February 4, 2026 19:03
@Agrendalath Agrendalath force-pushed the agrendalath/bb-9331-optional-completion branch from e265b71 to d0fed71 Compare February 9, 2026 18:22
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.

1 participant