Skip to content

refactor: update README files to reflect project name change from Qui… #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
bd74a2b
refactor: update README files to reflect project name change from Qui…
cubxxw May 18, 2025
03b230e
feat: enhance Google OAuth login functionality and update API documen…
cubxxw May 18, 2025
31deb86
chore: streamline GitHub Actions workflow for client generation
cubxxw May 18, 2025
586141c
chore: improve GitHub Actions workflow for client generation
cubxxw May 18, 2025
01f3c8b
chore: update GitHub Actions and refactor authentication logic
cubxxw May 18, 2025
c4e60a4
chore: update OpenAPI documentation and improve type safety
cubxxw May 19, 2025
4355212
chore: update GitHub Actions workflow for client generation
cubxxw May 19, 2025
c691874
chore: update database driver handling and improve test setup
cubxxw May 19, 2025
3bb7452
chore: enhance test database setup and improve error handling
cubxxw May 19, 2025
7c19111
chore: refactor imports to use custom client types
cubxxw May 19, 2025
0ecf48c
chore: remove deprecated Google OAuth and configuration files
cubxxw May 19, 2025
4a1a8b4
chore: update import statements for ItemPublic type consistency
cubxxw May 19, 2025
546d775
chore: compress OpenAPI JSON structure for improved readability
cubxxw May 19, 2025
5ec87f5
chore: remove lint-backend workflow and add symlink for pnpm-lock.yaml
cubxxw May 19, 2025
466642e
chore: enhance .env file generation logic in Makefile
cubxxw May 19, 2025
9aefe6f
chore: enhance boolean parsing and test mode detection in pre-start s…
cubxxw May 19, 2025
9455b35
chore: update GitHub Actions workflow to install pnpm and streamline …
cubxxw May 19, 2025
1666a96
chore: update GitHub Actions workflow to install pnpm in multiple dir…
cubxxw May 19, 2025
569e60a
chore: update GitHub Actions workflows for improved dependency manage…
cubxxw May 19, 2025
9e0302e
fix: update generate-client workflow to ensure proper commit handling
cubxxw May 19, 2025
c137d78
chore: reorder Makefile targets for improved build process
cubxxw May 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 17 additions & 37 deletions .github/workflows/generate-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,28 @@ name: Generate Client

on:
pull_request:
types:
- opened
- synchronize
push: # Also consider running on push to main/main to ensure consistency
branches:
- main # Or your default branch
types: [opened, synchronize]
push:
branches: [main]

permissions:
contents: write # Needed for pushing commits on same-repo events
contents: write

jobs:
generate-client:
runs-on: ubuntu-latest

steps:
# 1. Checkout Code - Single step handles both fork and same-repo PRs/pushes
- name: Checkout Code
uses: actions/checkout@v4
# Fetch depth 0 is needed for accurate diff/commit history if required elsewhere
# For pushing back, fetch the specific ref for same-repo PRs
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && github.head_ref || '' }}
# Use a PAT for same-repo events if you need to trigger other workflows
# Standard GITHUB_TOKEN is often sufficient for basic pushes
# token: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && secrets.YOUR_PAT_OR_GITHUB_TOKEN || '' }}

# 2. Setup Environment
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9.9.0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -46,34 +37,27 @@ jobs:
with:
python-version: "3.10"

- name: Install uv (Python Package Installer)
uses: astral-sh/setup-uv@v1 # Use v1 for stable release
- name: Install uv
uses: astral-sh/setup-uv@v1
with:
# version: "0.4.15" # Specifying version is optional, can use latest stable
enable-cache: true

# 3. Install Dependencies
- name: Install Frontend Dependencies
run: pnpm install
working-directory: frontend

- name: Install Admin Dependencies
run: pnpm install
working-directory: admin

# 安装所有后端依赖项
- name: Install Backend Dependencies
run: |
uv sync
source .venv/bin/activate
pip install .
working-directory: backend

# 4. Run Generation Script with Error Handling
- name: Generate Client
# Use `uv run` to execute within the backend context if needed,
# or just run the script directly if VIRTUAL_ENV isn't strictly necessary
# for the script itself (it might just need python)
run: |
make generate-client || {
echo "❌ Failed to run generate-client.sh script."
Expand All @@ -87,17 +71,14 @@ jobs:
SENTRY_DSN: ""
POSTHOG_API_KEY: ""
POSTHOG_HOST: ""
# VIRTUAL_ENV might not be needed if uv sync --system is used
VIRTUAL_ENV: .venv

# 5. Configure Git User
- name: Configure Git User
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git config --global user.email "github-actions@github.com"
git config --global user.name "GitHub Actions"

# 6. Stage Generated Files
- name: Stage Generated Client Files
- name: Stage Generated Files
run: |
git add frontend/app/openapi-client
git add admin/src/client
Expand All @@ -110,18 +91,17 @@ jobs:
# Check if there are staged changes
if ! git diff --staged --quiet; then
echo "✅ Changes detected in generated client. Committing and pushing..."
# Pull before pushing to avoid conflicts
# Pull before pushing to avoid conflicts using rebase
git commit -a -m "ci: ✨ Autogenerate frontend client"
git pull --rebase origin ${{ github.head_ref || github.ref_name }}
git commit -m "ci: ✨ Autogenerate frontend client"
git commit -a -m "ci: ✨ Autogenerate frontend client"
git push origin HEAD:${{ github.head_ref || github.ref_name }}
else
echo "✅ No changes detected in generated client."
fi
env:
# GITHUB_TOKEN has write permissions for same-repo events by default
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Use a PAT if you need to trigger subsequent workflows:
# GITHUB_TOKEN: ${{ secrets.YOUR_PAT_WITH_WRITE_ACCESS }}
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}

# 8. Handle Changes for Fork PRs (Warn, Don't Fail)
- name: Check for Uncommitted Changes (Fork PRs)
Expand All @@ -137,4 +117,4 @@ jobs:
# DO NOT exit 1 - Allow the workflow to continue
else
echo "✅ No changes detected in generated client."
fi
fi
28 changes: 0 additions & 28 deletions .github/workflows/lint-backend.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
uses: pnpm/action-setup@v3
with:
version: 9.9.0
- name: Symlink pnpm-lock.yaml to root
run: ln -s frontend/pnpm-lock.yaml pnpm-lock.yaml
- uses: actions/setup-node@v4
with:
node-version: lts/*
Expand Down Expand Up @@ -109,9 +111,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9.9.0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: frontend
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ jobs:

- run: docker compose --project-name $STACK_NAME down -v --remove-orphans
- run: docker compose --project-name $STACK_NAME up -d db mailcatcher
- name: Install dependencies
run: docker compose --project-name $STACK_NAME run --rm backend uv pip install -e .
- name: Migrate DB
run: docker compose --project-name $STACK_NAME run --rm backend uv run bash scripts/prestart.sh
working-directory: backend

- name: Run tests
run: docker compose --project-name $STACK_NAME run --rm backend uv run bash scripts/tests-start.sh "Coverage for ${{ github.sha }}"
working-directory: backend
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ jobs:
run: |
docker compose down -v --remove-orphans
docker compose build
docker compose up -d --wait backend frontend pgadmin
docker compose up -d --wait backend frontend admin pgadmin

- name: Test backend is up
run: curl http://localhost:8000/api/v1/utils/health-check

- name: Test frontend is up
run: curl http://localhost:5173

- name: Test admin is up
run: curl http://localhost:3000

- name: Clean up
run: docker compose down -v --remove-orphans
43 changes: 43 additions & 0 deletions .github/workflows/use-make-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Use Make All Test

on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize

jobs:
lint-backend:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8

# 分别安装各个目录的依赖
- name: Install frontend dependencies
run: pnpm install --dir frontend
if: hashFiles('frontend/package.json') != ''

- name: Install admin dependencies
run: pnpm install --dir admin
if: hashFiles('admin/package.json') != ''

- name: Install extension dependencies
run: pnpm install --dir extension
if: hashFiles('extension/package.json') != ''

- name: Make all
run: make all
Loading
Loading