Skip to content
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

Release - family external ids and misc fixes #980

Merged
merged 8 commits into from
Oct 29, 2024
Merged

Release - family external ids and misc fixes #980

merged 8 commits into from
Oct 29, 2024

Conversation

dancoates
Copy link
Contributor

  • Code quality uplift
  • Permissions fixes
  • Family external ids

violetbrina and others added 8 commits October 4, 2024 15:30
* Add tests directory to sonarqube config file

* Hide db backup folder results

* Fix test exclusion for code coverage settings

* Address all current metamist bugs

* Fix security issues, including exclusive use of formatMoney with resistent regex

* formatMoney bug fix

* Fix the ValueFilter so that the useState is called in the same order in every render

* Change so that the nonroot user is used in the db dockerfile

* Change so that the nonroot user is used in the api dockerfile

* Fix default logging level to warning to reduce the leak of secure information

* Add merge_group to the test workflow

* Fix web pages format using prettier

* Fix web pages format using prettier - npm ci ran first

* Add referenceBranch to sonar-project.properties

* Update test workflow to include metamist dev branch version in analysis

* Add Sonarqube scan to deploy check, update db Dockerfile based on comments

* Fix run fastapi command in api Dockerfile
* Create family_external_id database table
* Replace family.external_id with external_ids etc
* In api/graphql/schema.py, add external_ids alongside external_id
* In ParticipantGridRow.tsx, reuse prepareExternalIds() to handle family multiple extids

* Complete rewrite of insert_or_update_multiple_families()

The previous INSERT ... ON DUPLICATE KEY UPDATE code inserts a
new family or, if the same project+external_id entry already exists,
updates description and coded_phenotype -- as external_id is part of
the key used to locate the record, it can't be updated.

With external_id moving to a separate table, we need to write this
logic out explicitly. We search by any external id, but only insert
the primary external id for new records. (At present, this functionality
is used only by FamilyLayer.import_families(), which parses only the
primary external id.)

* Use transactions in create_family() and update_family()

* FamilyTable.get_id_map_by_internal_ids() returns only primary extids

Most users of this function want a single external id (per internal id)
that they can use to populate a pedigree or for use with seqr. (The call
in ParticipantLayer.generic_individual_metadata_importer() has complex
wants but is mostly similar.) Hence, at least for now, it is simplest
to keep the 1:1 map return type and return only the primary external ids.
* fix error in translating old permissions to new

this would have allowed read access permissions to upsert samples

* fix other permission inconsistencies
* remove duplicated unittest workflow definition from deploy

* switch dockerfile CMD back to shell form as exec form wasn't working
@dancoates dancoates merged commit 0b1e130 into main Oct 29, 2024
12 of 13 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.

3 participants