From d967a893ac60ade9e1fda4e7780c87d3f582dfd6 Mon Sep 17 00:00:00 2001 From: June Guo Date: Wed, 18 Mar 2026 14:35:40 -0400 Subject: [PATCH 1/2] added /health path --- backend/Platform/urls.py | 2 ++ backend/tests/identity/test_views.py | 6 ++++++ k8s/main.ts | 1 + 3 files changed, 9 insertions(+) diff --git a/backend/Platform/urls.py b/backend/Platform/urls.py index b93269b..fe339c8 100644 --- a/backend/Platform/urls.py +++ b/backend/Platform/urls.py @@ -2,6 +2,7 @@ from django.contrib import admin from django.urls import include, path from django.views.generic import TemplateView +from health.views import HealthView from rest_framework.schemas import get_schema_view @@ -13,6 +14,7 @@ path("accounts/", include("accounts.urls", namespace="oauth2_provider")), path("options/", include("options.urls", namespace="options")), path("identity/", include("identity.urls", namespace="identity")), + path("health/", HealthView.as_view(), name="health"), path("healthcheck/", include("health.urls", namespace="healthcheck")), path("s/", include("shortener.urls", namespace="shortener")), path( diff --git a/backend/tests/identity/test_views.py b/backend/tests/identity/test_views.py index e44e3d4..83ff52d 100644 --- a/backend/tests/identity/test_views.py +++ b/backend/tests/identity/test_views.py @@ -190,3 +190,9 @@ def test_health(self): resp = self.client.get(url) self.assertEqual(resp.status_code, 200) self.assertEqual(resp.json(), {"message": "OK"}) + + def test_health_shortcut(self): + url = reverse("health") + resp = self.client.get(url) + self.assertEqual(resp.status_code, 200) + self.assertEqual(resp.json(), {"message": "OK"}) diff --git a/k8s/main.ts b/k8s/main.ts index 69c887a..cdefdbc 100644 --- a/k8s/main.ts +++ b/k8s/main.ts @@ -48,6 +48,7 @@ export class MyChart extends PennLabsChart { "/openapi", "/documentation", "/Shibboleth.sso", + "/health", "/healthcheck", ], isSubdomain: true, From 60b810f8538e497761ad01b803a9053d52554172 Mon Sep 17 00:00:00 2001 From: June Guo Date: Wed, 18 Mar 2026 14:39:44 -0400 Subject: [PATCH 2/2] removed old healthcheck --- backend/Platform/urls.py | 4 +--- backend/health/__init__.py | 5 ----- backend/health/urls.py | 2 +- backend/tests/identity/test_views.py | 8 +------- k8s/main.ts | 1 - 5 files changed, 3 insertions(+), 17 deletions(-) diff --git a/backend/Platform/urls.py b/backend/Platform/urls.py index fe339c8..f152f54 100644 --- a/backend/Platform/urls.py +++ b/backend/Platform/urls.py @@ -2,7 +2,6 @@ from django.contrib import admin from django.urls import include, path from django.views.generic import TemplateView -from health.views import HealthView from rest_framework.schemas import get_schema_view @@ -14,8 +13,7 @@ path("accounts/", include("accounts.urls", namespace="oauth2_provider")), path("options/", include("options.urls", namespace="options")), path("identity/", include("identity.urls", namespace="identity")), - path("health/", HealthView.as_view(), name="health"), - path("healthcheck/", include("health.urls", namespace="healthcheck")), + path("health/", include("health.urls", namespace="health")), path("s/", include("shortener.urls", namespace="shortener")), path( "openapi/", diff --git a/backend/health/__init__.py b/backend/health/__init__.py index e860540..e69de29 100644 --- a/backend/health/__init__.py +++ b/backend/health/__init__.py @@ -1,5 +0,0 @@ -from django.apps import AppConfig - - -class HealthConfig(AppConfig): - name = "health" diff --git a/backend/health/urls.py b/backend/health/urls.py index f8e0b52..7e1f218 100644 --- a/backend/health/urls.py +++ b/backend/health/urls.py @@ -5,5 +5,5 @@ app_name = "health" urlpatterns = [ - path("backend/", HealthView.as_view(), name="backend"), + path("", HealthView.as_view(), name="health"), ] diff --git a/backend/tests/identity/test_views.py b/backend/tests/identity/test_views.py index 83ff52d..09685d0 100644 --- a/backend/tests/identity/test_views.py +++ b/backend/tests/identity/test_views.py @@ -186,13 +186,7 @@ def setUp(self): self.client = Client() def test_health(self): - url = reverse("healthcheck:backend") - resp = self.client.get(url) - self.assertEqual(resp.status_code, 200) - self.assertEqual(resp.json(), {"message": "OK"}) - - def test_health_shortcut(self): - url = reverse("health") + url = reverse("health:health") resp = self.client.get(url) self.assertEqual(resp.status_code, 200) self.assertEqual(resp.json(), {"message": "OK"}) diff --git a/k8s/main.ts b/k8s/main.ts index cdefdbc..332dec3 100644 --- a/k8s/main.ts +++ b/k8s/main.ts @@ -49,7 +49,6 @@ export class MyChart extends PennLabsChart { "/documentation", "/Shibboleth.sso", "/health", - "/healthcheck", ], isSubdomain: true, }],