-
Notifications
You must be signed in to change notification settings - Fork 297
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
Delete incomplete file uploads #1329
Delete incomplete file uploads #1329
Conversation
@rithviknishad @vigneshhari review pls |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
…aivendra/care into delete_incomplete_file_uploads
Updated the code - to make bulk delete from s3, thereby reducing the number of api requests. |
care/facility/tasks/fileupload/delete_incomplete_file_uploads.py
Outdated
Show resolved
Hide resolved
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## master #1329 +/- ##
==========================================
- Coverage 56.71% 56.65% -0.06%
==========================================
Files 199 195 -4
Lines 9905 9866 -39
Branches 1654 1656 +2
==========================================
- Hits 5618 5590 -28
+ Misses 4232 4222 -10
+ Partials 55 54 -1
☔ View full report in Codecov by Sentry. |
@sainak Review please |
@khavinshankar @sainak can you guys check if this affects discharge summaries or ABDM uploads. |
@vigneshhari it affects all uploaded files |
@sainak I know that it affects all uploaded files, i want to know if it affects any of our existing workflows, since we use files in HCX and discharge summaries and other stuff like that. |
@vigneshhari this shouldn't be a problem for HCX or discharge summary. |
care/facility/tasks/fileupload/delete_incomplete_file_uploads.py
Outdated
Show resolved
Hide resolved
Please add unit tests, unit tests are required for every PR's. |
Can you check if the bulk API has an upper limit, This might create an issue when the first time it's run. |
…aivendra/care into delete_incomplete_file_uploads
Yes, the upper limit is 1000 keys per a request. I updated code to handle the keys in batches. Btw just to confirm , our bucket is not object versioned rgt? |
Actually the reason I haven't added the tests is that I haven't tests for most of the existing code expect for some APIs in |
@mathew-alex are S3 objects versioned in any deployment ? |
We don't have unit tests for most ( >90% ) of the code base, but recently we started enforcing unit testing, you can create unit tests like existing ones and call the celery methods directly to test them. You have the option to test the S3 operations via localstack, if you don't want to go that route, you can mock the S3 operations. |
@vigneshhari Okay, added the tests. can you please check now! |
Hey I have gone through the code base quite a few times, wherever s3 configs or s3 methods made use of. No where Versioning details are mentioned. if versioning exists, it has to dealt while creation and retrieving of objects. So, ig none of our existing deployments are using versioned s3 buckets. |
@yaswanthsaivendra - bucket versioning is enabled in cloud bucket settings. |
@yaswanthsaivendra please reply to @mathew-alex 's comment |
Proposed Changes
Associated Issue
@coronasafe/code-reviewers
Merge Checklist
/docs