Skip to content

feat: return 200 when a transcript upload replaces an existing language - #39038

Open
abhalsod-sonata wants to merge 1 commit into
openedx:masterfrom
abhalsod-sonata:feat/transcript-upload-replace-status
Open

feat: return 200 when a transcript upload replaces an existing language#39038
abhalsod-sonata wants to merge 1 commit into
openedx:masterfrom
abhalsod-sonata:feat/transcript-upload-replace-status

Conversation

@abhalsod-sonata

@abhalsod-sonata abhalsod-sonata commented Aug 27, 2026

Copy link
Copy Markdown

upload_transcript (the handler behind the /transcript_upload/ endpoint used by the
Studio videos page) currently returns 201 Created whether the upload creates a
transcript for a new language or replaces an existing one. This change makes it return
200 OK when the upload replaces an existing language's transcript, keeping 201 for
first-time uploads.

Why: the in-platform transcript editor
(openedx/frontend-app-authoring#3215) saves edits by re-uploading the SRT
through this existing endpoint, and needs the create/replace distinction to give course
authors accurate feedback. The check reuses the same
new_language_code in get_available_transcript_languages(...) membership test that
validate_transcript_upload_data in this module already applies, so the semantics have
in-repo precedent.

Impacted user roles: Course Authors (via the videos-page transcript editor);
Developers/API consumers of /transcript_upload/ (see behavior-change note under
"Other information").

Diffstat: transcript_storage_handlers.py +5/−1, plus one new test in
cms/djangoapps/contentstore/views/tests/test_transcript_settings.py
(test_transcript_upload_handler_returns_200_on_replace). The pre-existing
test_transcript_upload_handler posts a new language against mocked ['en'] and
correctly continues to expect 201, unchanged.

Supporting information

Testing instructions

Automated:

pytest cms/djangoapps/contentstore/views/tests/test_transcript_settings.py -q
# (tutor: tutor dev run cms pytest cms/djangoapps/contentstore/views/tests/test_transcript_settings.py -q)

Manual (tutor dev + authoring MFE):

  1. Run Studio and the authoring MFE (npm run dev, port 2001) against a course that
    has a video with at least one transcript.
  2. Course → Videos → open a video's transcript row → upload/replace flow (or use the
    transcript editor from the companion PR and hit Save).
  3. In the browser network tab, confirm: uploading a transcript for a new language
    returns 201; uploading again for the same language returns 200. The
    transcript content is replaced either way.

Deadline

None.

Other information

  • Behavior change on an existing endpoint: the response code for the
    replace case changes from 201 → 200 (both 2xx). The authoring MFE and the legacy
    Studio video-uploads page treat any 2xx as success; flagging for any external
    clients that strictly match 201.
  • Depends on nothing; the frontend PR depends on this one and should merge after it.
  • No migrations, no settings changes, no feature flag (the downstream toggle was
    intentionally not ported — the feature ships enabled, per product review).
  • Docs: course-author documentation will be proposed separately against
    docs.openedx.org.
  • No backport to named releases requested.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Aug 27, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @abhalsod-sonata!

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

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.

@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Aug 27, 2026
@mphilbrick211 mphilbrick211 added the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Aug 27, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Needs Tests Run or CLA Signed in Contributions Aug 27, 2026
@mphilbrick211

Copy link
Copy Markdown

Hi @abhalsod-sonata! Thanks for this contribution!

Are you contributing on behalf of Sonata? If so, please have your manager reach out to oscm@axim.org so we can add you to the existing entity agreement. This way we can get your CLA check to turn green, and get this reviewed for you. Thanks!

@mphilbrick211 mphilbrick211 removed the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Aug 27, 2026
upload_transcript returned 201 for both create and replace. The Studio
videos-page transcript editor (openedx/frontend-app-authoring#<FRONTEND_PR>)
saves edits by re-uploading the SRT through this endpoint and needs to
distinguish the two, so replacing an existing language's transcript now
returns 200 while first-time uploads keep returning 201.

This mirrors the membership check validate_transcript_upload_data
already performs in this module, and adds a test covering the new
response-code path.
@abhalsod-sonata
abhalsod-sonata force-pushed the feat/transcript-upload-replace-status branch from 9ef9580 to 42aaaec Compare August 28, 2026 07:29
@abhalsod-sonata

Copy link
Copy Markdown
Author

Hi @abhalsod-sonata! Thanks for this contribution!

Are you contributing on behalf of Sonata? If so, please have your manager reach out to oscm@axim.org so we can add you to the existing entity agreement. This way we can get your CLA check to turn green, and get this reviewed for you. Thanks!

CLA check resolved!.

@abhalsod-sonata

Copy link
Copy Markdown
Author

@mphilbrick211
Can you please review and approve this PR?
CLA check is pass.

@mphilbrick211 mphilbrick211 added needs test run Author's first PR to this repository, awaiting test authorization from Axim needs reviewer assigned PR needs to be (re-)assigned a new reviewer and removed needs test run Author's first PR to this repository, awaiting test authorization from Axim labels Aug 28, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Tests Run or CLA Signed to Ready for Review in Contributions Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs reviewer assigned PR needs to be (re-)assigned a new reviewer open-source-contribution PR author is not from Axim or 2U

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

3 participants