Skip to content

Commit 7b751cf

Browse files
authored
Merge branch 'master' into master
2 parents f15e208 + 3aad3fb commit 7b751cf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2648
-2612
lines changed

.env

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Domain
22
# This would be set to the production domain with an env var on deployment
3+
# used by Traefik to transmit traffic and aqcuire TLS certificates
34
DOMAIN=localhost
5+
# To test the local Traefik config
6+
# DOMAIN=localhost.tiangolo.com
7+
8+
# Used by the backend to generate links in emails to the frontend
9+
FRONTEND_HOST=http://localhost:5173
10+
# In staging and production, set this env var to the frontend host, e.g.
11+
# FRONTEND_HOST=https://dashboard.example.com
412

513
# Environment: local, staging, production
614
ENVIRONMENT=local

.github/dependabot.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
version: 2
22
updates:
33
# GitHub Actions
4-
- package-ecosystem: "github-actions"
5-
directory: "/"
4+
- package-ecosystem: github-actions
5+
directory: /
66
schedule:
7-
interval: "daily"
7+
interval: daily
88
commit-message:
99
prefix:
1010
# Python
11-
- package-ecosystem: "pip"
12-
directory: "/"
11+
- package-ecosystem: pip
12+
directory: /
1313
schedule:
14-
interval: "daily"
14+
interval: daily
1515
commit-message:
1616
prefix:

.github/labeler.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
docs:
2-
- changed-files:
3-
- any-glob-to-any-file:
4-
- '**/*.md'
2+
- all:
3+
- changed-files:
4+
- any-glob-to-any-file:
5+
- '**/*.md'
6+
- all-globs-to-all-files:
7+
- '!frontend/**'
8+
- '!backend/**'
9+
- '!.github/**'
10+
- '!scripts/**'
11+
- '!.gitignore'
12+
- '!.pre-commit-config.yaml'
513

614
internal:
7-
- changed-files:
8-
- any-glob-to-any-file:
9-
- .github/**/*
10-
- scripts/**/*
11-
- .gitignore
12-
- .pre-commit-config.yaml
15+
- all:
16+
- changed-files:
17+
- any-glob-to-any-file:
18+
- .github/**
19+
- scripts/**
20+
- .gitignore
21+
- .pre-commit-config.yaml
22+
- all-globs-to-all-files:
23+
- '!./**/*.md'
24+
- '!frontend/**'
25+
- '!backend/**'
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
# For PRs from forks
16+
- uses: actions/checkout@v4
17+
# For PRs from the same repo
18+
- uses: actions/checkout@v4
19+
if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' )
20+
with:
21+
ref: ${{ github.head_ref }}
22+
token: ${{ secrets.FULL_STACK_FASTAPI_TEMPLATE_REPO_TOKEN }}
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: lts/*
26+
- uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.10"
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v3
31+
with:
32+
version: "0.4.15"
33+
enable-cache: true
34+
- name: Install dependencies
35+
run: npm ci
36+
working-directory: frontend
37+
- run: uv sync
38+
working-directory: backend
39+
- run: uv run bash scripts/generate-client.sh
40+
env:
41+
VIRTUAL_ENV: backend/.venv
42+
- name: Add changes to git
43+
run: |
44+
git config --local user.email "[email protected]"
45+
git config --local user.name "github-actions"
46+
git add frontend/src/client
47+
# Same repo PRs
48+
- name: Push changes
49+
if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' )
50+
run: |
51+
git diff --staged --quiet || git commit -m "✨ Autogenerate frontend client"
52+
git push
53+
# Fork PRs
54+
- name: Check changes
55+
if: ( github.event_name == 'pull_request' && github.secret_source != 'Actions' )
56+
run: |
57+
git diff --staged --quiet || (echo "Changes detected in generated client, run scripts/generate-client.sh and commit the changes" && exit 1)

.github/workflows/issue-manager.yml

Lines changed: 9 additions & 4 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:
@@ -26,7 +27,7 @@ jobs:
2627
env:
2728
GITHUB_CONTEXT: ${{ toJson(github) }}
2829
run: echo "$GITHUB_CONTEXT"
29-
- uses: tiangolo/[email protected].0
30+
- uses: tiangolo/[email protected].1
3031
with:
3132
token: ${{ secrets.GITHUB_TOKEN }}
3233
config: >
@@ -35,8 +36,12 @@ 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."
42+
},
43+
"invalid": {
44+
"delay": 0,
45+
"message": "This was marked as invalid and will be closed now. If this is an error, please provide additional details."
4146
}
4247
}

.github/workflows/labeler.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pull Request Labeler and Checker
1+
name: Labels
22
on:
33
pull_request_target:
44
types:
@@ -17,9 +17,14 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/labeler@v5
20+
if: ${{ github.event.action != 'labeled' && github.event.action != 'unlabeled' }}
21+
- run: echo "Done adding labels"
2022
# Run this after labeler applied labels
2123
check-labels:
22-
name: Check labels
24+
needs:
25+
- labeler
26+
permissions:
27+
pull-requests: read
2328
runs-on: ubuntu-latest
2429
steps:
2530
- uses: docker://agilepathway/pull-request-label-checker:latest

.github/workflows/latest-changes.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ on:
1212
description: PR number
1313
required: true
1414
debug_enabled:
15-
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
15+
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
1616
required: false
17-
default: 'false'
17+
default: "false"
1818

1919
jobs:
2020
latest-changes:
@@ -30,12 +30,11 @@ jobs:
3030
with:
3131
# To allow latest-changes to commit to the main branch
3232
token: ${{ secrets.LATEST_CHANGES }}
33-
- uses: docker://tiangolo/latest-changes:0.3.0
34-
# - uses: tiangolo/latest-changes@main
33+
- uses: tiangolo/[email protected]
3534
with:
3635
token: ${{ secrets.GITHUB_TOKEN }}
3736
latest_changes_file: ./release-notes.md
38-
latest_changes_header: '## Latest Changes'
39-
end_regex: '^## '
37+
latest_changes_header: "## Latest Changes"
38+
end_regex: "^## "
4039
debug_logs: true
41-
label_header_prefix: '### '
40+
label_header_prefix: "### "

.github/workflows/lint-backend.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Lint Backend
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types:
9+
- opened
10+
- synchronize
11+
12+
jobs:
13+
lint-backend:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.10"
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v3
24+
with:
25+
version: "0.4.15"
26+
enable-cache: true
27+
- run: uv run bash scripts/lint.sh
28+
working-directory: backend

.github/workflows/playwright.yml

Lines changed: 69 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,36 @@ on:
1616
default: 'false'
1717

1818
jobs:
19+
changes:
20+
runs-on: ubuntu-latest
21+
# Set job outputs to values from filter step
22+
outputs:
23+
changed: ${{ steps.filter.outputs.changed }}
24+
steps:
25+
- uses: actions/checkout@v4
26+
# For pull requests it's not necessary to checkout the code but for the main branch it is
27+
- uses: dorny/paths-filter@v3
28+
id: filter
29+
with:
30+
filters: |
31+
changed:
32+
- backend/**
33+
- frontend/**
34+
- .env
35+
- docker-compose*.yml
36+
- .github/workflows/playwright.yml
1937
20-
test:
38+
test-playwright:
39+
needs:
40+
- changes
41+
if: ${{ needs.changes.outputs.changed == 'true' }}
2142
timeout-minutes: 60
2243
runs-on: ubuntu-latest
44+
strategy:
45+
matrix:
46+
shardIndex: [1, 2, 3, 4]
47+
shardTotal: [4]
48+
fail-fast: false
2349
steps:
2450
- uses: actions/checkout@v4
2551
- uses: actions/setup-node@v4
@@ -33,34 +59,61 @@ jobs:
3359
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
3460
with:
3561
limit-access-to-actor: true
36-
- name: Install dependencies
37-
run: npm ci
38-
working-directory: frontend
39-
- name: Install Playwright Browsers
40-
run: npx playwright install --with-deps
41-
working-directory: frontend
4262
- run: docker compose build
4363
- run: docker compose down -v --remove-orphans
44-
- run: docker compose up -d
4564
- name: Run Playwright tests
46-
run: npx playwright test
47-
working-directory: frontend
65+
run: docker compose run --rm playwright npx playwright test --fail-on-flaky-tests --trace=retain-on-failure --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
4866
- run: docker compose down -v --remove-orphans
49-
- uses: actions/upload-artifact@v4
50-
if: always()
67+
- name: Upload blob report to GitHub Actions Artifacts
68+
if: ${{ !cancelled() }}
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: blob-report-${{ matrix.shardIndex }}
72+
path: frontend/blob-report
73+
include-hidden-files: true
74+
retention-days: 1
75+
76+
merge-playwright-reports:
77+
needs:
78+
- test-playwright
79+
- changes
80+
# Merge reports after playwright-tests, even if some shards have failed
81+
if: ${{ !cancelled() && needs.changes.outputs.changed == 'true' }}
82+
runs-on: ubuntu-latest
83+
steps:
84+
- uses: actions/checkout@v4
85+
- uses: actions/setup-node@v4
86+
with:
87+
node-version: 20
88+
- name: Install dependencies
89+
run: npm ci
90+
working-directory: frontend
91+
- name: Download blob reports from GitHub Actions Artifacts
92+
uses: actions/download-artifact@v4
93+
with:
94+
path: frontend/all-blob-reports
95+
pattern: blob-report-*
96+
merge-multiple: true
97+
- name: Merge into HTML Report
98+
run: npx playwright merge-reports --reporter html ./all-blob-reports
99+
working-directory: frontend
100+
- name: Upload HTML report
101+
uses: actions/upload-artifact@v4
51102
with:
52-
name: playwright-report
53-
path: frontend/playwright-report/
103+
name: html-report--attempt-${{ github.run_attempt }}
104+
path: frontend/playwright-report
54105
retention-days: 30
106+
include-hidden-files: true
55107

56108
# https://github.com/marketplace/actions/alls-green#why
57-
e2e-alls-green: # This job does nothing and is only used for the branch protection
109+
alls-green-playwright: # This job does nothing and is only used for the branch protection
58110
if: always()
59111
needs:
60-
- test
112+
- test-playwright
61113
runs-on: ubuntu-latest
62114
steps:
63115
- name: Decide whether the needed jobs succeeded or failed
64116
uses: re-actors/alls-green@release/v1
65117
with:
66118
jobs: ${{ toJSON(needs) }}
119+
allowed-skips: test-playwright

.github/workflows/smokeshow.yml

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

33
on:
44
workflow_run:
5-
workflows: [Test]
5+
workflows: [Test Backend]
66
types: [completed]
77

88
jobs:
@@ -14,19 +14,17 @@ jobs:
1414
statuses: write
1515

1616
steps:
17+
- uses: actions/checkout@v4
1718
- uses: actions/setup-python@v5
1819
with:
19-
python-version: '3.9'
20-
20+
python-version: "3.10"
2121
- run: pip install smokeshow
22-
2322
- uses: actions/download-artifact@v4
2423
with:
2524
name: coverage-html
2625
path: backend/htmlcov
2726
github-token: ${{ secrets.GITHUB_TOKEN }}
2827
run-id: ${{ github.event.workflow_run.id }}
29-
3028
- run: smokeshow upload backend/htmlcov
3129
env:
3230
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}

0 commit comments

Comments
 (0)