Clinical-Genomics / scout

VCF visualization interface
https://clinical-genomics.github.io/scout
BSD 3-Clause "New" or "Revised" License
147 stars 43 forks source link

Flash an alert when loqus instance is not reachable #4673

Closed northwestwitch closed 2 weeks ago

northwestwitch commented 2 weeks ago

This PR adds a functionality or fixes a bug.

Testing on cg-vm1 server (Clinical Genomics Stockholm) **Prepare for testing** 1. Make sure the PR is pushed and available on [Docker Hub](https://hub.docker.com/repository/docker/clinicalgenomics/scout-server-stage) 1. Fist book your testing time using the Pax software available at [https://pax.scilifelab.se/](https://pax.scilifelab.se). The resource you are going to call dibs on is `scout-stage` and the server is `cg-vm1`. 1. `ssh @cg-vm1.scilifelab.se` 1. `sudo -iu hiseq.clinical` 1. `ssh localhost` 1. (optional) Find out which scout branch is currently deployed on cg-vm1: `podman ps` 1. Stop the service with current deployed branch: `systemctl --user stop scout.target` 1. Start the scout service with the branch to test: `systemctl --user start scout@` 1. Make sure the branch is deployed: `systemctl --user status scout.target` 1. After testing is done, repeat procedure at [https://pax.scilifelab.se/](https://pax.scilifelab.se), which will release the allocated resource (`scout-stage`) to be used for testing by other users.
Testing on hasta server (Clinical Genomics Stockholm) **Prepare for testing** 1. `ssh @hasta.scilifelab.se` 1. Book your testing time using the Pax software. `us; paxa -u -s hasta -r scout-stage`. You can also use the WSGI Pax app available at [https://pax.scilifelab.se/](https://pax.scilifelab.se). 1. (optional) Find out which scout branch is currently deployed on cg-vm1: `conda activate S_scout; pip freeze | grep scout-browser` 1. Deploy the branch to test: `bash /home/proj/production/servers/resources/hasta.scilifelab.se/update-tool-stage.sh -e S_scout -t scout -b ` 1. Make sure the branch is deployed: `us; scout --version` 1. After testing is done, repeat the `paxa` procedure, which will release the allocated resource (`scout-stage`) to be used for testing by other users.

How to test -- on cg-vm1:

  1. Change the settings of a scout institute to connect to a broken or not existent loqus instance
  2. Go to a variant page

How to test -- locally:

  1. Uncomment the lines in the config file relative to the loqusdb API instance
  2. Go to a variant page

Expected outcome:

Review:

dnil commented 2 weeks ago

Nice! Just ping when ready for review!

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.

Project coverage is 84.50%. Comparing base (5e7adeb) to head (2d59d03).

Files Patch % Lines
scout/server/blueprints/variant/controllers.py 60.00% 2 Missing :warning:
scout/server/extensions/loqus_extension.py 88.88% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #4673 +/- ## ======================================= Coverage 84.49% 84.50% ======================================= Files 310 310 Lines 18798 18797 -1 ======================================= Hits 15884 15884 + Misses 2914 2913 -1 ```

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

northwestwitch commented 2 weeks ago

Ok I got confused by the fact that loqusdb api returns 404 when a variant is not found (I was expecting 200 but {} as content) and also from scout that modifies the response from that api before parsing it 🙄

Now it should be always returning {}, regardless of if the variant is found or not. But should flash a message if there is a connection error

image
sonarcloud[bot] commented 2 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud