Skip to content

fix: support learner search for users with posts but no enrollment - #65

Merged
Alam-2U merged 3 commits into
release-ulmofrom
LP-1269
Oct 29, 2026
Merged

Alam-2U merged 3 commits into
release-ulmofrom
LP-1269

Conversation

@Alam-2U

@Alam-2U Alam-2U commented Sep 29, 2026

Copy link
Copy Markdown

Description

Learner search in the Discussions "Learners" tab did not show learners who had posted in the course but were not enrolled in it.

Cause

The search matched usernames only against course enrollments, so anyone without an enrollment was left out even when they had posts. The regular Learners list is built from forum stats, which is why these users showed up there but not in search.

Fix

  • forum: added get_usernames_with_course_stats . It returns users who have discussion stats in the course and whose username matches the search.
  • edx-platform: learner search now combines enrolled users with the users from this forum lookup, so learners who have posted are found even without an enrollment.

Ticket : LP-1269

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The MongoDB query retrieves unnecessarily large documents, and the release bump lacks the required changelog entry.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Adds a public forum API for finding course participants with discussion activity, including unenrolled posters.

Changes:

  • Implements case-insensitive username lookup for MongoDB and MySQL.
  • Exports the API and adds cross-backend tests.
  • Bumps the package version to 0.7.3.
File Description
tests/​e2e/​test_users.py Tests matching, course filtering, and regex escaping.
forum/​backends/​mysql/​api.py Implements MySQL username lookup.
forum/​backends/​mongodb/​api.py Implements MongoDB username lookup.
forum/​backends/​backend.py Extends the backend interface.
forum/​api/​users.py Adds the public API wrapper.
forum/​api/​__init__.py Exports the new API.
forum/​__init__.py Bumps the package version.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread forum/backends/mongodb/api.py Resolved
Comment thread forum/__init__.py Outdated
"""

__version__ = "0.7.2"
__version__ = "0.7.3"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Alam-2U Can you fix this?

@Alam-2U

Alam-2U commented Oct 29, 2026

Copy link
Copy Markdown
Author

@copilot resolve the merge conflicts in this pull request

Co-authored-by: Alam-2U <217736558+Alam-2U@users.noreply.github.com>

Copilot AI commented Oct 29, 2026

Copy link
Copy Markdown

@copilot resolve the merge conflicts in this pull request

Resolved the merge conflict with release-ulmo and pushed merge commit 9d27ce3.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block approval of the forum-side username lookup for learners with discussion activity but no course enrollment.

1 open issue
1 resolved since last review

Review effort: Balanced

@Alam-2U
Alam-2U merged commit 5d18f0a into release-ulmo Oct 29, 2026
14 checks passed
@Alam-2U
Alam-2U deleted the LP-1269 branch October 29, 2026 10:39
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.

5 participants