Skip to content

Commit

Permalink
feat: upgrade to sodar core v1 (#1973)
Browse files Browse the repository at this point in the history
  • Loading branch information
stolpeo committed Oct 17, 2024
1 parent 4dbf02b commit 9f79c9a
Show file tree
Hide file tree
Showing 78 changed files with 2,568 additions and 2,303 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- 6379:6379

postgres:
image: postgres:14
image: postgres:16
env:
POSTGRES_DB: varfish_web
POSTGRES_USER: varfish_web
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
with:
# We need to fix the patch version here otherwise, snapshot tests
# with randomness will / may fail.
python-version: "3.10.13"
python-version: "3.11"

- name: Install pip and Pipenv
run: |
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"

- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -182,7 +182,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"

- name: Install pip and Pipenv
run: pip install pip pipenv
Expand Down
11 changes: 7 additions & 4 deletions backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,16 @@ ci: \
docs:
pipenv run $(MAKE) -C ../docs clean html

.PHONY: _migrate
_migrate:
.PHONY: _makemigrations
_makemigrations:
pipenv run $(MANAGE) makemigrations
pipenv run $(MANAGE) migrate

.PHONY: makemigrations
makemigrations: _makemigrations format

.PHONY: migrate
migrate: _migrate format
migrate:
pipenv run $(MANAGE) migrate

.PHONY: shell
shell:
Expand Down
15 changes: 8 additions & 7 deletions backend/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@ name = "pypi"
aldjemy = "~=2.2"
altamisa = "~=0.2.5"
attrs = "~=24.2"
beautifulsoup4 = "~=4.9"
beautifulsoup4 = "~=4.12.3"
cattrs = "*"
django = "*" # whatever django-sodar-core enforces
django-clone = "*"
django-cryptographic-fields-bihealth = "~=0.6.0"
django-debug-toolbar = "*"
django-extensions = "~=3.2"
django-postgres-copy = "~=2.3.5" # there are issues above 2.3
django-plugins-bihealth = "~=0.4.0"
django-sodar-core = "~=0.13.4"
django-plugins-bihealth = "~=0.5.2"
django-sodar-core = "~=1.0.2"
django-su = "~=1.0.0"
djangorestframework-httpsignature = "~=1.0"
djangorestframework = "~=3.15"
djproxy = "~=2.3"
drf-keyed-list-bihealth = "~=0.1.1"
drf-keyed-list-bihealth = "~=0.2.1"
httpsig = "~=1.3"
interval-binning = "~=1.0"
intervaltree = "~=3.1"
Expand Down Expand Up @@ -51,10 +52,10 @@ wrapt = "~=1.16"
xlsxwriter = "~=3.2"
django-pydantic-field = "*"
pydantic = "*"
typing-extensions="*"
universal-pathlib = "*"
s3fs = "*"
toml = "*"
black = "*"
rich = "*"
drf-writable-nested = "*"
django-modelcluster = "*"
Expand Down Expand Up @@ -96,7 +97,7 @@ django-types = "*"
[ldap-packages]
# Dependencies for enabling LDAP support. You will need the system library
# named `libldap` (or similar).
django-auth-ldap = "~=4.1"
django-auth-ldap = "~=4.6"
python-ldap = "~=3.4"
# Packages needed in production.

Expand All @@ -109,4 +110,4 @@ django-storages = "*"
django_redis = "*"

[requires]
python_version = "3.10"
python_version = "3.11"
2,256 changes: 1,114 additions & 1,142 deletions backend/Pipfile.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions backend/beaconsite/tests/test_permissions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.urls import reverse
from projectroles.tests.test_permissions import TestProjectPermissionBase
from projectroles.tests.test_permissions import ProjectPermissionTestBase

from beaconsite.tests.factories import ConsortiumFactory, SiteFactory

Expand All @@ -24,14 +24,14 @@ def setUp(self):
]


class TestIndexView(UsersMixin, TestProjectPermissionBase):
class TestIndexView(UsersMixin, ProjectPermissionTestBase):
def test_index(self):
url = reverse("beaconsite:index")
self.assert_response(url, self.good_users, 200)
self.assert_response(url, self.bad_users, 302)


class TestConsortiumViews(UsersMixin, TestProjectPermissionBase):
class TestConsortiumViews(UsersMixin, ProjectPermissionTestBase):
def test_list(self):
url = reverse("beaconsite:consortium-list")
self.assert_response(url, self.good_users, 200)
Expand Down Expand Up @@ -59,7 +59,7 @@ def test_delete(self):
self.assert_response(url, self.bad_users, 302)


class TestSiteViews(UsersMixin, TestProjectPermissionBase):
class TestSiteViews(UsersMixin, ProjectPermissionTestBase):
def test_list(self):
url = reverse("beaconsite:site-list")
self.assert_response(url, self.good_users, 200)
Expand Down
6 changes: 3 additions & 3 deletions backend/beaconsite/tests/test_permissions_ajax.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import cattr
from django.urls import reverse
from projectroles.tests.test_permissions_api import TestProjectAPIPermissionBase
from projectroles.tests.test_permissions_api import ProjectAPIPermissionTestBase
import requests_mock

from ..models import Site
from ..models_api import BeaconAlleleRequest
from .factories import SiteFactory


class TestOrganisationAjaxViews(TestProjectAPIPermissionBase):
class TestOrganisationAjaxViews(ProjectAPIPermissionTestBase):
@requests_mock.Mocker()
def test_get(self, r_mock):
_local_site = SiteFactory(role=Site.LOCAL) # noqa: F841
Expand Down Expand Up @@ -57,7 +57,7 @@ def test_get(self, r_mock):
self.assert_response(url, bad_users, 302, method="GET") # redirect to login


class TestBeaconQueryAjaxView(TestProjectAPIPermissionBase):
class TestBeaconQueryAjaxView(ProjectAPIPermissionTestBase):
@requests_mock.Mocker()
def test_get(self, r_mock):
_local_site = SiteFactory(role=Site.LOCAL) # noqa: F841
Expand Down
6 changes: 3 additions & 3 deletions backend/beaconsite/tests/test_permissions_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from django.shortcuts import reverse
from django.utils import timezone
import httpsig
from projectroles.tests.test_permissions_api import TestProjectAPIPermissionBase
from projectroles.tests.test_permissions_api import ProjectAPIPermissionTestBase

from variants.tests.factories import SmallVariantFactory

Expand Down Expand Up @@ -42,7 +42,7 @@ def get_accept_header(self, media_type, version):
return {_header_canonical(k): v for k, v in signed_headers_dict.items()}


class TestBeaconInfoApiView(AcceptHeaderMixin, TestProjectAPIPermissionBase):
class TestBeaconInfoApiView(AcceptHeaderMixin, ProjectAPIPermissionTestBase):
def setUp(self):
super().setUp()
self.consortium = ConsortiumWithLocalAndRemoteSiteFactory()
Expand Down Expand Up @@ -110,7 +110,7 @@ def _get_date():
self.get_date = old_get_date


class TestBeaconQueryApiView(AcceptHeaderMixin, TestProjectAPIPermissionBase):
class TestBeaconQueryApiView(AcceptHeaderMixin, ProjectAPIPermissionTestBase):
def setUp(self):
super().setUp()
self.consortium = ConsortiumWithLocalAndRemoteSiteFactory()
Expand Down
4 changes: 2 additions & 2 deletions backend/beaconsite/tests/test_views_ajax.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

from django.urls import reverse
import jsonmatch
from projectroles.tests.test_permissions_api import TestProjectAPIPermissionBase
from projectroles.tests.test_permissions_api import ProjectAPIPermissionTestBase
import requests_mock

RE_UUID4 = re.compile(r"^[0-9a-f-]+$")
RE_DATETIME = re.compile(r"^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ$")


class TestBeaconInfoAjaxView(TestProjectAPIPermissionBase):
class TestBeaconInfoAjaxView(ProjectAPIPermissionTestBase):
"""Permission tests for the AJAX views dealing with Organisation."""

def setUp(self):
Expand Down
60 changes: 30 additions & 30 deletions backend/beaconsite/urls.py
Original file line number Diff line number Diff line change
@@ -1,87 +1,87 @@
"""URL configuration for the ``beaconsite`` app.
"""

from django.conf.urls import url
from django.urls import path

from . import views, views_ajax, views_api

app_name = "beaconsite"

ui_urlpatterns = [
url(
regex=r"^$",
path(
route="",
view=views.IndexView.as_view(),
name="index",
),
url(
regex=r"^consortium$",
path(
route="consortium/",
view=views.ConsortiumListView.as_view(),
name="consortium-list",
),
url(
regex=r"^consortium/(?P<consortium>[0-9a-f-]+)$",
path(
route="consortium/<uuid:consortium>/",
view=views.ConsortiumDetailView.as_view(),
name="consortium-detail",
),
url(
regex=r"^consortium/create/$",
path(
route="consortium/create/",
view=views.ConsortiumCreateView.as_view(),
name="consortium-create",
),
url(
regex=r"^consortium/update/(?P<consortium>[0-9a-f-]+)$",
path(
route="consortium/update/<uuid:consortium>/",
view=views.ConsortiumUpdateView.as_view(),
name="consortium-update",
),
url(
regex=r"^consortium/delete/(?P<consortium>[0-9a-f-]+)$",
path(
route="consortium/delete/<uuid:consortium>/",
view=views.ConsortiumDeleteView.as_view(),
name="consortium-delete",
),
url(
regex=r"^site$",
path(
route="site/",
view=views.SiteListView.as_view(),
name="site-list",
),
url(
regex=r"^site/(?P<site>[0-9a-f-]+)$",
path(
route="site/<uuid:site>/",
view=views.SiteDetailView.as_view(),
name="site-detail",
),
url(
regex=r"^site/create/$",
path(
route="site/create/",
view=views.SiteCreateView.as_view(),
name="site-create",
),
url(
regex=r"^site/update/(?P<site>[0-9a-f-]+)$",
path(
route="site/update/<uuid:site>/",
view=views.SiteUpdateView.as_view(),
name="site-update",
),
url(
regex=r"^site/delete/(?P<site>[0-9a-f-]+)$",
path(
route="site/delete/<uuid:site>/",
view=views.SiteDeleteView.as_view(),
name="site-delete",
),
]

ajax_urlpatterns = [
url(
regex=r"^ajax/beacon/info/(?P<site>[0-9a-f-]+)$",
path(
route="ajax/beacon/info/<uuid:site>/",
view=views_ajax.BeaconInfoAjaxView.as_view(),
name="ajax-beacon-info",
),
url(
regex=r"^ajax/beacon/query/(?P<site>[0-9a-f-]+)$",
path(
route="ajax/beacon/query/<uuid:site>/",
view=views_ajax.BeaconQueryAjaxView.as_view(),
name="ajax-beacon-query",
),
]

beacon_api_urlpatterns = [
url(regex=r"^endpoint/?$", view=views_api.BeaconInfoApiView.as_view(), name="beacon-api-info"),
url(
regex=r"^endpoint/query/?$",
path(route="endpoint", view=views_api.BeaconInfoApiView.as_view(), name="beacon-api-info"),
path(
route="endpoint/query/",
view=views_api.BeaconQueryApiView.as_view(),
name="beacon-api-query",
),
Expand Down
4 changes: 2 additions & 2 deletions backend/cases/tests/test_permissions.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django.urls import reverse
from projectroles.tests.test_permissions import TestProjectPermissionBase
from projectroles.tests.test_permissions import ProjectPermissionTestBase


class TestCasesViews(TestProjectPermissionBase):
class TestCasesViews(ProjectPermissionTestBase):
"""Permission tests for the ``cases`` views"""

def test_entrypoint(self):
Expand Down
Loading

0 comments on commit 9f79c9a

Please sign in to comment.