Skip to content

Commit

Permalink
Merge pull request #4181 from broadinstitute/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
hanars authored Jun 20, 2024
2 parents d0545e7 + aa5419e commit 3166cf6
Show file tree
Hide file tree
Showing 10 changed files with 227 additions and 153 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dev-hail-search-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ jobs:
persist-credentials: false
fetch-depth: 0

- name: update image tag in the broad seqr chart
- name: update image tag in the dev broad seqr chart
uses: mikefarah/[email protected]
with:
cmd: >
yq -i '.hail-search.image.tag = "${{ github.event.workflow_run.head_sha }}"' charts/broad-seqr/values-dev.yaml
yq -i '.hail-search.image.tag = "${{ github.event.workflow_run.head_sha }}"' charts/dev-broad-seqr/values.yaml
- name: Commit and Push changes
uses: Andro999b/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dev-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ jobs:
persist-credentials: false
fetch-depth: 0

- name: update image tag in the broad seqr chart
- name: update image tag in the dev broad seqr chart
uses: mikefarah/[email protected]
with:
cmd: >
yq -i '.seqr.image.tag = "${{ github.event.workflow_run.head_sha }}"' charts/broad-seqr/values-dev.yaml
yq -i '.seqr.image.tag = "${{ github.event.workflow_run.head_sha }}"' charts/dev-broad-seqr/values.yaml
- name: Commit and Push changes
uses: Andro999b/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cffi==1.15.1
# via cryptography
charset-normalizer==3.0.1
# via requests
cryptography==42.0.6
cryptography==42.0.8
# via social-auth-core
defusedxml==0.7.1
# via
Expand Down Expand Up @@ -131,7 +131,7 @@ pytz==2022.7.1
# django-notifications-hq
redis==4.5.4
# via -r requirements.in
requests==2.32.0
requests==2.32.2
# via
# -r requirements.in
# django-anymail
Expand Down
13 changes: 8 additions & 5 deletions seqr/views/apis/report_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,13 @@ def _add_row(row, family_id, row_type):
(FINDINGS_TABLE, genetic_findings_rows),
]

files, warnings = _populate_gregor_files(file_data)
files, warnings, errors = _populate_gregor_files(file_data)

if errors and not request_json.get('overrideValidation'):
raise ErrorsWarningsException(errors, warnings)
else:
warnings = errors + warnings

write_multiple_files_to_gs(files, file_path, request.user, file_format='tsv')

return create_json_response({
Expand Down Expand Up @@ -700,10 +706,7 @@ def _populate_gregor_files(file_data):
for column, config in table_config.items():
_validate_column_data(column, file_name, data, column_validator=config, warnings=warnings, errors=errors)

if errors:
raise ErrorsWarningsException(errors, warnings)

return files, warnings
return files, warnings, errors


def _load_data_model_validators():
Expand Down
326 changes: 191 additions & 135 deletions seqr/views/apis/report_api_tests.py

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion seqr/views/apis/users_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ def get_all_user_group_options(request):
@login_and_policies_required
def get_project_collaborator_options(request, project_guid):
project = get_project_and_check_permissions(project_guid, request.user)
user_fields = {'display_name', 'username', 'email'}
users = get_project_collaborators_by_username(
request.user, project, fields={'display_name', 'username', 'email'}, expand_user_groups=True,
request.user, project, fields=user_fields, expand_user_groups=True,
)
if not users:
users = {request.user.username: get_json_for_user(request.user, user_fields)}
return create_json_response(users)


Expand Down
7 changes: 6 additions & 1 deletion seqr/views/apis/users_api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def test_get_project_collaborator_options(self):
users.update(self.COLLABORATOR_JSON)
users.pop('[email protected]', None)
self.assertDictEqual(response_json, users)
return url

def test_get_all_collaborator_options(self):
url = reverse(get_all_collaborator_options)
Expand Down Expand Up @@ -425,7 +426,7 @@ def _assert_403_response(self, response, **kwargs):
_test_delete_collaborator_group_response = _assert_403_response

def test_get_project_collaborator_options(self, *args, **kwargs):
super(AnvilUsersAPITest, self).test_get_project_collaborator_options(*args, **kwargs)
url = super(AnvilUsersAPITest, self).test_get_project_collaborator_options(*args, **kwargs)
self.mock_list_workspaces.assert_not_called()
self.assertEqual(self.mock_get_ws_acl.call_count, 1)
self.mock_get_ws_acl.assert_called_with(
Expand All @@ -436,6 +437,10 @@ def test_get_project_collaborator_options(self, *args, **kwargs):
self.mock_get_groups.assert_not_called()
self.mock_get_group_members.assert_called_with(self.collaborator_user, 'Analysts', use_sa_credentials=True)

self.mock_get_ws_acl.side_effect = lambda *args: {}
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
self.assertDictEqual(response.json(), {'test_user_collaborator': MAIN_COLLABORATOR_JSON['test_user_collaborator']})

def test_set_password(self):
super(AnvilUsersAPITest, self).test_set_password()
Expand Down
4 changes: 2 additions & 2 deletions seqr/views/utils/anvil_metadata_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def _get_parsed_saved_discovery_variants_by_family(
variant_fields += ['svType', 'svName', 'end']

parsed_variant = {
'chrom': chrom,
'chrom': 'MT' if chrom == 'M' else chrom,
'pos': pos,
'variant_reference_assembly': GENOME_VERSION_LOOKUP[variant_json['genomeVersion']],
'gene_id': gene_id,
Expand Down Expand Up @@ -624,7 +624,7 @@ def _get_mondo_condition_data(mondo_id):
inheritance = HumanPhenotypeOntology.objects.get(hpo_id=inheritance['id']).name.replace(' inheritance', '')
return {
'known_condition_name': data['name'],
'condition_inheritance': inheritance,
'condition_inheritance': inheritance or 'Unknown',
}
except Exception:
return {}
Expand Down
11 changes: 9 additions & 2 deletions ui/pages/Report/components/Gregor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ import React from 'react'
import { Header } from 'semantic-ui-react'

import { validators } from 'shared/components/form/FormHelpers'
import { ButtonRadioGroup } from 'shared/components/form/Inputs'
import { ButtonRadioGroup, InlineToggle } from 'shared/components/form/Inputs'
import UploadFormPage from 'shared/components/page/UploadFormPage'
import { CONSENT_CODES } from 'shared/utils/constants'
import { HttpRequestHelper } from 'shared/utils/httpRequestHelper'

const FIELDS = [

{
name: 'overrideValidation',
label: 'Upload with Validation Errors',
component: InlineToggle,
asFormInput: true,
fullHeight: true,
inline: false,
},
{
name: 'deliveryPath',
label: 'AnVIL Delivery Bucket Path',
Expand Down
2 changes: 1 addition & 1 deletion ui/shared/components/form/Inputs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ BooleanCheckbox.propTypes = {

export const AlignedBooleanCheckbox = AlignedCheckboxGroup.withComponent(BooleanCheckbox)

const BaseInlineToggle = styled(({ divided, fullHeight, asFormInput, padded, ...props }) => <BooleanCheckbox {...props} toggle inline />)`
const BaseInlineToggle = styled(({ divided, fullHeight, asFormInput, padded, inline = true, ...props }) => <BooleanCheckbox {...props} toggle inline={inline} />)`
${props => (props.asFormInput ?
`label {
font-weight: 700;
Expand Down

0 comments on commit 3166cf6

Please sign in to comment.