feat(deposition): remove unnecessary states#6273
Conversation
Co-authored-by: Anna (Anya) Parker <50943381+anna-parker@users.noreply.github.com>
|
Claude finished @anna-parker's task in 2m 58s —— View job Code Review
The refactor is logically sound. The old Migration concernThe A flyway migration would fix this: UPDATE submission_table SET status_all = 'READY_TO_SUBMIT' WHERE status_all = 'SUBMITTING_PROJECT';
UPDATE submission_table SET status_all = 'SUBMITTED_PROJECT' WHERE status_all = 'SUBMITTING_SAMPLE';If these states were only ever transient (held for less than one loop iteration in practice), this may be a non-issue — but it's worth confirming before merging.
|
maverbiest
left a comment
There was a problem hiding this comment.
This looks like a nice simplification of the deposition process!
I just wanted to check with you if I understand the flow before I approve since I'm still getting familiar with this code, hope that's okay:
Is it true that the first call to submission_table_start() creates an entry in the sample_table with the default state of READY. Then sample_table_create() runs, which sets it to SUBMITTED in the sample_table, and then the second call to submission_table_start() will update the status from SUBMITTED_PROJECT to SUBMITTED_SAMPLE in the submission_table?
(I think renaming submission_table_start() would be nice, as you suggested)
Small refactor, I realized while going over the code that I introduced a bunch of states in the main "submission_table" which tracks the global state of submissions that aren't used or aren't necessary.
Unused States
Can be immedietly deleted:
Unnecessary states:
I set the
submission_tablestate to submitting when starting a project or sample submission, but this is actually unnecessary as the project and sample table have full ownership of the project/sample submission cycle. Thus, this state was only used in the project and sample creation scripts when it was updated.The state
READY_TO_SUBMITis sufficient to trigger the start of the project creation. The project creation will update this state toSUBMITTED_PROJECTwhen the submission is complete. The full state of the submission is tracked in the project table.The state
SUBMITTED_PROJECTis sufficient to trigger the start of the sample creation, again the sample_table tracks the state of the sample submission. The sample creation script updates the submission_table state toSUBMITTED_SAMPLEwhen the sample submission is complete.Note project and sample submission should take seconds, if they fail the project creation and sample creation scripts will send us notifications.
Migration
SUBMITTING_PROJECTandSUBMITTING_SAMPLEshould only appear in the db table if the sequence submission is erroring. Administrators should check the failing sequences. If the errors need manual intervention they should be handled accordingly.PR Checklist
🚀 Preview: Add
previewlabel to enable