-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FC-73 Xqu add submission file (Feature: Submission File System - Enhanced File Management for Graded Submissions) #286
base: master
Are you sure you want to change the base?
Conversation
Thanks for the pull request, @leoaulasneo98! This repository is currently maintained by 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 approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo 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:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 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:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #286 +/- ##
==========================================
+ Coverage 94.43% 94.92% +0.48%
==========================================
Files 18 19 +1
Lines 2263 2481 +218
Branches 95 101 +6
==========================================
+ Hits 2137 2355 +218
Misses 115 115
Partials 11 11
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:
|
Review should only start after PR #283 is merged. |
9d2c25b
to
f7d55d7
Compare
8b556bf
to
5f37f2e
Compare
5f37f2e
to
b9ce70a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update author of cange
Add link to first ADR
Summarize and simplify.
""" | ||
files_urls = {} | ||
for filename, file_obj in files_dict.items(): | ||
if not (isinstance(file_obj, (bytes, ContentFile, SimpleUploadedFile)) or hasattr(file_obj, 'read')): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why check for hasattr(file_obj, 'read')
?
logger.warning(f"Invalid file object type for {filename}") | ||
continue | ||
|
||
if hasattr(file_obj, 'read'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain this workflow
- Create Submission file model - Develop SubmissionFileManager for centralized DB query handling - Add classes to handle file errors - Add TestSubmissionFileManager with extensive test coverage - Test file processing with different input types (bytes, file objects) - Implement error handling tests for IO errors and invalid files - Verify complete file processing workflow - Validation tests for file addition in create_external_grader_detail - Document architectural decisions with ADR - Add test queue folder in .gitignore
b9ce70a
to
ee29b2e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok on my side. Please open for Axim's review.
FC-73 Feature: Submission File System - Enhanced File Management for Graded Submissions
Description
This pull request implements a comprehensive file management system for submissions through the introduction of the
SubmissionFile
model and its associatedSubmissionFileManager
. This enhancement supports proper storage, retrieval, and processing of files attached to submissions within the Open edX ecosystem.Motivation
The existing submission system requires enhanced file handling capabilities to:
Previously, the XQueue server managed files for submissions that required document attachments. However, this was implemented inefficiently using plain text fields (s3_keys and s3_urls) without proper structure or validation. This approach led to inconsistent file handling, potential security issues, and maintenance challenges as the system scaled.
Key Improvements
Model Enhancements
SubmissionFile
model with:File Processing System
SubmissionFileManager
with capabilities for:Error Handling
Technical Details
File Processing
Integration Points
ExternalGraderDetail
for complete submission workflowTesting Strategy
Extensive test coverage includes:
Open edX Compliance
This implementation adheres to Open edX standards through:
Performance Considerations
BREAKING CHANGES: None. Designed for full compatibility with existing systems.