-
Notifications
You must be signed in to change notification settings - Fork 2
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
Bug: uploaded at set in wrong places. #3842
Comments
I @diitaz93 will expand this issue with concrete examples and specific modules where this was discovered |
Technical refinement
|
To refine@Clinical-Genomics/sysdev The |
Why do we remove the error handling here? It should raise an error if there is nothing to deliver. |
Why not raise the error here then? |
That is probably what should happen, I just wanted a clarification if the refinement took into consideration the other places this functionality is used as well? Currently there is only one place in which it is specified that we should add a try/except. But there may be more places where the code will crash if an error is raised. |
Describe the bug
In cg/cli/deliver/utils.py:deliver_raw_data_for_analyses we will set the uploaded_at date to datetime.now() even if there are no files to deliver. This is the current behaviour, (so not a consequence of the code in this PR) but I still think it should not be that way. This happens because when there are no files the function deliver_files_for_case exits successfully and returns None. The same happens for all the pipeline's UploadAPI method upload.
To Reproduce
Steps to reproduce the behavior:
command
inenvironment
Expected behavior
A clear and concise description of what you expected to happen.
Additional context
Add any other context about the problem here.
Clarification
Description
deliver_files_for_case
from theDeliverFilesService
(cg/services/deliver_files/deliver_files_service/deliver_files_service.py
).@handle_no_delivery_files_error
, which catchesNoDeliveryFilesError
and returnsNone
instead -> If no files are found to deliver, no error is raised.deliver_files_for_case
function is called in the uploading of files of all pipelines and in the delivery of raw data.uploaded_at
date is updated withdatetime.now()
after the function is called and whether or not the files to deliver have been foundConclusion: If no files are found to be delivered, the program exits successfully and the updated date is updated as if the files were successfully delivered (a message saying that the delivery was successful is printed in the logs).
To reproduce
See first comment
Expected behaviour
Asumptions: If there are no files to be delivered
updated_at
noruploaded_started_at
date should be updated withdatetime.now()
The text was updated successfully, but these errors were encountered: