fix: missing transcript should not fail export#604
Closed
ormsbee wants to merge 4 commits into
Closed
Conversation
A missing transcript file may happen because those transcripts were never properly imported. But regardless of how we get in that state, we shouldn't break course export. The best we can do is log the error and then have get_video_transcript_data return None (i.e. we have no data for this transcript).
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 Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #604 +/- ##
==========================================
- 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
I forgot that edx-val's Pact situation means that PRs can only be opened from this repo, not from a fork. 🙀 Closing this to re-open the same thing elsewhere. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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