From fdd54b790d216c5c71e3f46d37424df81744fdd2 Mon Sep 17 00:00:00 2001 From: Tristan Date: Wed, 28 Jan 2026 12:58:44 +0200 Subject: [PATCH 01/11] Update requirements version --- requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 721f9d4..a356807 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,10 @@ addict~=2.2 celery~=5.2 connexion~=2.11 -cryptography~=42.0 +cryptography~=44.0.1 Flask~=2.2 flask-authz~=2.5.1 -Flask-Cors~=4.0 +Flask-Cors~=6.0.0 Flask-PyMongo~=2.3 pydantic~=2.7 PyJWT~=2.4 @@ -14,4 +14,4 @@ requests~=2.31 swagger-ui-bundle~=0.0 toml~=0.10 typing~=3.7 -Werkzeug~=2.2 +Werkzeug~=3.1.5 From de7a838ff8ce9fcaed9bb73eea43cedaafba6d22 Mon Sep 17 00:00:00 2001 From: Tristan Date: Wed, 28 Jan 2026 13:56:08 +0200 Subject: [PATCH 02/11] Increase max-line-length for flake8 --- setup.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index a7b527c..4a3889c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,7 @@ version = attr: foca.__version__ [flake8] exclude = .git,.eggs,build,venv,env -max-line-length = 79 +max-line-length = 120 [semantic_release] ; documentation: https://python-semantic-release.readthedocs.io/en/latest/configuration.html @@ -17,4 +17,4 @@ upload_to_release = true version_variable = foca/__init__.py:__version__ [mypy] -ignore_missing_imports = True \ No newline at end of file +ignore_missing_imports = True From d455981fa7ae76e88def94d51e3bb8c7b60d7392 Mon Sep 17 00:00:00 2001 From: Tristan Date: Wed, 28 Jan 2026 14:01:12 +0200 Subject: [PATCH 03/11] Update docker compose cmd --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 56d3da6..b2d1328 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -72,7 +72,7 @@ jobs: --build-arg PY_IMAGE=${PY_IMAGE} \ . cd ./examples/petstore - docker-compose up --build -d + docker compose up --build -d cd ../.. sleep 10 pytest ./tests/integration_tests.py From 88d7ee3a3418d917624b5585f5dc31ac8e72ea98 Mon Sep 17 00:00:00 2001 From: Tristan Date: Wed, 28 Jan 2026 14:47:15 +0200 Subject: [PATCH 04/11] Update docker compose cmd 2 --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index b2d1328..af7e175 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -72,7 +72,7 @@ jobs: --build-arg PY_IMAGE=${PY_IMAGE} \ . cd ./examples/petstore - docker compose up --build -d + docker compose build foca-petstore-root cd ../.. sleep 10 pytest ./tests/integration_tests.py From c733b7f4173cbabf531330a4d0e386f3ede8bf06 Mon Sep 17 00:00:00 2001 From: Tristan Date: Wed, 28 Jan 2026 14:57:37 +0200 Subject: [PATCH 05/11] From buster To bookworm --- examples/petstore-access-control/docker-compose.yaml | 2 +- examples/petstore/docker-compose.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/petstore-access-control/docker-compose.yaml b/examples/petstore-access-control/docker-compose.yaml index cef463b..9a7fe0f 100644 --- a/examples/petstore-access-control/docker-compose.yaml +++ b/examples/petstore-access-control/docker-compose.yaml @@ -7,7 +7,7 @@ services: context: ../../ dockerfile: docker/Dockerfile args: - PY_IMAGE: ${PETSTORE_PY_IMAGE:-3.10-slim-buster} + PY_IMAGE: ${PETSTORE_PY_IMAGE:-3.10-slim-bookworm} image: foca-petstore-access-control-root:latest restart: "no" diff --git a/examples/petstore/docker-compose.yaml b/examples/petstore/docker-compose.yaml index cb41b87..4dba12c 100644 --- a/examples/petstore/docker-compose.yaml +++ b/examples/petstore/docker-compose.yaml @@ -7,7 +7,7 @@ services: context: ../../ dockerfile: docker/Dockerfile args: - PY_IMAGE: ${PETSTORE_PY_IMAGE:-3.10-slim-buster} + PY_IMAGE: ${PETSTORE_PY_IMAGE:-3.10-slim-bookworm} image: foca-petstore-root:latest restart: "no" From 2a46d0ed0a7090937025c78aa2c4696f35f4cce6 Mon Sep 17 00:00:00 2001 From: Tristan Date: Wed, 28 Jan 2026 15:13:21 +0200 Subject: [PATCH 06/11] Check for petstore app --- .github/workflows/checks.yml | 38 ++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index af7e175..b3e0867 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -7,9 +7,9 @@ name: CI on: push: - branches: [ dev ] + branches: [dev] pull_request: - branches: [ dev ] + branches: [dev] jobs: Test: @@ -18,12 +18,13 @@ jobs: strategy: fail-fast: true matrix: - py-version-img: [ - ["3.9", "3.9-slim-bookworm"], - ["3.10", "3.10-slim-bookworm"], - ["3.11", "3.11-slim-bookworm"], - ["3.12", "3.12-slim-bookworm"], - ] + py-version-img: + [ + ["3.9", "3.9-slim-bookworm"], + ["3.10", "3.10-slim-bookworm"], + ["3.11", "3.11-slim-bookworm"], + ["3.12", "3.12-slim-bookworm"], + ] mongodb-version: ["4.4", "5.0", "6.0", "7.0"] mongodb-port: [12345] @@ -74,7 +75,13 @@ jobs: cd ./examples/petstore docker compose build foca-petstore-root cd ../.. - sleep 10 + # Wait until the app is up and running + for i in {1..30}; do + if curl -s http://localhost:80/pets > /dev/null + break + fi + sleep 2 + done pytest ./tests/integration_tests.py Docker: @@ -83,12 +90,13 @@ jobs: strategy: fail-fast: true matrix: - py-version-img-tag: [ - ["3.9", "3.9-slim-bookworm", ""], - ["3.10", "3.10-slim-bookworm", ""], - ["3.11", "3.11-slim-bookworm", ""], - ["3.12", "3.12-slim-bookworm", "latest"], - ] + py-version-img-tag: + [ + ["3.9", "3.9-slim-bookworm", ""], + ["3.10", "3.10-slim-bookworm", ""], + ["3.11", "3.11-slim-bookworm", ""], + ["3.12", "3.12-slim-bookworm", "latest"], + ] steps: - name: Checkout Repository From 540484eeccca6f63052cba1e758212ee889813e2 Mon Sep 17 00:00:00 2001 From: Tristan Date: Wed, 28 Jan 2026 15:20:12 +0200 Subject: [PATCH 07/11] Fix loop --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index b3e0867..4ae69c2 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -77,7 +77,7 @@ jobs: cd ../.. # Wait until the app is up and running for i in {1..30}; do - if curl -s http://localhost:80/pets > /dev/null + if curl -s http://localhost:80/pets > /dev/null; then break fi sleep 2 From 698b2fd043bcc760a02c716dd3b681828dd85eb8 Mon Sep 17 00:00:00 2001 From: Tristan Date: Wed, 28 Jan 2026 15:57:33 +0200 Subject: [PATCH 08/11] Update docker compose and checks --- .github/workflows/checks.yml | 4 ++-- examples/petstore/docker-compose.yaml | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 4ae69c2..1220b1b 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -73,11 +73,11 @@ jobs: --build-arg PY_IMAGE=${PY_IMAGE} \ . cd ./examples/petstore - docker compose build foca-petstore-root + docker compose up -d cd ../.. # Wait until the app is up and running for i in {1..30}; do - if curl -s http://localhost:80/pets > /dev/null; then + if curl -s http://localhost:8080/pets > /dev/null; then break fi sleep 2 diff --git a/examples/petstore/docker-compose.yaml b/examples/petstore/docker-compose.yaml index 4dba12c..6e694ae 100644 --- a/examples/petstore/docker-compose.yaml +++ b/examples/petstore/docker-compose.yaml @@ -1,6 +1,5 @@ -version: '3.6' +version: "3.6" services: - # build app image based on current FOCA root image foca-petstore-root: build: @@ -12,18 +11,18 @@ services: restart: "no" app: - image: elixircloud/foca-petstore:latest + image: elixircloud/foca-petstore-root:latest depends_on: - foca-petstore-root build: context: . dockerfile: Dockerfile restart: unless-stopped - links: - - mongodb + # links: + # - mongodb command: bash -c "python app.py" ports: - - "80:8080" + - "8080:8080" mongodb: image: mongo:7.0 From c8c15fb948b61ed6853a8245a72959ab71069164 Mon Sep 17 00:00:00 2001 From: Tristan Date: Wed, 28 Jan 2026 16:06:11 +0200 Subject: [PATCH 09/11] Add build then up --- .github/workflows/checks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 1220b1b..bf97b1c 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -73,6 +73,7 @@ jobs: --build-arg PY_IMAGE=${PY_IMAGE} \ . cd ./examples/petstore + docker compose build docker compose up -d cd ../.. # Wait until the app is up and running From 38ee52a3c46c08aaa6baf3d7d269b0a8608c8030 Mon Sep 17 00:00:00 2001 From: Tristan Date: Wed, 28 Jan 2026 16:19:09 +0200 Subject: [PATCH 10/11] Update compose build --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index bf97b1c..d9f5bfc 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -73,7 +73,7 @@ jobs: --build-arg PY_IMAGE=${PY_IMAGE} \ . cd ./examples/petstore - docker compose build + docker compose build foca-petstore-root docker compose up -d cd ../.. # Wait until the app is up and running From 5718d4cb1f9def23b51b51a3cac5bd61f17e6c93 Mon Sep 17 00:00:00 2001 From: Tristan Date: Wed, 28 Jan 2026 16:23:40 +0200 Subject: [PATCH 11/11] Update app port --- .github/workflows/checks.yml | 8 +------- tests/integration_tests.py | 4 ++-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index d9f5bfc..2b2d922 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -76,13 +76,7 @@ jobs: docker compose build foca-petstore-root docker compose up -d cd ../.. - # Wait until the app is up and running - for i in {1..30}; do - if curl -s http://localhost:8080/pets > /dev/null; then - break - fi - sleep 2 - done + sleep 10 pytest ./tests/integration_tests.py Docker: diff --git a/tests/integration_tests.py b/tests/integration_tests.py index 6f41ea4..f481e2f 100644 --- a/tests/integration_tests.py +++ b/tests/integration_tests.py @@ -8,7 +8,7 @@ Pets, ) -PETSTORE_URL = "http://localhost:80" +PETSTORE_URL = "http://localhost:8080" NAME_PET = "karl" TAG_PET = "frog" EXTRA_PARAM_ARG = "extra" @@ -48,7 +48,7 @@ def test_add_pet_extra_parameter_200(): assert isinstance(response_data, Pet) assert response_data.name == NAME_PET assert response_data.tag == TAG_PET - assert getattr(response_data, 'extra_parameter', None) is None + assert getattr(response_data, "extra_parameter", None) is None def test_add_pet_required_arguments_missing_400():