Skip to content

Commit d88d283

Browse files
gromdimonholtgrewe
andauthored
feat: Integrate TanStack migration (#795) (#819)
Co-authored-by: Manuel Holtgrewe <[email protected]>
1 parent 6bd14db commit d88d283

36 files changed

+28847
-13454
lines changed

.github/workflows/main.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,35 @@ jobs:
4343
- name: Lint source code
4444
run: make -C backend lint
4545

46+
# Backend-Dump-OpenAPI:
47+
# runs-on: ubuntu-latest
48+
# steps:
49+
# - name: Checkout repository
50+
# uses: actions/checkout@v4
51+
# with:
52+
# lfs: 'true'
53+
54+
# - name: Set up Python 3.10
55+
# uses: actions/setup-python@v5
56+
# with:
57+
# python-version: "3.10"
58+
# cache: "pipenv"
59+
# cache-dependency-path: |
60+
# backend/Pipfile.lock
61+
62+
# - name: Install pipenv and deps
63+
# run: |
64+
# python -m pip install --upgrade pipenv wheel
65+
# make -C backend deps
66+
67+
# - name: Dump OpenAPI schema
68+
# run: make -C backend ci-dump-openapi
69+
70+
# - name: Check for OpenAPI schema changes
71+
# run: |
72+
# diff backend/openapi.yaml backend/ci-openapi.yaml
73+
# shell: bash -euo pipefail {0}
74+
4675
Backend-Test:
4776
runs-on: ubuntu-latest
4877
needs:

backend/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,11 @@ alembic-autogenerate:
124124
.PHONY: alembic-upgrade
125125
alembic-upgrade:
126126
pipenv run alembic upgrade head
127+
128+
.PHONY: dump-openapi
129+
dump-openapi:
130+
pipenv run python -c "from app.etc.utils import dump_openapi_schema; dump_openapi_schema('openapi.yaml')"
131+
132+
.PHONY: ci-dump-openapi
133+
ci-dump-openapi:
134+
pipenv run python -c "from app.etc.utils import dump_openapi_schema; dump_openapi_schema('ci-openapi.yaml')"

backend/Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ asgiref = "*"
3232
tomli = "*"
3333
exceptiongroup = "*"
3434
async-timeout = "*"
35+
types-pyyaml = "*"
3536

3637
[dev-packages]
3738
aiosqlite = "*"

backend/Pipfile.lock

Lines changed: 200 additions & 200 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/app/etc/utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from typing import Any, Dict
44

55
import emails
6+
import yaml
67
from emails.template import JinjaTemplate
78
from starlette.requests import Request
89

@@ -67,3 +68,11 @@ def send_user_verify_email(email_to: str, token: str, request: Request | None =
6768
"base_url": base_url,
6869
},
6970
)
71+
72+
73+
def dump_openapi_schema(path_out: str):
74+
"""Dump the OpenAPI schema to a file"""
75+
from app.main import app
76+
77+
with open(path_out, "wt") as f:
78+
yaml.dump(app.openapi(), f)

0 commit comments

Comments
 (0)