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

Fix #4642 - dont crash on missing phenotype terms #4643

Closed dnil closed 1 month ago

dnil commented 1 month ago

This PR fixes a bug - as far as we understand a benign case page crash.

I'm not entirely sure what vacated the phenotype_terms in this case - something creative with manual editing of gene list, and toggling of use-HPO-for-filtering perhaps?

But, we do seem to regard this as a non-mandatory value for cases, so I guess we better test for its existence: https://github.com/Clinical-Genomics/scout/blob/6f6bc8958faec6a40bb57b34afd2e1c4a7915244/scout/adapter/mongo/case.py#L1118

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:

  1. how to test it, possibly with real cases/data

Expected outcome: The functionality should be working Take a screenshot and attach or copy/paste the output.

Review:

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 84.57%. Comparing base (6f6bc89) to head (0e9eb9a). Report is 1 commits behind head on main.

:exclamation: Current head 0e9eb9a differs from pull request most recent head 2746a9a

Please upload reports for the commit 2746a9a to get more accurate results.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #4643 +/- ## ========================================== + Coverage 84.55% 84.57% +0.01% ========================================== Files 309 309 Lines 18768 18756 -12 ========================================== - Hits 15870 15862 -8 + Misses 2898 2894 -4 ```

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

dnil commented 1 month ago

Marking as ready based on the error report and the clear possibility for the key to be missing. I have not been able to reproduce the underlying issue though, so something could still be hiding here.

sonarcloud[bot] commented 1 month 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