Skip to content

fix: Report type missing for cohort results on data downloads#38362

Merged
wgu-taylor-payne merged 4 commits intoopenedx:masterfrom
WGU-Open-edX:wgu-jesse-stewart/38092-cohort-data-downloads
Apr 15, 2026
Merged

fix: Report type missing for cohort results on data downloads#38362
wgu-taylor-payne merged 4 commits intoopenedx:masterfrom
WGU-Open-edX:wgu-jesse-stewart/38092-cohort-data-downloads

Conversation

@wgu-jesse-stewart
Copy link
Copy Markdown
Contributor

@wgu-jesse-stewart wgu-jesse-stewart commented Apr 14, 2026

Fixes: #38092

Description

This PR fixes a bug where cohort results reports generated from uploading a CSV file to add learners to cohorts would display "Unknown" as the report type in the data downloads table.

What changed:

  • Added COHORT_RESULTS to the ReportType enum in lms/djangoapps/instructor/constants.py
  • Updated the _detect_report_type_from_filename method in lms/djangoapps/instructor/views/api_v2.py to properly detect cohort results files by matching the 'cohort_results' string in filenames

Impact:

  • User roles affected: Course Instructors and Course Staff
  • User-facing change: The "Report Type" column in the data downloads table will now correctly display "cohort_results" instead of "Unknown" for cohort assignment reports

Before:

Report Type Report Name
Unknown OpenedX_DemoX_DemoCourse_cohort_results_2026-03-04-1725.csv
image

After:

Report Type Report Name
Cohort Results OpenedX_DemoX_DemoCourse_cohort_results_2026-03-04-1725.csv
image

Supporting information

#38092

Testing instructions

  1. Navigate to the Instructor Dashboard for any course
  2. Go to the "Membership" tab
  3. Under "Cohort Management", upload a CSV file to add learners to a cohort
  4. After the upload completes, navigate to the "Data Downloads" tab
  5. Verify that the generated cohort results report shows "cohort_results" as the Report Type instead of "Unknown"

Alternative testing via API:

  1. Generate a cohort results report using the bulk cohort assignment feature
  2. Call the API endpoint: GET /api/instructor/v2/courses/{course_id}/reports
  3. Verify that the response includes "report_type": "cohort_results" for cohort result files

Deadline

None

Other information

  • This is a minor bug fix with no breaking changes
  • No database migrations required
  • No configuration changes needed
  • No dependencies on other changes

@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 Apr 14, 2026
@openedx-webhooks
Copy link
Copy Markdown

openedx-webhooks commented Apr 14, 2026

Thanks for the pull request, @wgu-jesse-stewart!

This repository is currently maintained by @openedx/wg-maintenance-openedx-platform.

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.

@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Apr 14, 2026
@wgu-jesse-stewart wgu-jesse-stewart marked this pull request as ready for review April 14, 2026 22:23
@wgu-jesse-stewart wgu-jesse-stewart added the waiting for eng review PR is ready for review. Review and merge it, or suggest changes. label Apr 14, 2026
Copy link
Copy Markdown
Contributor

@dwong2708 dwong2708 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks.

Copy link
Copy Markdown
Contributor

@dwong2708 dwong2708 left a comment

Choose a reason for hiding this comment

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

Sorry, I forgot something, could you update this test to include this change?

Copy link
Copy Markdown
Contributor

@wgu-taylor-payne wgu-taylor-payne left a comment

Choose a reason for hiding this comment

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

LGTM!

@wgu-taylor-payne wgu-taylor-payne merged commit 9176b83 into openedx:master Apr 15, 2026
65 of 72 checks passed
@github-project-automation github-project-automation bot moved this from Needs Triage to Done in Contributions Apr 15, 2026
@openedx-webhooks openedx-webhooks removed the waiting for eng review PR is ready for review. Review and merge it, or suggest changes. label Apr 15, 2026
@diana-villalvazo-wgu diana-villalvazo-wgu deleted the wgu-jesse-stewart/38092-cohort-data-downloads branch April 15, 2026 22:47
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.

Report type missing for cohort results on data downloads

4 participants