Skip to content

Commit 0deb97f

Browse files
committed
merge upstream
2 parents a4b8816 + 46ac6a3 commit 0deb97f

File tree

12 files changed

+126
-32
lines changed

12 files changed

+126
-32
lines changed

.github/labeler.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ docs:
33
- changed-files:
44
- any-glob-to-any-file:
55
- '**/*.md'
6+
- all-globs-to-all-files:
7+
- '!frontend/**'
8+
- '!backend/**'
9+
- '!.github/**'
10+
- '!scripts/**'
11+
- '!.gitignore'
12+
- '!.pre-commit-config.yaml'
613

714
internal:
815
- all:

.github/workflows/generate-client.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Generate Client
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
9+
jobs:
10+
generate-client:
11+
permissions:
12+
contents: write
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
ref: ${{ github.head_ref }}
18+
token: ${{ secrets.FULL_STACK_FASTAPI_TEMPLATE_REPO_TOKEN }}
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: lts/*
22+
- uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.10'
25+
- name: Install dependencies
26+
run: npm ci
27+
working-directory: frontend
28+
- run: pip install ./backend
29+
- run: bash scripts/generate-client.sh
30+
- name: Commit changes
31+
run: |
32+
git config --local user.email "[email protected]"
33+
git config --local user.name "github-actions"
34+
git add frontend/src/client
35+
git diff --staged --quiet || git commit -m "✨ Autogenerate frontend client"
36+
git push
37+
38+
# https://github.com/marketplace/actions/alls-green#why
39+
generate-client-alls-green: # This job does nothing and is only used for the branch protection
40+
if: always()
41+
needs:
42+
- generate-client
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Decide whether the needed jobs succeeded or failed
46+
uses: re-actors/alls-green@release/v1
47+
with:
48+
jobs: ${{ toJSON(needs) }}
49+

.github/workflows/issue-manager.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Issue Manager
22

33
on:
44
schedule:
5-
- cron: "13 4 * * *"
5+
- cron: "21 17 * * *"
66
issue_comment:
77
types:
88
- created
@@ -16,6 +16,7 @@ on:
1616

1717
permissions:
1818
issues: write
19+
pull-requests: write
1920

2021
jobs:
2122
issue-manager:
@@ -35,8 +36,8 @@ jobs:
3536
"delay": 864000,
3637
"message": "Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs."
3738
},
38-
"changes-requested": {
39+
"waiting": {
3940
"delay": 2628000,
40-
"message": "As this PR had requested changes to be applied but has been inactive for a while, it's now going to be closed. But if there's anyone interested, feel free to create a new PR."
41+
"message": "As this PR has been waiting for the original user for a while but seems to be inactive, it's now going to be closed. But if there's anyone interested, feel free to create a new PR."
4142
}
4243
}

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
with:
3535
name: coverage-html
3636
path: backend/htmlcov
37+
include-hidden-files: true
3738

3839
# https://github.com/marketplace/actions/alls-green#why
3940
alls-green: # This job does nothing and is only used for the branch protection

backend/app/api/routes/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ def test_email(email_to: EmailStr) -> Message:
2424
html_content=email_data.html_content,
2525
)
2626
return Message(message="Test email sent")
27+
28+
29+
@router.get("/health-check/")
30+
async def health_check() -> bool:
31+
return True

compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ services:
6363
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
6464
- SENTRY_DSN=${SENTRY_DSN}
6565

66+
healthcheck:
67+
test: ["CMD", "curl", "-f", "http://localhost/api/v1/utils/health-check/"]
68+
interval: 10s
69+
timeout: 5s
70+
retries: 5
71+
6672
build:
6773
context: ./backend
6874
args:

frontend/biome.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"files": {
77
"ignore": [
88
"node_modules",
9-
"src/client/",
109
"src/routeTree.gen.ts",
1110
"playwright.config.ts",
1211
"playwright-report"

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"build": "tsc && vite build",
99
"lint": "biome check --apply-unsafe --no-errors-on-unmatched --files-ignore-unknown=true ./",
1010
"preview": "vite preview",
11-
"generate-client": "openapi-ts --input ./openapi.json --output ./src/client --client axios --exportSchemas true && biome format --write ./src/client"
11+
"generate-client": "openapi-ts --input ./openapi.json --output ./src/client --client axios --exportSchemas true"
1212
},
1313
"dependencies": {
1414
"@chakra-ui/icons": "2.1.1",

frontend/src/client/core/request.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import axios from "axios"
22
import type {
33
AxiosError,
4-
AxiosInstance,
54
AxiosRequestConfig,
65
AxiosResponse,
6+
AxiosInstance,
77
} from "axios"
88

99
import { ApiError } from "./ApiError"
@@ -151,12 +151,12 @@ export const getHeaders = async (
151151
)
152152

153153
if (isStringWithValue(token)) {
154-
headers.Authorization = `Bearer ${token}`
154+
headers["Authorization"] = `Bearer ${token}`
155155
}
156156

157157
if (isStringWithValue(username) && isStringWithValue(password)) {
158158
const credentials = base64(`${username}:${password}`)
159-
headers.Authorization = `Basic ${credentials}`
159+
headers["Authorization"] = `Basic ${credentials}`
160160
}
161161

162162
if (options.body !== undefined) {

frontend/src/client/services.ts

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ import { request as __request } from "./core/request"
44

55
import type {
66
Body_login_login_access_token,
7-
ItemCreate,
8-
ItemPublic,
9-
ItemUpdate,
10-
ItemsPublic,
117
Message,
128
NewPassword,
139
Token,
10+
UserPublic,
1411
UpdatePassword,
1512
UserCreate,
16-
UserPublic,
1713
UserRegister,
14+
UsersPublic,
1815
UserUpdate,
1916
UserUpdateMe,
20-
UsersPublic,
17+
ItemCreate,
18+
ItemPublic,
19+
ItemsPublic,
20+
ItemUpdate,
2121
} from "./models"
2222

2323
export type TDataLoginAccessToken = {
@@ -50,7 +50,7 @@ export class LoginService {
5050
formData: formData,
5151
mediaType: "application/x-www-form-urlencoded",
5252
errors: {
53-
422: "Validation Error",
53+
422: `Validation Error`,
5454
},
5555
})
5656
}
@@ -85,7 +85,7 @@ export class LoginService {
8585
email,
8686
},
8787
errors: {
88-
422: "Validation Error",
88+
422: `Validation Error`,
8989
},
9090
})
9191
}
@@ -106,7 +106,7 @@ export class LoginService {
106106
body: requestBody,
107107
mediaType: "application/json",
108108
errors: {
109-
422: "Validation Error",
109+
422: `Validation Error`,
110110
},
111111
})
112112
}
@@ -128,7 +128,7 @@ export class LoginService {
128128
email,
129129
},
130130
errors: {
131-
422: "Validation Error",
131+
422: `Validation Error`,
132132
},
133133
})
134134
}
@@ -180,7 +180,7 @@ export class UsersService {
180180
limit,
181181
},
182182
errors: {
183-
422: "Validation Error",
183+
422: `Validation Error`,
184184
},
185185
})
186186
}
@@ -201,7 +201,7 @@ export class UsersService {
201201
body: requestBody,
202202
mediaType: "application/json",
203203
errors: {
204-
422: "Validation Error",
204+
422: `Validation Error`,
205205
},
206206
})
207207
}
@@ -248,7 +248,7 @@ export class UsersService {
248248
body: requestBody,
249249
mediaType: "application/json",
250250
errors: {
251-
422: "Validation Error",
251+
422: `Validation Error`,
252252
},
253253
})
254254
}
@@ -269,7 +269,7 @@ export class UsersService {
269269
body: requestBody,
270270
mediaType: "application/json",
271271
errors: {
272-
422: "Validation Error",
272+
422: `Validation Error`,
273273
},
274274
})
275275
}
@@ -290,7 +290,7 @@ export class UsersService {
290290
body: requestBody,
291291
mediaType: "application/json",
292292
errors: {
293-
422: "Validation Error",
293+
422: `Validation Error`,
294294
},
295295
})
296296
}
@@ -312,7 +312,7 @@ export class UsersService {
312312
user_id: userId,
313313
},
314314
errors: {
315-
422: "Validation Error",
315+
422: `Validation Error`,
316316
},
317317
})
318318
}
@@ -336,7 +336,7 @@ export class UsersService {
336336
body: requestBody,
337337
mediaType: "application/json",
338338
errors: {
339-
422: "Validation Error",
339+
422: `Validation Error`,
340340
},
341341
})
342342
}
@@ -356,7 +356,7 @@ export class UsersService {
356356
user_id: userId,
357357
},
358358
errors: {
359-
422: "Validation Error",
359+
422: `Validation Error`,
360360
},
361361
})
362362
}
@@ -382,10 +382,22 @@ export class UtilsService {
382382
email_to: emailTo,
383383
},
384384
errors: {
385-
422: "Validation Error",
385+
422: `Validation Error`,
386386
},
387387
})
388388
}
389+
390+
/**
391+
* Health Check
392+
* @returns boolean Successful Response
393+
* @throws ApiError
394+
*/
395+
public static healthCheck(): CancelablePromise<boolean> {
396+
return __request(OpenAPI, {
397+
method: "GET",
398+
url: "/api/v1/utils/health-check/",
399+
})
400+
}
389401
}
390402

391403
export type TDataReadItems = {
@@ -425,7 +437,7 @@ export class ItemsService {
425437
limit,
426438
},
427439
errors: {
428-
422: "Validation Error",
440+
422: `Validation Error`,
429441
},
430442
})
431443
}
@@ -446,7 +458,7 @@ export class ItemsService {
446458
body: requestBody,
447459
mediaType: "application/json",
448460
errors: {
449-
422: "Validation Error",
461+
422: `Validation Error`,
450462
},
451463
})
452464
}
@@ -466,7 +478,7 @@ export class ItemsService {
466478
id,
467479
},
468480
errors: {
469-
422: "Validation Error",
481+
422: `Validation Error`,
470482
},
471483
})
472484
}
@@ -490,7 +502,7 @@ export class ItemsService {
490502
body: requestBody,
491503
mediaType: "application/json",
492504
errors: {
493-
422: "Validation Error",
505+
422: `Validation Error`,
494506
},
495507
})
496508
}
@@ -510,7 +522,7 @@ export class ItemsService {
510522
id,
511523
},
512524
errors: {
513-
422: "Validation Error",
525+
422: `Validation Error`,
514526
},
515527
})
516528
}

0 commit comments

Comments
 (0)