Skip to content

Commit

Permalink
Merge pull request #4216 from broadinstitute/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
hanars authored Jul 8, 2024
2 parents e7144d0 + 17e005f commit daefecc
Show file tree
Hide file tree
Showing 50 changed files with 545 additions and 318 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/docker-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- deploy/docker/seqr/Dockerfile
- hail_search/deploy/Dockerfile
- .hadolint.yaml
- .docker-compose.yaml
- .github/workflows/docker-lint.yaml
pull_request:
types: [opened, synchronize, reopened]
Expand All @@ -21,13 +22,16 @@ on:
- deploy/docker/seqr/Dockerfile
- hail_search/deploy/Dockerfile
- .hadolint.yaml
- .docker-compose.yaml
- .github/workflows/docker-lint.yaml

jobs:
hadolint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
- name: Validate docker compose
run: docker-compose -f docker-compose.yml config
- uses: hadolint/hadolint-action@v1.5.0
with:
dockerfile: deploy/docker/seqr/Dockerfile
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## dev

## 7/8/24
* Add VLM contact for Projects (REQUIRES DB MIGRATION)

## 6/11/24
* Add "Partial Phenotype Contribution" functional tag (REQUIRES DB MIGRATION)

Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-c requirements.txt # use the generated reqs as a constraint
coverage<5.2
django-compressor
django-debug-toolbar<3.3 # https://github.com/jazzband/django-debug-toolbar
django-debug-toolbar # https://github.com/jazzband/django-debug-toolbar
mock # mock objects for unit tests
pip-tools # tool for managing our python dependency tree
responses # mock HTTP responses for unit tests
Expand Down
10 changes: 2 additions & 8 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ click==8.1.3
# via pip-tools
coverage==5.1
# via -r requirements-dev.in
django==3.2.25
django==4.2.13
# via
# -c requirements.txt
# django-appconf
Expand All @@ -47,10 +47,6 @@ pip-tools==6.12.2
# via -r requirements-dev.in
pyproject-hooks==1.0.0
# via build
pytz==2022.7.1
# via
# -c requirements.txt
# django
rcssmin==1.1.1
# via django-compressor
requests==2.32.2
Expand All @@ -69,9 +65,7 @@ sqlparse==0.5.0
toml==0.10.2
# via responses
tomli==2.0.1
# via
# build
# pyproject-hooks
# via build
types-toml==0.10.8.5
# via responses
urllib3==1.26.19
Expand Down
8 changes: 4 additions & 4 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Django<3.3 # core server-side framework
Django>=4.2,<4.3 # core server-side framework
django-anymail # for sending emails using cloud-based mail service providers
django-csp # for setting CSP headers
django-guardian # object-level permissions for database records. Behind a major version due to missing Python 2 support
django-hijack # allows admins to login as other user
django-notifications-hq # notification app
django-cors-headers # allows CORS requests for client-side development
django-storages[google]==1.11.1 # alternative GCS storage backend for the django media_root
social-auth-app-django # the package for Django to authenticate users with social medieas
django-storages[google] # alternative GCS storage backend for the django media_root
social-auth-app-django>5.0.0 # the package for Django to authenticate users with social medieas
social-auth-core # the Python social authentication package. Required by social-auth-app-django
elasticsearch==7.9.1 # elasticsearch client
elasticsearch-dsl==7.2.1 # elasticsearch query utilities
gunicorn # web server
jmespath
openpyxl # library for reading/writing Excel files
pillow # required dependency of Djagno ImageField-type database records
psycopg2 # postgres database access
psycopg # postgres database access
pyliftover # GRCh37/GRCh38 liftover
requests # simpler way to make http requests
redis<4.6 # client lib for the redis in-memory database - used for caching server-side objects
Expand Down
17 changes: 9 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ defusedxml==0.7.1
# via
# python3-openid
# social-auth-core
django==3.2.25
django==4.2.13
# via
# -r requirements.in
# django-anymail
Expand All @@ -38,6 +38,7 @@ django==3.2.25
# django-notifications-hq
# django-storages
# jsonfield
# social-auth-app-django
django-anymail==9.0
# via -r requirements.in
django-cors-headers==3.13.0
Expand Down Expand Up @@ -107,7 +108,7 @@ protobuf==3.20.2
# via
# google-api-core
# googleapis-common-protos
psycopg2==2.9.5
psycopg==3.2.1
# via -r requirements.in
pyasn1==0.4.8
# via
Expand All @@ -117,7 +118,7 @@ pyasn1-modules==0.2.8
# via google-auth
pycparser==2.21
# via cffi
pyjwt==2.6.0
pyjwt==2.8.0
# via social-auth-core
pyliftover==0.4
# via -r requirements.in
Expand All @@ -126,9 +127,7 @@ python-dateutil==2.8.2
python3-openid==3.2.0
# via social-auth-core
pytz==2022.7.1
# via
# django
# django-notifications-hq
# via django-notifications-hq
redis==4.5.4
# via -r requirements.in
requests==2.32.2
Expand Down Expand Up @@ -159,9 +158,9 @@ slacker==0.14.0
# via -r requirements.in
slugify==0.0.1
# via -r requirements.in
social-auth-app-django==5.0.0
social-auth-app-django==5.4.1
# via -r requirements.in
social-auth-core==4.3.0
social-auth-core==4.5.4
# via
# -r requirements.in
# social-auth-app-django
Expand All @@ -175,6 +174,8 @@ tenacity==8.3.0
# via -r requirements.in
tqdm==4.66.3
# via -r requirements.in
typing-extensions==4.12.2
# via psycopg
urllib3==1.26.19
# via
# elasticsearch
Expand Down
4 changes: 4 additions & 0 deletions seqr/fixtures/1kg_project.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"has_case_review": true,
"mme_primary_data_owner": "PI",
"mme_contact_url": "mailto:test@broadinstitute.org,matchmaker@broadinstitute.org",
"vlm_contact_email": "test@broadinstitute.org,vlm@broadinstitute.org",
"last_accessed_date": "2017-09-15T18:15:50.827Z"
}
},
Expand All @@ -41,6 +42,7 @@
"can_view_group": 3,
"is_mme_enabled": false,
"mme_primary_data_owner": "",
"vlm_contact_email": "vlm@broadinstitute.org",
"last_accessed_date": "2017-09-15T18:15:50.827Z"
}
},
Expand All @@ -63,6 +65,7 @@
"is_demo": true,
"mme_primary_data_owner": "",
"mme_contact_url": "mailto:seqr-test@gmail.com,test@broadinstitute.org",
"vlm_contact_email": "seqr-test@gmail.com,test@broadinstitute.org",
"last_accessed_date": "2017-09-15T18:15:50.827Z"
}
},
Expand All @@ -81,6 +84,7 @@
"last_accessed_date": "2017-09-15T18:15:50.827Z",
"consent_code": "H",
"genome_version": "38",
"vlm_contact_email": "vlm@broadinstitute.org",
"workspace_name": "anvil-non-analyst-project 1000 Genomes Demo",
"workspace_namespace": "ext-data"
}
Expand Down
42 changes: 36 additions & 6 deletions seqr/fixtures/social_auth.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
"user": 10,
"provider": "google-oauth2",
"uid": "test_user@broadinstitute.org",
"extra_data": "{\"expires\": 3599, \"auth_time\": 1603287741, \"token_type\": \"Bearer\", \"access_token\": \"ya29.EXAMPLE\"}",
"extra_data": {
"expires": 3599,
"auth_time": 1603287741,
"token_type": "Bearer",
"access_token": "ya29.EXAMPLE"
},
"created": "2020-03-12T23:09:54.180Z",
"modified": "2020-03-12T23:09:54.180Z"
}
Expand All @@ -17,7 +22,12 @@
"user": 11,
"provider": "google-oauth2",
"uid": "test_user_manager@test.com",
"extra_data": "{\"expires\": 3599, \"auth_time\": 1603287741, \"token_type\": \"Bearer\", \"access_token\": \"ya29.EXAMPLE\"}",
"extra_data": {
"expires": 3599,
"auth_time": 1603287741,
"token_type": "Bearer",
"access_token": "ya29.EXAMPLE"
},
"created": "2020-03-12T23:09:54.180Z",
"modified": "2020-03-12T23:09:54.180Z"
}
Expand All @@ -28,7 +38,12 @@
"user": 12,
"provider": "google-oauth2",
"uid": "test_user_no_staff@test.com",
"extra_data": "{\"expires\": 3599, \"auth_time\": 1603287741, \"token_type\": \"Bearer\", \"access_token\": \"ya29.EXAMPLE\"}",
"extra_data": {
"expires": 6666,
"auth_time": 1603287741,
"token_type": "Bearer",
"access_token": "ya29.EXAMPLE"
},
"created": "2020-03-12T23:09:54.180Z",
"modified": "2020-03-12T23:09:54.180Z"
}
Expand All @@ -39,7 +54,12 @@
"user": 13,
"provider": "google-oauth2",
"uid": "test_user_no_access@test.com",
"extra_data": "{\"expires\": 3599, \"auth_time\": 1603287741, \"token_type\": \"Bearer\", \"access_token\": \"ya29.EXAMPLE\"}",
"extra_data": {
"expires": 3599,
"auth_time": 1603287741,
"token_type": "Bearer",
"access_token": "ya29.EXAMPLE"
},
"created": "2020-03-12T23:09:54.180Z",
"modified": "2020-03-12T23:09:54.180Z"
}
Expand All @@ -50,7 +70,12 @@
"user": 17,
"provider": "google-oauth2",
"uid": "test_pm_user@test.com",
"extra_data": "{\"expires\": 3599, \"auth_time\": 1603287741, \"token_type\": \"Bearer\", \"access_token\": \"ya29.EXAMPLE\"}",
"extra_data": {
"expires": 3599,
"auth_time": 1603287741,
"token_type": "Bearer",
"access_token": "ya29.EXAMPLE"
},
"created": "2020-03-12T23:09:54.180Z",
"modified": "2020-03-12T23:09:54.180Z"
}
Expand All @@ -61,7 +86,12 @@
"user": 15,
"provider": "google-oauth2",
"uid": "test_superuser@test.com",
"extra_data": "{\"expires\": 3599, \"auth_time\": 1603287741, \"token_type\": \"Bearer\", \"access_token\": \"ya29.EXAMPLE\"}",
"extra_data": {
"expires": 3599,
"auth_time": 1603287741,
"token_type": "Bearer",
"access_token": "ya29.EXAMPLE"
},
"created": "2020-03-12T23:09:54.180Z",
"modified": "2020-03-12T23:09:54.180Z"
}
Expand Down
7 changes: 6 additions & 1 deletion seqr/migrations/0024_varianttag_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from collections import defaultdict
from django.contrib.postgres.aggregates import StringAgg
from django.db import migrations, models
from django.db.models import TextField
from django.db.models.functions import Concat
from django.utils import timezone
from seqr.utils.logging_utils import log_model_update, log_model_bulk_update, SeqrLogger
Expand Down Expand Up @@ -120,7 +121,11 @@ def merge_duplicate_tags(apps, schema_editor):
db_alias = schema_editor.connection.alias

updated_tags = VariantTag.objects.using(db_alias).filter(variant_tag_type__name__in=SANGER_TAGS.values()).annotate(
group_id=Concat('variant_tag_type__guid', StringAgg('saved_variants__guid', ',', ordering='saved_variants__guid')))
group_id=Concat(
'variant_tag_type__guid',
StringAgg('saved_variants__guid', ',', ordering='saved_variants__guid'),
output_field=TextField()
))
if not updated_tags:
logger.info('No updated tags found, skipping validation tag merging', user=None)
return
Expand Down
29 changes: 29 additions & 0 deletions seqr/migrations/0068_project_vlm_contact_email.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generated by Django 3.2.23 on 2024-06-28 15:44

from django.db import migrations, models


def update_vlm_contact_email(apps, schema_editor):
Project = apps.get_model('seqr', 'Project')
db_alias = schema_editor.connection.alias

projects = Project.objects.using(db_alias).all()
for project in projects:
project.vlm_contact_email = project.mme_contact_url.replace('mailto:', '').replace('matchmaker', 'vlm')
Project.objects.using(db_alias).bulk_update(projects, ['vlm_contact_email'])


class Migration(migrations.Migration):

dependencies = [
('seqr', '0067_alter_variantfunctionaldata_functional_data_tag'),
]

operations = [
migrations.AddField(
model_name='project',
name='vlm_contact_email',
field=models.TextField(blank=True, default='vlm@broadinstitute.org', null=True),
),
migrations.RunPython(update_vlm_contact_email, reverse_code=migrations.RunPython.noop),
]
6 changes: 5 additions & 1 deletion seqr/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
from seqr.utils.xpos_utils import get_chrom_pos
from seqr.views.utils.terra_api_utils import anvil_enabled
from reference_data.models import GENOME_VERSION_GRCh37, GENOME_VERSION_CHOICES
from settings import MME_DEFAULT_CONTACT_NAME, MME_DEFAULT_CONTACT_HREF, MME_DEFAULT_CONTACT_INSTITUTION
from settings import MME_DEFAULT_CONTACT_NAME, MME_DEFAULT_CONTACT_HREF, MME_DEFAULT_CONTACT_INSTITUTION, \
VLM_DEFAULT_CONTACT_EMAIL

logger = SeqrLogger(__name__)

Expand Down Expand Up @@ -196,6 +197,8 @@ class Project(ModelWithGUID):
mme_contact_url = models.TextField(null=True, blank=True, default=MME_DEFAULT_CONTACT_HREF)
mme_contact_institution = models.TextField(null=True, blank=True, default=MME_DEFAULT_CONTACT_INSTITUTION)

vlm_contact_email = models.TextField(null=True, blank=True, default=VLM_DEFAULT_CONTACT_EMAIL)

has_case_review = models.BooleanField(default=False)
enable_hgmd = models.BooleanField(default=False)
all_user_demo = models.BooleanField(default=False)
Expand Down Expand Up @@ -261,6 +264,7 @@ class Meta:
'name', 'description', 'created_date', 'last_modified_date', 'genome_version', 'mme_contact_institution',
'last_accessed_date', 'is_mme_enabled', 'mme_primary_data_owner', 'mme_contact_url', 'guid', 'consent_code',
'workspace_namespace', 'workspace_name', 'has_case_review', 'enable_hgmd', 'is_demo', 'all_user_demo',
'vlm_contact_email',
]


Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading

0 comments on commit daefecc

Please sign in to comment.