Skip to content

Patch db update#854

Merged
Peter-J-Freeman merged 50 commits into
developfrom
patch_db_update
Jul 6, 2026
Merged

Patch db update#854
Peter-J-Freeman merged 50 commits into
developfrom
patch_db_update

Conversation

@Peter-J-Freeman

Copy link
Copy Markdown
Collaborator

No description provided.

Update logger and settings to remove duplicated code and add in a pro…
Update logger and settings to remove duplicated code and add in a pro…
Update logger and settings to remove duplicated code and add in a pro…
Final tweaks to the critical error bug catching code to provide detai…
fix uncertain position parsing of extracted variants errors
Correct citation formatting and punctuation in README.
Merge pull request #847 from openvar/transcript_map_data_bug

Fix a bug identified in batch processing
Added information about testing methodology and regression tests.
Added an 'About' section to provide context on VariantValidator.
Update format converter tests to use batch_list removed from vval()
In the uncorrected code, good data were not setting a variable to True.
This meant that the fell back into a post populate and only if they
could be corrected were they kept. This added slow processing and likely
 caused a lot of records to be omitted. Now corrected and tested in
 test_update_vv_db.py
Now passing batch_list and added additional tests
3 bugs identified. Tests added to cover the bugs and these add
regression testing. Also, a functional test to cover refseq_check. The
bugs prevented gene_symbol_catch from returning correctly, and missed a
fallback position in refseq_catch.
Updates the vvDBInit.py code to better handle both MySQl and MariaDB.
More stable and also used mapped error handling to enable testing
regardless of the DB engine on the OS
We periodically see non-reproducible db fetches. The commit adds in a
re-connect to the database for several attempts before raising to
mitigate these. It also adds extra coverage to key modules
2 missing imports identified. Regression tests added
@gitguardian

gitguardian Bot commented Jul 1, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
1081037 Triggered Generic Password 45ab81f db_dockerfiles/vdb/Dockerfile View secret
1081033 Triggered Generic Password 5fd599d configuration/docker-local.ini View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.17241% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.10%. Comparing base (9a412ff) to head (98f81b4).

Files with missing lines Patch % Lines
VariantValidator/modules/utils.py 87.95% 10 Missing ⚠️
VariantValidator/modules/vvMixinCore.py 59.09% 9 Missing ⚠️
VariantValidator/modules/hgvs_utils.py 0.00% 5 Missing ⚠️
VariantValidator/modules/vvMixinConverters.py 87.17% 5 Missing ⚠️
VariantValidator/modules/vvDBInit.py 90.47% 4 Missing ⚠️
VariantValidator/update_vv_db.py 63.63% 4 Missing ⚠️
VariantValidator/modules/complex_descriptions.py 89.65% 3 Missing ⚠️
VariantValidator/modules/vvMixinInit.py 83.33% 2 Missing ⚠️
VariantValidator/modules/vvDatabase.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #854      +/-   ##
===========================================
+ Coverage    77.11%   81.10%   +3.98%     
===========================================
  Files           37       37              
  Lines        13071    13208     +137     
===========================================
+ Hits         10080    10712     +632     
+ Misses        2991     2496     -495     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Peter-J-Freeman

Copy link
Copy Markdown
Collaborator Author

Codecov Report

❌ Patch coverage is 87.14286% with 9 lines in your changes missing coverage. Please review. ✅ Project coverage is 80.04%. Comparing base (9a412ff) to head (e518a9a).

Files with missing lines Patch % Lines
VariantValidator/modules/vvDBInit.py 90.47% 4 Missing ⚠️
VariantValidator/update_vv_db.py 55.55% 4 Missing ⚠️
VariantValidator/modules/vvMixinInit.py 50.00% 1 Missing ⚠️
Additional details and impacted files

@@             Coverage Diff             @@
##           develop     #854      +/-   ##
===========================================
+ Coverage    77.11%   80.04%   +2.93%     
===========================================
  Files           37       37              
  Lines        13071    13112      +41     
===========================================
+ Hits         10080    10496     +416     
+ Misses        2991     2616     -375     

☔ View full report in Codecov by Harness. 📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:

Yes, this is because I fixed some bugs, during a huge uplift of coverage. I may have lost a few lines, but gained several hundred. Is this a fail? Nope!!!!

Object creation for p. variants affecting the first aa were incorrect.
Corrected and regression tests added. Also tests for interval start >
interval end and additional tests for vvMixinCore.py. In addition, some
unused imports have been removed from various modules
Uncertain positions without a range were causing a variant posedit
creation error. Now removed. In some instances, fuzzy end posedit cannot
 be created so we keep a string. Now still raises exceptions. Fuzzy
 error exceptions now added to warnings. Additional bug fix allows
 validation if vvMixinCore.py
 `for gen in variant.primary_assembly_loci.keys()` where the variable is
  None. Tests and regression tests added to test_complex_descriptions.py
Bud identified in hgvs_utils.py. Incorrect kwarg into
the function hgvs_delins_parts_to_hgvs_obj. Additional tests and
regression tests added. Also additional coverage for
complex_descriptions.py
Ensembl rest function times out or fails repeatedly for tests that pass.
 Add retries to ensure records can update
There has been a breaking change in the Ensembl TARK url. Update to new
format
Retries added to all API calls to prevent missing data. Preferable over
a timeout. Also, specific tests added to prevent not knowing if an API
endpoint changes e.g. the recent change of TARK endpoint
@Peter-J-Freeman Peter-J-Freeman mentioned this pull request Jul 3, 2026
Allele code passing into expanded_repeats.py was returning a
non-parsable output, so could not be reached. This commit add code that
ensures the expanded_repeats return is converted into the delins format
and also, in this case adds the genomic reference so that intronic
variants will pass

To Do. Add code that can handle expanded repeats in alleles with the NC_
(NM_) format. But needs HGVS to confirm the new syntax. Also,
investigate whether it is actually possible todo the conversion back
from delins to expanded repeat from within an allele variant. Also add a
 warning that p. alleles are not supported or add in support.

@John-F-Wagstaff John-F-Wagstaff left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not nearly as experienced with the VV side of the DB code, but this looks good.

It is however getting quite large in patch number, we probably want to put this in and start a new one even if you have more bug fixes.

The only 2 things I might object to are firstly that a few of these patches would be better split up into smaller more focused patches, and secondly putting strings into the unknown spanned variants. Neither of these are worth holding this back for, so I think this is good to go in.

Using strings in hgvs objects will make the code more fragile and less clear so it its in some ways going backwards, which is not what we want to do in the long run, hence my dislike, but it works for now. A better fix is probably best left to a follow up. (We might want to put some of the tweaked HGVS object changes in the hgvs util code into vvhgvs given recent discussions and it would make sense to add accounting for unknown spans in at that point)

These bug fixes allow compound accessions to pass allele code. Also
capture m. processing of alleles and currently set r. allele processing
to unsupported. It also adds a configurable CONFIG_DIR which can be used
 by users, but mainly for testing of the config so that the system does
 not create corrupt files or cause race conditions when testing config
 manipulations. This also prevents sporadic overwriting of the ini file
 in when pytest fails
@Peter-J-Freeman

Copy link
Copy Markdown
Collaborator Author

@John-F-Wagstaff. I have now added the last push to this. This stabilised the code and fixes 2 more small bugs. I agree, it bacame more of a task than expected and would have been better split up, but its all related to upping the coverage. As I upped, more and more bugs popped out.

In terms of

Using strings in hgvs objects will make the code more fragile and less clear so it its in some ways going backwards

This is a temp solution. I want to next, if time and patience allows, start adding helper functions to remove regulat Regex and correctly implement HGVS parsing throughout the codebase, so this patch (all be it huge) focusses on code stability and code coverage, the next I do will look at the regexes.

I think merge this first, then check it all still works with your VRS code. Then I can re-branch from develop.

This all sound OK?

@John-F-Wagstaff

Copy link
Copy Markdown
Collaborator

Yes that sounds fine.

I will rebase the VRS code to avoid a nasty merge, then I can go through the patches one a a time and check that everything still works, new tests included, and apply fix-ups if needed. Once that is finished we can push the VRS code.

@Peter-J-Freeman

Copy link
Copy Markdown
Collaborator Author

OK, merging now.

Some of the new tests you may want to update. Feel free.

The key benefits of this patch are

  • Exposing as many of the RegExes as poss to testing
  • Preventing the periodic overwriting of config files during test fails and also adding in overwritable config location
  • Removing a few pesky processing bugs that prevented code being accessed so the flow is now corrected
  • Fixed up allele parsing as intended and now covers all formats except r. which I listed as unsupported as we cant do it with the current hgvs parser for r.

@Peter-J-Freeman Peter-J-Freeman merged commit 489e873 into develop Jul 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants