From 318125cf4e36d711b1953412e0fca22a8e725143 Mon Sep 17 00:00:00 2001 From: Ian Hinder Date: Tue, 30 Sep 2025 14:10:30 +0100 Subject: [PATCH 1/4] capxmock.json: Remove fields no longer provided by CapX --- capxmock/capxmock.json | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/capxmock/capxmock.json b/capxmock/capxmock.json index e88ffc0..abc07ed 100644 --- a/capxmock/capxmock.json +++ b/capxmock/capxmock.json @@ -6,27 +6,12 @@ "response": { "body": [{"name": "Person A", - "skills": [{"controlledName": "Skill 1", - "hasValidWikiLink": 2, - "name": "Skill 1", - "rareness": 2, - "rarenessCount": 7, - "skillTagId": 1, - "tasksNeedingThisSkill": null}, - {"controlledName": "Skill 2", - "hasValidWikiLink": 2, - "name": "Skill 2", - "rareness": 2, - "rarenessCount": 7, - "skillTagId": 1, - "tasksNeedingThisSkill": null}]}, + "skills": [{"name": "Skill 1", + "skillTagId": 1}, + {"name": "Skill 2", + "skillTagId": 1}]}, {"name": "Person B", - "skills": [{"controlledName": "Skill 3", - "hasValidWikiLink": 2, - "name": "Skill 3", - "rareness": 2, - "rarenessCount": 7, - "skillTagId": 1, - "tasksNeedingThisSkill": null}]}] + "skills": [{"name": "Skill 3", + "skillTagId": 1}]}] } } From f654722919db85a350fdc3afaee96dd3e9b30984 Mon Sep 17 00:00:00 2001 From: Ian Hinder Date: Tue, 30 Sep 2025 14:31:14 +0100 Subject: [PATCH 2/4] Use 'name' instead of 'controlledName' from CapX API result --- application.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application.py b/application.py index 968470e..dfd3a52 100644 --- a/application.py +++ b/application.py @@ -70,7 +70,7 @@ def get_people(): transformed_data = {} for persondata in data: transformed_data[persondata["name"]] = { - "interests": [skill["controlledName"] for skill in persondata["skills"]] + "interests": [skill["name"] for skill in persondata["skills"]] } return transformed_data From 11e01c2549357c9b71fe127ec7bc430ecddb961b Mon Sep 17 00:00:00 2001 From: Ian Hinder Date: Wed, 8 Oct 2025 13:59:30 +0100 Subject: [PATCH 3/4] .gitignore: Add __pycache__ --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5ceb386..7f93ebf 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ venv +__pycache__ From 4c9576c8b314e8242b1d433d2efe76812f137ff7 Mon Sep 17 00:00:00 2001 From: Ian Hinder Date: Wed, 8 Oct 2025 15:48:39 +0100 Subject: [PATCH 4/4] Dockerfile: Improve healthcheck We use newer features in Docker to initially try the healthcheck with a short interval, but then reduce to a longer interval for normal use. This allows us to have the service marked as healthy as soon as it is, but not to spam the index page too often (which results in an API call to CapX). --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3862e9d..27f89e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,4 +45,4 @@ CMD [ "run", "-h", "0.0.0.0"] # TODO: in docker 25 and later, we should use --start-interval and # --start-period to perform more frequent checks on startup to speed # up tests -HEALTHCHECK --interval=10s CMD curl --fail http://localhost:5000 || exit 1 +HEALTHCHECK --interval=600s --timeout=30s --start-period=60s --start-interval=5s --retries=3 CMD curl --fail http://localhost:5000 || exit 1