fix: remove all staging files for submission#8535
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8535 +/- ##
==========================================
+ Coverage 88.81% 88.87% +0.06%
==========================================
Files 312 312
Lines 40856 40890 +34
==========================================
+ Hits 36288 36343 +55
+ Misses 4568 4547 -21 ☔ View full report in Codecov by Sentry. |
| def remove_staging_files(name, rev): | ||
| """Remove staging files corresponding to a submission""" | ||
| basename = pathlib.Path(settings.IDSUBMIT_STAGING_PATH) / f'{name}-{rev}' | ||
| exts = [f'.{ext}' for ext in settings.IDSUBMIT_FILE_TYPES] |
There was a problem hiding this comment.
This is getting lucky and will only work as long as the set of generated filetypes is a subset of the submitable file types.
There was a problem hiding this comment.
Is there any reason not to just remove anything with the given stem?
There was a problem hiding this comment.
Not certain of the history, but I think IDSUBMIT_FILE_TYPES is essentially "extensions that might be associated with a submission" at this point. We use it in a couple places where we move files around. (See rename_submission_files and move_files_to_repository, at least.)
I'm inclined to keep it this way and fix it all when we refactor submission artifact handling.
There was a problem hiding this comment.
There'll be an issue to resolve when we're holding both xml2rfc and rfc2html ".html" files.
Fixes #8534