Skip to content

fix: missing transcript should not fail export#606

Merged
ormsbee merged 1 commit intomasterfrom
ormsbee/fix-broken-xml-export
May 5, 2026
Merged

fix: missing transcript should not fail export#606
ormsbee merged 1 commit intomasterfrom
ormsbee/fix-broken-xml-export

Conversation

@ormsbee
Copy link
Copy Markdown
Contributor

@ormsbee ormsbee commented May 2, 2026

Before this commit, a missing transcript file would raise a FileNotFoundError from get_video_transcript_data() when the file was missing. This can happen if there are references to edx-val video_ids in the course content, but the corresponding transcript files were never properly exported. This exception was never handled anywhere in edx-val, so it would fail the course export entirely.

Now we catch the FileField's underlying FileNotFoundError and re-raise a TranscriptNotFoundError, and then catch that a couple layers up in create_transcripts_xml(). This means that a missing transcript will not fail other transcripts for the same VideoBlock (though in practice, if one is broken, the others are likely broken as well).

Fixes openedx/openedx-demo-course#60

Before this commit, a missing transcript file would raise a
FileNotFoundError from get_video_transcript_data() when the file was
missing. This can happen if there are references to edx-val video_ids in
the course content, but the corresponding transcript files were never
properly exported. This exception was never handled anywhere in edx-val,
so it would fail the course export entirely.

Now we catch the FileField's underlying FileNotFoundError and re-raise a
TranscriptNotFoundError, and then catch that a couple layers up in
create_transcripts_xml(). This means that a missing transcript will not
fail other transcripts for the same VideoBlock (though in practice, if
one is broken, the others are likely broken as well).
@codecov
Copy link
Copy Markdown

codecov Bot commented May 2, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.78%. Comparing base (9145aa6) to head (0224b79).

Files with missing lines Patch % Lines
edxval/api.py 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #606      +/-   ##
==========================================
- Coverage   94.86%   94.78%   -0.08%     
==========================================
  Files          33       33              
  Lines        3350     3358       +8     
  Branches      129      129              
==========================================
+ Hits         3178     3183       +5     
- Misses        154      157       +3     
  Partials       18       18              
Flag Coverage Δ
unittests 94.78% <85.71%> (-0.08%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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.

@sarina
Copy link
Copy Markdown
Contributor

sarina commented May 2, 2026

I am not a qualified reviewer for this but ❤️

@ormsbee ormsbee merged commit 6b0b5a8 into master May 5, 2026
7 of 9 checks passed
@ormsbee ormsbee deleted the ormsbee/fix-broken-xml-export branch May 5, 2026 17:53
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.

Error with missing video transcripts

4 participants