Skip to content

fix: check enrollment status before issuing Learning Path credentials#93

Merged
Agrendalath merged 6 commits intomainfrom
agrendalath/bb-9669_learning-path-enrollments
May 5, 2025
Merged

fix: check enrollment status before issuing Learning Path credentials#93
Agrendalath merged 6 commits intomainfrom
agrendalath/bb-9669_learning-path-enrollments

Conversation

@Agrendalath
Copy link
Member

@Agrendalath Agrendalath commented May 5, 2025

This adds Learning Path enrollment checks implemented in open-craft/learning-paths-plugin#19.

Private-ref: BB-9669

@Agrendalath Agrendalath requested a review from Copilot May 5, 2025 13:05
@Agrendalath Agrendalath self-assigned this May 5, 2025
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 fixes the issuance of Learning Path credentials by verifying that users are actively enrolled in the Learning Path before processing completion and grade data. Key changes include:

  • Filtering out users not enrolled (with an active enrollment) in the Learning Path in the processor.
  • Updating tests to simulate learning path enrollment and verify the new behavior.
  • Bumping dependency versions and updating the package version in the module’s init.

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.

File Description
tests/test_processors.py Updated fixtures and tests to incorporate enrollment checks and adjust expected results.
requirements/.txt and requirements/ Multiple dependency version bumps, including the learning-paths-plugin update and others.
learning_credentials/processors.py Added filtering logic to exclude users without an active enrollment from eligibility.
learning_credentials/init.py Updated module version from 0.2.0 to 0.2.1.
Files not reviewed (1)
  • CHANGELOG.rst: Language not supported
Comments suppressed due to low confidence (1)

tests/test_processors.py:362

  • The test 'test_retrieve_data_for_learning_path' does not enroll any users into the learning path, meaning the enrollment check in _process_learning_context will cause the result to be empty. Please add enrollment for the expected users before calling the processor to ensure the test accurately reflects the new behavior.
def test_retrieve_data_for_learning_path(

@Agrendalath Agrendalath merged commit 0f59e6b into main May 5, 2025
12 checks passed
@Agrendalath Agrendalath deleted the agrendalath/bb-9669_learning-path-enrollments branch May 5, 2025 13:18
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.

2 participants