Skip to content

Comments

[PROD-4408] Include start/end dates for external course runs in Studio API payload#4653

Closed
rjv31 wants to merge 2 commits intoopenedx:masterfrom
rjv31:PROD-4408/fix-start_date_updation
Closed

[PROD-4408] Include start/end dates for external course runs in Studio API payload#4653
rjv31 wants to merge 2 commits intoopenedx:masterfrom
rjv31:PROD-4408/fix-start_date_updation

Conversation

@rjv31
Copy link
Contributor

@rjv31 rjv31 commented Jul 30, 2025

This PR addresses the need to ensure that external course runs include their start and end dates when updating via the Studio API.

Ticket - https://2u-internal.atlassian.net/browse/PROD-4408

Key Changes:

  1. Introduced is_external_course property on the Course model to determine external product types.
  2. Updated generate_data_for_studio_api:
  3. start and end dates are now included when either creating the course run or when the course is external.
  4. Enrollment start/end dates remain update-only, consistent with current API behavior.
  5. Refactored make_studio_data in test suite to merge schedule fields when both start/end and enrollment_start/end are present.
  6. Added unit tests to verify:
  • Inclusion of start/end for external vs. non-external courses.
  • Correct behavior on create vs. update operations.

This ensures Studio receives the appropriate scheduling metadata for external products, avoiding downstream issues related to incomplete data.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jul 30, 2025
@openedx-webhooks
Copy link

Thanks for the pull request, @rjv31!

This repository is currently maintained by @openedx/2u-phoenix.

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
🔘 Submit a signed contributor agreement (CLA)

⚠️ We ask all contributors to the Open edX project to submit a signed contributor agreement or indicate their institutional affiliation.
Please see the CONTRIBUTING file for more information.

If you've signed an agreement in the past, you may need to re-sign.
See The New Home of the Open edX Codebase for details.

Once you've signed the CLA, please allow 1 business day for it to be processed.
After this time, you can re-run the CLA check by adding a comment below that you have signed it.
If the CLA check continues to fail, you can tag the @openedx/cla-problems team in a comment for further assistance.

🔘 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.

Comment on lines +484 to +485
'start': self.get_formatted_datetime_string(f"{course_run_data['start_date']} {course_run_data['start_time']}"),
'end': self.get_formatted_datetime_string(f"{course_run_data['end_date']} {course_run_data['end_time']}"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Since csv_loader has been modified, the tests within csv_loader also need to be updated.


is_external = course_run.course.is_external_course

# start, end, and pacing are not sent on updates - Studio is where users edit them
Copy link
Contributor

Choose a reason for hiding this comment

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

Update this comment to reflect the changes made.

# It is better to keep the flow consistent across places.
# Allow sending enrollment start and end dates as part of Update only.
data['schedule'] = {
data.setdefault('schedule', {})
Copy link
Contributor

Choose a reason for hiding this comment

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

A small in-line comment on why this change was done can be helpful.

@mphilbrick211
Copy link

Hi @rjv31! Thank you for this contribution! Please let me know if you have any questions about submitting a CLA form.

@mphilbrick211 mphilbrick211 moved this from Needs Triage to Needs Tests Run or CLA Signed in Contributions Aug 5, 2025
@mphilbrick211 mphilbrick211 added the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Aug 5, 2025
@rjv31 rjv31 closed this Aug 6, 2025
@github-project-automation github-project-automation bot moved this from Needs Tests Run or CLA Signed to Done in Contributions Aug 6, 2025
@openedx-webhooks openedx-webhooks removed the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Aug 6, 2025
@rjv31
Copy link
Contributor Author

rjv31 commented Aug 6, 2025

Duplicate PR , raised another PR on this #4658

@rjv31 rjv31 deleted the PROD-4408/fix-start_date_updation branch August 26, 2025 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants