From eb16606a36e29d82b00e2d77e7cd3033d33ff9b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 22 Jan 2026 19:29:28 +0100 Subject: [PATCH 1/8] =?UTF-8?q?=F0=9F=94=A8=20Update=20generate-client.sh?= =?UTF-8?q?=20and=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/README.md | 2 +- scripts/generate-client.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/README.md b/frontend/README.md index 74724e5fe5..7b50d58b3f 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -48,7 +48,7 @@ But it would be only to clean them up, leaving them won't really have any effect * From the top level project directory, run the script: ```bash -./scripts/generate-client.sh +bash ./scripts/generate-client.sh ``` * Commit the changes. diff --git a/scripts/generate-client.sh b/scripts/generate-client.sh index 62741099ce..e3dfcb791b 100644 --- a/scripts/generate-client.sh +++ b/scripts/generate-client.sh @@ -4,8 +4,8 @@ set -e set -x cd backend -python -c "import app.main; import json; print(json.dumps(app.main.app.openapi()))" > ../openapi.json +uv run python -c "import app.main; import json; print(json.dumps(app.main.app.openapi()))" > ../openapi.json cd .. mv openapi.json frontend/ -npm run -w frontend generate-client -npm run lint +bun run -w frontend generate-client +bun run lint From 6d162683781caa77d3cb1387039be084d2b9ef98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 22 Jan 2026 19:31:28 +0100 Subject: [PATCH 2/8] =?UTF-8?q?=F0=9F=91=B7=20Update=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/generate-client.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/generate-client.yml b/.github/workflows/generate-client.yml index 04e500ad64..f359faedfa 100644 --- a/.github/workflows/generate-client.yml +++ b/.github/workflows/generate-client.yml @@ -33,9 +33,8 @@ jobs: run: bun ci - run: uv sync working-directory: backend - - run: uv run bash scripts/generate-client.sh + - run: bash scripts/generate-client.sh env: - VIRTUAL_ENV: backend/.venv SECRET_KEY: just-for-generating-client POSTGRES_PASSWORD: just-for-generating-client FIRST_SUPERUSER_PASSWORD: just-for-generating-client From fdfc7459d2821c07be70f0f205ed51fa535efc44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 22 Jan 2026 19:34:14 +0100 Subject: [PATCH 3/8] =?UTF-8?q?=F0=9F=94=A8=20Tweak=20generate=20client=20?= =?UTF-8?q?script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/generate-client.yml | 3 --- scripts/generate-client.sh | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/generate-client.yml b/.github/workflows/generate-client.yml index f359faedfa..26303fb2d6 100644 --- a/.github/workflows/generate-client.yml +++ b/.github/workflows/generate-client.yml @@ -26,9 +26,6 @@ jobs: python-version: "3.10" - name: Install uv uses: astral-sh/setup-uv@v7 - with: - version: "0.4.15" - enable-cache: true - name: Install dependencies run: bun ci - run: uv sync diff --git a/scripts/generate-client.sh b/scripts/generate-client.sh index e3dfcb791b..dc7640bcb4 100644 --- a/scripts/generate-client.sh +++ b/scripts/generate-client.sh @@ -7,5 +7,5 @@ cd backend uv run python -c "import app.main; import json; print(json.dumps(app.main.app.openapi()))" > ../openapi.json cd .. mv openapi.json frontend/ -bun run -w frontend generate-client +bun run --filter frontend generate-client bun run lint From 809ab827f786cfe33aec1bcbb147bf70b399467d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 22 Jan 2026 19:35:20 +0100 Subject: [PATCH 4/8] =?UTF-8?q?=F0=9F=91=B7=20Update=20CI=20commands?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/playwright.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 2a309ce3f5..3f9e0a2112 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -59,16 +59,11 @@ jobs: limit-access-to-actor: true - name: Install uv uses: astral-sh/setup-uv@v7 - with: - version: "0.4.15" - enable-cache: true - run: uv sync working-directory: backend - run: bun ci working-directory: frontend - - run: uv run bash scripts/generate-client.sh - env: - VIRTUAL_ENV: backend/.venv + - run: bash scripts/generate-client.sh - run: docker compose build - run: docker compose down -v --remove-orphans - name: Run Playwright tests From 0e1825f21c9f6039794a7b37b71b991aae10945d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 22 Jan 2026 19:58:42 +0100 Subject: [PATCH 5/8] =?UTF-8?q?=F0=9F=94=A7=20Generate=20SDK=20with=20pre-?= =?UTF-8?q?commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9360a82b3c..1fc67db5a0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,3 +39,10 @@ repos: require_serial: true language: unsupported types: [python] + + - id: generate-frontend-sdk + name: Generate Frontend SDK + entry: bun run --filter frontend generate-client + pass_filenames: false + language: unsupported + files: ^backend/.*$ diff --git a/package.json b/package.json index db1783f9c0..ab558ed403 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "workspaces": [ "frontend" ], - "scripts": { + "scripts": { "dev": "bun run --filter frontend dev", "lint": "bun run --filter frontend lint", "test": "bun run --filter frontend test", From 789e2f9ca5ac829862975302688119b8755d1710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 22 Jan 2026 20:01:16 +0100 Subject: [PATCH 6/8] =?UTF-8?q?=F0=9F=94=A7=20Tweak=20pre-commit=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1fc67db5a0..8014512752 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,7 +42,7 @@ repos: - id: generate-frontend-sdk name: Generate Frontend SDK - entry: bun run --filter frontend generate-client + entry: bash ./scripts/generate-client.sh pass_filenames: false language: unsupported files: ^backend/.*$ From 6c82a254bbc570c1f69b2e5608ed03394c7205e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 22 Jan 2026 20:03:11 +0100 Subject: [PATCH 7/8] =?UTF-8?q?=F0=9F=91=B7=20Run=20generate-client=20on?= =?UTF-8?q?=20pre-commit,=20not=20on=20its=20own=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/generate-client.yml | 53 --------------------------- .github/workflows/pre-commit.yml | 4 +- 2 files changed, 2 insertions(+), 55 deletions(-) delete mode 100644 .github/workflows/generate-client.yml diff --git a/.github/workflows/generate-client.yml b/.github/workflows/generate-client.yml deleted file mode 100644 index 26303fb2d6..0000000000 --- a/.github/workflows/generate-client.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Generate Client - -on: - pull_request: - types: - - opened - - synchronize - -jobs: - generate-client: - permissions: - contents: write - runs-on: ubuntu-latest - steps: - # For PRs from forks - - uses: actions/checkout@v6 - # For PRs from the same repo - - uses: actions/checkout@v6 - if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' ) - with: - ref: ${{ github.head_ref }} - token: ${{ secrets.FULL_STACK_FASTAPI_TEMPLATE_REPO_TOKEN }} - - uses: oven-sh/setup-bun@v2 - - uses: actions/setup-python@v6 - with: - python-version: "3.10" - - name: Install uv - uses: astral-sh/setup-uv@v7 - - name: Install dependencies - run: bun ci - - run: uv sync - working-directory: backend - - run: bash scripts/generate-client.sh - env: - SECRET_KEY: just-for-generating-client - POSTGRES_PASSWORD: just-for-generating-client - FIRST_SUPERUSER_PASSWORD: just-for-generating-client - - name: Add changes to git - run: | - git config --local user.email "github-actions@github.com" - git config --local user.name "github-actions" - git add frontend/src/client - # Same repo PRs - - name: Push changes - if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' ) - run: | - git diff --staged --quiet || git commit -m "✨ Autogenerate frontend client" - git push - # Fork PRs - - name: Check changes - if: ( github.event_name == 'pull_request' && github.secret_source != 'Actions' ) - run: | - git diff --staged --quiet || (echo "Changes detected in generated client, run scripts/generate-client.sh and commit the changes" && exit 1) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index ea3a6475a7..b609751643 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -66,13 +66,13 @@ jobs: if git diff --staged --quiet; then echo "No changes to commit" else - git commit -m "🎨 Auto format" + git commit -m "🎨 Auto format and update with pre-commit" git push fi - uses: pre-commit-ci/lite-action@v1.1.0 if: env.HAS_SECRETS == 'false' with: - msg: 🎨 Auto format + msg: 🎨 Auto format and update with pre-commit - name: Error out on pre-commit errors if: steps.precommit.outcome == 'failure' run: exit 1 From 35a6f8b4d12940aa3b7cbbfd1b268ffd4b147bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 22 Jan 2026 20:08:08 +0100 Subject: [PATCH 8/8] =?UTF-8?q?=F0=9F=94=A7=20Update=20pre-commit=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8014512752..fc718ea90d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,4 +45,4 @@ repos: entry: bash ./scripts/generate-client.sh pass_filenames: false language: unsupported - files: ^backend/.*$ + files: ^backend/.*$|^scripts/generate-client\.sh$