Skip to content

feat: load fake learner competency statuses - #289

Merged
felipemontoya merged 1 commit into
openedx:mainfrom
eduNEXT:fmo/cbe-data
Nov 20, 2026
Merged

felipemontoya merged 1 commit into
openedx:mainfrom
eduNEXT:fmo/cbe-data

Conversation

@felipemontoya

@felipemontoya felipemontoya commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Summary

load-db can write fake learner competency statuses for the Aspects Competency dashboard (openedx-aspects#387). It also gains the config needed to keep fake taxonomy rows apart from real ones.

Detail

  • Taxonomy type: every fake taxonomy is written with taxonomy_type (config, default tags), in the last column, as the platform-plugin-aspects taxonomy sink writes it
  • Statuses are written only for a competency load (taxonomy_type: competency), and a --load_db_only run loads them only when its config is a competency load too
  • Two tables:
    • student_competency_status: one row per learner and competency
    • student_competency_course_status: one course-level row per learner, competency and course, the only level the sink writes; fake groups exist as ids only
  • Realism:
    • Each competency gets its own difficulty, a median mastery time drawn between about 4 hours and 30 days
    • First statuses land soon after enrollment
    • A Demonstrated draw whose mastery time falls after end_date stays PartiallyAttempted, so hard competencies show fewer masteries
    • Parents are Demonstrated when every child the learner has a status on is
  • New writers in every backend: clickhouse, csv and chdb; ralph and vector reuse the clickhouse writer
  • Config checks: the first_*_id keys must be positive integers, org_prefix letters and digits, taxonomy_export_id free of quotes and backslashes, and taxonomy_type one of tags / competency
  • Load errors:
    • A file that fails to load from S3 now fails the run at the end, instead of only being logged
    • Logs and errors show the S3 secret as **** and only the first 4 characters of the key; logged SQL is cut at 2000 characters
    • The error names the table and points to the README's new list of required tutor-contrib-aspects migrations
  • Fixes along the way:
    • Object tags were tagged at random again by each backend, and their ids restarted per course
    • Taxonomy ids differed between backends
  • Defaults keep today's output: org_prefix: Org, first ids at 1, fake export id. The exceptions are the object tag ids, which no longer restart per course.

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Nov 11, 2026
@openedx-webhooks

openedx-webhooks commented Nov 11, 2026 •

Copy link
Copy Markdown

Thanks for the pull request, @felipemontoya!

This repository is currently maintained by @openedx/xapi-db-load-maintainers.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@codecov

codecov Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.29412% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.56%. Comparing base (ac26b64) to head (73695ec).

Files with missing lines Patch % Lines
xapi_db_load/backends/clickhouse.py 79.48% 8 Missing ⚠️
xapi_db_load/backends/base_async_backend.py 83.33% 5 Missing ⚠️
xapi_db_load/backends/chdb.py 95.45% 0 Missing and 2 partials ⚠️
xapi_db_load/backends/csv.py 96.87% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #289      +/-   ##
==========================================
+ Coverage   90.26%   91.56%   +1.30%     
==========================================
  Files          36       36              
  Lines        2988     3284     +296     
  Branches      322      369      +47     
==========================================
+ Hits         2697     3007     +310     
+ Misses        260      244      -16     
- Partials       31       33       +2     
Flag Coverage Δ
unittests 91.56% <95.29%> (+1.30%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@bmtcril bmtcril left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you update the description? It still says statuses are triggered by a competency- export id prefix and written to student_competency_criteria_group_status. The code uses taxonomy_type: competency and student_competency_course_status. Looks good otherwise!

@felipemontoya

Copy link
Copy Markdown
Member Author

@bmtcril it was very outdated. I just put it up to date.

@felipemontoya
felipemontoya merged commit 1f4f285 into openedx:main Nov 20, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from Waiting on Author to Done in Contributions Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants