From 90db7ead9cfda7aabe69e256639b6df7e8e06091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 27 Sep 2024 17:32:34 +0200 Subject: [PATCH 1/8] =?UTF-8?q?=F0=9F=91=B7=20Tweak=20generate=20client=20?= =?UTF-8?q?to=20error=20out?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/generate-client.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/generate-client.yml b/.github/workflows/generate-client.yml index 827195f859..19d438f465 100644 --- a/.github/workflows/generate-client.yml +++ b/.github/workflows/generate-client.yml @@ -45,13 +45,15 @@ jobs: 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 + # TODO: uncomment this + # - 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' ) + # TODO: uncomment this + # 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" + git diff --staged --quiet || echo "Changes detected in generated client, run scripts/generate-client.sh and commit the changes" && exit 1 From 04321d131912626cb3ff00430c0b5637e6b7d5b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 27 Sep 2024 17:33:36 +0200 Subject: [PATCH 2/8] =?UTF-8?q?=F0=9F=8D=BB=20Test=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/app/models.py b/backend/app/models.py index 90ef5559e3..c44293ff6d 100644 --- a/backend/app/models.py +++ b/backend/app/models.py @@ -6,7 +6,8 @@ # Shared properties class UserBase(SQLModel): - email: EmailStr = Field(unique=True, index=True, max_length=255) + # TODO: fix this + email: EmailStr | float = Field(unique=True, index=True, max_length=255) is_active: bool = True is_superuser: bool = False full_name: str | None = Field(default=None, max_length=255) From a544795ed775be9f42b38522917594afb0140d9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 27 Sep 2024 17:37:10 +0200 Subject: [PATCH 3/8] =?UTF-8?q?=F0=9F=8D=BB=20Test=20with=20something=20el?= =?UTF-8?q?se?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app/models.py b/backend/app/models.py index c44293ff6d..21210086d9 100644 --- a/backend/app/models.py +++ b/backend/app/models.py @@ -7,8 +7,8 @@ # Shared properties class UserBase(SQLModel): # TODO: fix this - email: EmailStr | float = Field(unique=True, index=True, max_length=255) - is_active: bool = True + email: EmailStr = Field(unique=True, index=True, max_length=255) + is_active: bool | None = None is_superuser: bool = False full_name: str | None = Field(default=None, max_length=255) From d8c6f7942a7cececfc3e156a990e6b105d3f3204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 27 Sep 2024 17:40:01 +0200 Subject: [PATCH 4/8] =?UTF-8?q?=F0=9F=90=9B=20Fix=20generated=20client?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/client/models.ts | 6 +++--- frontend/src/client/schemas.ts | 33 +++++++++++++++++++++++++++------ 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/frontend/src/client/models.ts b/frontend/src/client/models.ts index 2c8074ddd6..0f131b98fc 100644 --- a/frontend/src/client/models.ts +++ b/frontend/src/client/models.ts @@ -54,7 +54,7 @@ export type UpdatePassword = { export type UserCreate = { email: string - is_active?: boolean + is_active?: boolean | null is_superuser?: boolean full_name?: string | null password: string @@ -62,7 +62,7 @@ export type UserCreate = { export type UserPublic = { email: string - is_active?: boolean + is_active?: boolean | null is_superuser?: boolean full_name?: string | null id: string @@ -76,7 +76,7 @@ export type UserRegister = { export type UserUpdate = { email?: string | null - is_active?: boolean + is_active?: boolean | null is_superuser?: boolean full_name?: string | null password?: string | null diff --git a/frontend/src/client/schemas.ts b/frontend/src/client/schemas.ts index 9e92efd106..d009ace40b 100644 --- a/frontend/src/client/schemas.ts +++ b/frontend/src/client/schemas.ts @@ -225,8 +225,15 @@ export const $UserCreate = { maxLength: 255, }, is_active: { - type: "boolean", - default: true, + type: "any-of", + contains: [ + { + type: "boolean", + }, + { + type: "null", + }, + ], }, is_superuser: { type: "boolean", @@ -262,8 +269,15 @@ export const $UserPublic = { maxLength: 255, }, is_active: { - type: "boolean", - default: true, + type: "any-of", + contains: [ + { + type: "boolean", + }, + { + type: "null", + }, + ], }, is_superuser: { type: "boolean", @@ -334,8 +348,15 @@ export const $UserUpdate = { ], }, is_active: { - type: "boolean", - default: true, + type: "any-of", + contains: [ + { + type: "boolean", + }, + { + type: "null", + }, + ], }, is_superuser: { type: "boolean", From 13d56fceca242881b9b2f71b7d11658ca7e992e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 27 Sep 2024 17:42:02 +0200 Subject: [PATCH 5/8] =?UTF-8?q?=F0=9F=91=B7=20Update=20CI=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/generate-client.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-client.yml b/.github/workflows/generate-client.yml index 19d438f465..5c8ebd748a 100644 --- a/.github/workflows/generate-client.yml +++ b/.github/workflows/generate-client.yml @@ -56,4 +56,4 @@ jobs: # TODO: uncomment this # 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 + git diff --staged --quiet || (echo "Changes detected in generated client, run scripts/generate-client.sh and commit the changes" && exit 1) From c901a726ef3a18cb47393201629c6beb278ff3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 27 Sep 2024 17:44:11 +0200 Subject: [PATCH 6/8] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Revert=20backend=20cha?= =?UTF-8?q?nge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/models.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/app/models.py b/backend/app/models.py index 21210086d9..90ef5559e3 100644 --- a/backend/app/models.py +++ b/backend/app/models.py @@ -6,9 +6,8 @@ # Shared properties class UserBase(SQLModel): - # TODO: fix this email: EmailStr = Field(unique=True, index=True, max_length=255) - is_active: bool | None = None + is_active: bool = True is_superuser: bool = False full_name: str | None = Field(default=None, max_length=255) From 4de0e14646d1c672937e829cc26cdf41acc89fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 27 Sep 2024 17:47:20 +0200 Subject: [PATCH 7/8] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Update=20client?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/client/models.ts | 6 +++--- frontend/src/client/schemas.ts | 33 ++++++--------------------------- 2 files changed, 9 insertions(+), 30 deletions(-) diff --git a/frontend/src/client/models.ts b/frontend/src/client/models.ts index 0f131b98fc..2c8074ddd6 100644 --- a/frontend/src/client/models.ts +++ b/frontend/src/client/models.ts @@ -54,7 +54,7 @@ export type UpdatePassword = { export type UserCreate = { email: string - is_active?: boolean | null + is_active?: boolean is_superuser?: boolean full_name?: string | null password: string @@ -62,7 +62,7 @@ export type UserCreate = { export type UserPublic = { email: string - is_active?: boolean | null + is_active?: boolean is_superuser?: boolean full_name?: string | null id: string @@ -76,7 +76,7 @@ export type UserRegister = { export type UserUpdate = { email?: string | null - is_active?: boolean | null + is_active?: boolean is_superuser?: boolean full_name?: string | null password?: string | null diff --git a/frontend/src/client/schemas.ts b/frontend/src/client/schemas.ts index d009ace40b..9e92efd106 100644 --- a/frontend/src/client/schemas.ts +++ b/frontend/src/client/schemas.ts @@ -225,15 +225,8 @@ export const $UserCreate = { maxLength: 255, }, is_active: { - type: "any-of", - contains: [ - { - type: "boolean", - }, - { - type: "null", - }, - ], + type: "boolean", + default: true, }, is_superuser: { type: "boolean", @@ -269,15 +262,8 @@ export const $UserPublic = { maxLength: 255, }, is_active: { - type: "any-of", - contains: [ - { - type: "boolean", - }, - { - type: "null", - }, - ], + type: "boolean", + default: true, }, is_superuser: { type: "boolean", @@ -348,15 +334,8 @@ export const $UserUpdate = { ], }, is_active: { - type: "any-of", - contains: [ - { - type: "boolean", - }, - { - type: "null", - }, - ], + type: "boolean", + default: true, }, is_superuser: { type: "boolean", From bcf8a8b78bf59120e3d02a9886b162d39270fcfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 27 Sep 2024 17:51:43 +0200 Subject: [PATCH 8/8] =?UTF-8?q?=F0=9F=91=B7=20Restore=20branches?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/generate-client.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/generate-client.yml b/.github/workflows/generate-client.yml index 5c8ebd748a..0b10eb24c9 100644 --- a/.github/workflows/generate-client.yml +++ b/.github/workflows/generate-client.yml @@ -45,15 +45,13 @@ jobs: git config --local user.name "github-actions" git add frontend/src/client # Same repo PRs - # TODO: uncomment this - # - 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 + - 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 - # TODO: uncomment this - # if: ( github.event_name == 'pull_request' && github.secret_source != 'Actions' ) + 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)