-
Notifications
You must be signed in to change notification settings - Fork 8
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
Y24-396: Refactor Automatic State Changers #2044
Y24-396: Refactor Automatic State Changers #2044
Conversation
Will likely conflict with #2034, probably best to let that be merged in first, then refactor as required. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think this needs discussion re: tube aggregation
Plus I'm also touching this file in the tuberacks story Y24-099 to add a tube rack state changer.
app/models/state_changers.rb
Outdated
|
||
api.work_completion.create!(submissions: in_prog_submissions, target: v2_labware.uuid, user: user_uuid) | ||
def labware | ||
raise 'Tubes are not supported by API V1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That can't be true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a path that appears to be used in the current iteration - I'm hoping it will be removed with @sdjmchattie's v1 API removal changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 7ca499d
…nges-using-mixins
TODO: add tests for tube automated state changer
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## y24-088-tuberacks-epic #2044 +/- ##
==========================================================
+ Coverage 80.78% 80.97% +0.19%
==========================================================
Files 482 483 +1
Lines 18295 18499 +204
Branches 269 269
==========================================================
+ Hits 14780 14980 +200
- Misses 3513 3517 +4
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good, I just don't like the tube aggregation references
Further refactoring required after #2099 is merged in |
…nges-using-mixins
This is ready for review again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor questions.
Otherwise a big improvement, thanks.
|
||
# if all the tubes are already in the target state expect contents to be empty | ||
# TODO: I'm not sure this is correct behaviour, it should probably raise an error | ||
# or a validation should catch that the state change is not needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen this before in code on the sequencescape side. It gets an api call for a state change but then has code that works out nothing needs doing. Waste of an api call.
Not sure how that even gets triggered though. If there's a button that triggers a state change that isn't needed, then the button should not be visible (i.e. validation like you said).
Maybe someone decided it was too expensive to pull all the information into Limber and instead let SS decide?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was an existing comment in the code, it was just indented as part of the refactoring
@@ -271,14 +271,20 @@ def stub_v2_tag_layout_templates(templates) | |||
end | |||
|
|||
# Builds the basic v2 tube finding query. | |||
def stub_v2_tube(tube, stub_search: true, custom_query: nil, custom_includes: nil) | |||
def stub_v2_tube(tube, stub_search: true, custom_query: nil, custom_includes: false) # rubocop:todo Metrics/AbcSize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tend to use rubocop:disable / enable over todo if I am happy with the code and have no intention of coming back to it(!)
Closes #2002
Changes proposed in this pull request
contents_for
method ofDefaultStateChanger
which was originally designed for plates and not tubesInstructions for Reviewers
[All PRs] - Confirm PR template filled
[Feature Branches] - Review code
[Production Merges to
main
]- Check story numbers included
- Check for debug code
- Check version