sanger / limber

A config-driven LIMS built on Sequencescape, primarily for running library preparation pipelines in the laboratory
MIT License
4 stars 8 forks source link

Y24-022 UI Submit Pool XP tube to traction #2008

Closed seenanair closed 3 weeks ago

seenanair commented 1 month ago

Closes https://github.com/sanger/limber/issues/1617

Changes proposed in this pull request

This PR introduces a new panel for submitting the Pool XP tube (LBSN-9216 Lib PCR Pool XP tube) to the Traction system for the BioScan pipeline. Key features:

  1. Display of the New Panel:

    The panel will only be displayed when the tube type is LBSN-9216 Lib PCR Pool XP tube and the tube is 'passed' state.

2.New Presenter:

A new presenter is added to enable the "Export to Traction" option. This feature is configured in bioscan.yml.

  1. New Component:

A new component is introduced to handle the export of the tube to Traction. This component is responsible for exporting the tube to Traction and polling Traction to verify if the export was successful. It displays: An icon to indicate the export status. A label to show the current status. A button to perform an action corresponding to the component’s current state. A spinner if there is an action in progress

Component States:

1. State 1: CHECKING_TUBE_STATUS When the component first loads, it enters the CHECKING_TUBE_STATUS state. The component displays a spinner and a message indicating that it is checking if the tube is in Traction. The button is disabled. Transitions:

State1

2. State 2: READY_TO_EXPORT This state occurs if the tube is found in Traction during State 1. The component provides a button to export the tube to Traction. Clicking the button transitions the component as follows: Transitions:

State2

3. State 3: EXPORTING_TUBE

This state occurs when the user clicks the export button, and the request to export via the Sequencescape API is successful. At this point, the component polls Traction using the Traction API to verify if the tube has been exported successfully. The component displays a spinner and a message indicating that the tube is being exported to Traction. The button is disabled. Transitions:

4. State 4: FAILURE_TUBE_CHECK This state occurs if the initial check to determine whether the tube is in Traction fails. The component provides a button to retry checking the tube's status in Traction and displays a message indicating that the export cannot be verified. On clicking the button, the component performs the same operation as in State 1.

Transition:

5. State 5: TUBE_EXPORT_SUCCESS

This state occurs when the tube export via the Sequencescape API is successful, and the subsequent polling using the Traction API also confirms success. The component displays a message indicating that the tube has been successfully exported to Traction, along with an "Open Traction" button to view the tube in Traction.

Transition:

6. State 6: TUBE_ALREADY_EXPORTED This state occurs when the initial check to see if the tube is in Traction confirms that the tube is already present. The component displays a message indicating that the tube has already been exported to Traction and shows an "Open Traction" button. Transition:

7. State 7: FAILURE_TUBE_CHECK_AFTER_EXPORT

This state occurs when the tube export via the Sequencescape API is successful, but the polling using the Traction API fails. The component displays a message indicating that the export cannot be verified and provides a button to retry polling. Transition:

8. State 8: FAILURE_EXPORT_TUBE This state occurs when the export via the Sequencescape API fails. The component displays a message indicating that the tube export to Traction failed and provides a button to retry the export. Transition:

State8

Instructions for Reviewers

Architectural diagram https://github.com/sanger/General-Backlog-Items/issues/374

[All PRs] - Confirm PR template filled
[Feature Branches] - Review code
[Production Merges to main]
    - Check story numbers included
    - Check for debug code
    - Check version

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 88.53755% with 58 lines in your changes missing coverage. Please review.

Project coverage is 78.34%. Comparing base (11736d4) to head (662c207). Report is 101 commits behind head on develop.

Files with missing lines Patch % Lines
...pp/frontend/javascript/pool-xp-tube-panel/index.js 0.00% 50 Missing :warning:
...xp-tube-panel/components/PoolXPTubeSubmitPanel.vue 98.25% 7 Missing :warning:
app/frontend/entrypoints/application.js 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #2008 +/- ## =========================================== + Coverage 77.97% 78.34% +0.37% =========================================== Files 459 471 +12 Lines 17699 18451 +752 Branches 225 262 +37 =========================================== + Hits 13800 14455 +655 - Misses 3897 3994 +97 Partials 2 2 ``` | [Flag](https://app.codecov.io/gh/sanger/limber/pull/2008/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sanger) | Coverage Δ | | |---|---|---| | [javascript](https://app.codecov.io/gh/sanger/limber/pull/2008/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sanger) | `70.43% <88.44%> (+0.74%)` | :arrow_up: | | [pull_request](https://app.codecov.io/gh/sanger/limber/pull/2008/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sanger) | `78.21% <88.53%> (+0.24%)` | :arrow_up: | | [push](https://app.codecov.io/gh/sanger/limber/pull/2008/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sanger) | `78.26% <88.53%> (+0.29%)` | :arrow_up: | | [ruby](https://app.codecov.io/gh/sanger/limber/pull/2008/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sanger) | `91.09% <100.00%> (-0.06%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sanger#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

KatyTaylor commented 1 month ago

LOVE the detailed explanation and screenshots, thank you 😍

and also love the rethink of the states, messages and styling - looks great.

Haven't looked at the code yet!

seenanair commented 3 weeks ago

Is there an integration suite test for this? Would love to see this in action (especially now that this sends messages through our queue). https://gitlab.internal.sanger.ac.uk/psd/integration-suite/-/merge_requests/183 Currently, integration-test is only checking the button is in display, it's original state and the immediate state change. I was not quite sure about how far it can be tested using integration-suite as it depends on traction. If you have any thoughts, please share.

seenanair commented 3 weeks ago

@KatyTaylor @dasunpubudumal Would you please have a look into this integration-test suite PR as well, when you get time https://gitlab.internal.sanger.ac.uk/psd/integration-suite/-/merge_requests/183

codeclimate[bot] commented 3 weeks ago

Code Climate has analyzed commit 662c207e and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 91.1% (0.0% change).

View more on Code Climate.

StephenHulme commented 1 week ago

Traction URLs set in Deployment https://github.com/sanger/deployment/pull/502