Skip to content

Commit 3b58a1a

Browse files
authored
Merge pull request #1211 from open-dynaMIX/fix_healthz
fix(healthz): do not rely on SAGW email set on identity
2 parents b10ecd7 + 1620039 commit 3b58a1a

File tree

4 files changed

+4
-14
lines changed

4 files changed

+4
-14
lines changed

api/mysagw/healthz/health_checks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def _check_pending_migrations(db_name):
3434
def _check_models(database):
3535
"""Check model fetching on database."""
3636
# Retrieve object
37-
identity = Identity.objects.get(email="sagw@sagw.ch", is_organisation=True)
37+
identity = Identity.objects.first()
3838
assert identity
3939

4040
return {database: {"ok": True}}

api/mysagw/healthz/tests/test_healthz.py

-10
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
from watchman import settings as watchman_settings
55

66

7-
def _set_identity_healthcheck_properties(identity):
8-
identity.email = "sagw@sagw.ch"
9-
identity.is_organisation = True
10-
identity.save()
11-
12-
137
@pytest.mark.parametrize(
148
"client,expected_status",
159
[
@@ -20,8 +14,6 @@ def _set_identity_healthcheck_properties(identity):
2014
indirect=["client"],
2115
)
2216
def test_healthz_permissions(db, snapshot, identity, client, expected_status):
23-
_set_identity_healthcheck_properties(identity)
24-
2517
url = reverse("healthz")
2618

2719
response = client.get(url)
@@ -48,8 +40,6 @@ def test_db_migrations_not_applied(
4840
Affects database migrations health check, which should detect unapplied
4941
migrations and fail.
5042
"""
51-
_set_identity_healthcheck_properties(identity)
52-
5343
# get /healthz/ response and compare to previous snapshot
5444
response = client.get(reverse("healthz"))
5545
snapshot.assert_match(response.json())

api/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "mysagw"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
description = "Application management for SAGW"
55
repository = "https://github.com/adfinis/mySAGW"
66
authors = ["Adfinis"]

compose.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
x-version: 0.5.2
2+
x-version: 0.5.3
33

44
services:
55
db:
@@ -11,7 +11,7 @@ services:
1111
- "5432:5432"
1212

1313
api:
14-
image: ghcr.io/adfinis/mysagw/api:0.2.0
14+
image: ghcr.io/adfinis/mysagw/api:0.2.1
1515
environment:
1616
- DATABASE_HOST=db
1717
- DATABASE_PORT=5432

0 commit comments

Comments
 (0)