Skip to content
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

submission: create original format in converted directory when record finalised #653

Closed
GraemeWatt opened this issue May 9, 2023 · 0 comments
Assignees
Labels
complexity: low priority: high type: bug Indicates an unexpected problem or unintended behaviour

Comments

@GraemeWatt
Copy link
Member

GraemeWatt commented May 9, 2023

The do_finalise function creates output files in the converted directory for each file format overwriting any previous files:

for file_format in ['yaml', 'csv', 'yoda', 'root']:
convert_and_store.delay(hep_submission.inspire_id, file_format, force=True)

However, the original format is missing. This means that an original file could be created at an early stage before a record is finalised if a user clicks "Download All" then "YAML resource files". If the user does not subsequently click that button for the final version of a record (before finalisation), then after finalisation, the cached original file will still correspond to the early upload. I found this scenario had occurred today for a recent record. The fix is to replace the iteration over file formats in the code above with CFG_SUPPORTED_FORMATS (including original), then delete all original files from the converted directory after deployment so that they will be recreated.

@GraemeWatt GraemeWatt added type: bug Indicates an unexpected problem or unintended behaviour priority: high complexity: low labels May 9, 2023
@GraemeWatt GraemeWatt self-assigned this May 9, 2023
@github-project-automation github-project-automation bot moved this to To do in @HEPData May 9, 2023
@github-project-automation github-project-automation bot moved this from To do to Done in @HEPData May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: low priority: high type: bug Indicates an unexpected problem or unintended behaviour
Projects
Status: Done
Development

No branches or pull requests

1 participant