Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0fcdd6d
refactor: dev scripts
asvishnyakov Oct 6, 2025
09eed27
Merge branch 'main' into feat/refactor-scripts
asvishnyakov Nov 7, 2025
ddf6577
ci: fix check-backend workflow
asvishnyakov Nov 7, 2025
59c579c
ci: add missed dev deps to check-backend
asvishnyakov Nov 7, 2025
3e8fc9d
ci: fix uv-python-install action installation
asvishnyakov Nov 7, 2025
f710211
ci: fix dev dependencies
asvishnyakov Nov 7, 2025
895b23e
ci: fix tests & uv args
asvishnyakov Nov 7, 2025
4645e49
Merge remote-tracking branch 'origin/main' into feat/refactor-scripts
asvishnyakov Nov 10, 2025
efd3a07
fix: some missed linting issues
asvishnyakov Nov 10, 2025
c9aecf0
fix: type checking, backend & test workflows
asvishnyakov Nov 10, 2025
b4c2f10
fix: most of import errors on type checking
asvishnyakov Nov 10, 2025
9e44bba
ci: fix some issues
asvishnyakov Nov 24, 2025
0e372ea
Merge remote-tracking branch 'origin/main' into feat/refactor-scripts
asvishnyakov Nov 24, 2025
19b95ad
Merge remote-tracking branch 'origin/main' into feat/refactor-scripts
asvishnyakov Nov 24, 2025
b8f4461
style: fix linting issues
asvishnyakov Nov 24, 2025
d5e1b06
ci: fix copilot setup steps
asvishnyakov Nov 24, 2025
23326b8
ci: change workflow names to more meaningful
asvishnyakov Nov 24, 2025
01dd9f6
ci: cancel previous workflow run on new commit (except main branch)
asvishnyakov Nov 24, 2025
387a9c2
ci: add concurrency control to the rest of workflows
asvishnyakov Nov 24, 2025
73e667c
ci: fix concurrency deadlock
asvishnyakov Nov 24, 2025
2fc7334
ci: fix copilot setup steps uv command
asvishnyakov Nov 24, 2025
ddac023
ci: fix copilot setup steps uv command
asvishnyakov Nov 24, 2025
8b862bc
ci: try create separate checks for check workflows
asvishnyakov Nov 24, 2025
0e132eb
ci: refactor checks
asvishnyakov Nov 24, 2025
7c7ba7d
ci: fix node version
asvishnyakov Nov 24, 2025
23cfb3b
ci: fix permissions
asvishnyakov Nov 24, 2025
fb3cc29
ci: fix permissions #2
asvishnyakov Nov 24, 2025
3f582d0
ci: fix permissions
asvishnyakov Nov 24, 2025
f88c2df
ci: fix permissions
asvishnyakov Nov 24, 2025
ef9ab7d
ci: fix permissions
asvishnyakov Nov 24, 2025
522ba18
ci: fix checks API endpoint name
asvishnyakov Nov 24, 2025
99be9d3
ci: fix check update
asvishnyakov Nov 24, 2025
b861f51
ci: fix check completion
asvishnyakov Nov 24, 2025
3fab4ce
ci: frontend custom checks
asvishnyakov Nov 24, 2025
fdc5f71
ci: fix tests workflow name
asvishnyakov Nov 24, 2025
2c443a6
ci: fix workflow names
asvishnyakov Nov 24, 2025
1f4a0a7
ci: change check name
asvishnyakov Nov 24, 2025
712586b
ci: fix check name
asvishnyakov Nov 24, 2025
652b0f9
ci: fix check names
asvishnyakov Nov 24, 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
43 changes: 43 additions & 0 deletions .github/actions/check-run/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Run command with GitHub check
description: Create a GitHub check, run a command, and complete the check based on the command outcome

inputs:
check_name:
description: Check name
required: true
command:
description: Command to run
required: true

runs:
using: composite
steps:
- uses: actions/github-script@v8
id: create-check
with:
script: |
const check = await github.rest.checks.create({
owner: context.repo.owner,
repo: context.repo.repo,
name: '${{ inputs.check_name }}',
head_sha: context.sha,
status: 'in_progress'
});
return check.data.id;
- name: Run command
id: run-command
shell: bash
run: ${{ inputs.command }}
- uses: actions/github-script@v8
if: always()
with:
script: |
const conclusion = '${{ steps.run-command.outcome }}' === 'success' ? 'success' : 'failure';
await github.rest.checks.update({
owner: context.repo.owner,
repo: context.repo.repo,
check_run_id: ${{ steps.create-check.outputs.result }},
status: 'completed',
conclusion: conclusion
});

4 changes: 2 additions & 2 deletions .github/actions/pnpm-node-install/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
node-version:
description: Node.js version
required: true
default: '24.3.0' # Switch to 'lts' as soon as Node 24 reaches LTS status.
default: 'lts/*'

runs:
using: composite
Expand All @@ -15,7 +15,7 @@ runs:
with:
run_install: false
- name: Use Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: ${{ inputs.node-version }}
registry-url: 'https://registry.npmjs.org'
Expand Down
8 changes: 4 additions & 4 deletions .github/actions/uv-python-install/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ inputs:
description: uv version
required: true
default: 'latest'
uv-args:
description: Extra uv args, for example dependencies to install, e.g. --extra tests --extra dev.
required: false
working-directory:
description: Working directory for uv command.
required: false
default: .
extra-dependencies:
description: Extra dependencies to install, e.g. --extra tests --extra dev.
required: false

runs:
using: composite
Expand All @@ -32,6 +32,6 @@ runs:
with:
python-version: ${{ inputs.python-version }}
- name: Install Python dependencies
run: uv sync --no-install-project --no-editable ${{ inputs.extra-dependencies }}
run: uv sync --all-packages ${{ inputs.uv-args }}
shell: bash
working-directory: ${{ inputs.working-directory }}
12 changes: 3 additions & 9 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,7 @@ Always reference these instructions first and fallback to search or bash command
# NOTE: Cypress download may fail due to network restrictions - this is expected in CI environments
```

2. **Build the Frontend - takes ~1 minute, NEVER CANCEL**:
```bash
pnpm run buildUi
# Timeout: Use 300+ seconds (5+ minutes)
```

3. **Run Tests**:
2. **Run Tests**:
```bash
# Backend tests - takes ~17 seconds, NEVER CANCEL
cd backend
Expand All @@ -52,10 +46,10 @@ Always reference these instructions first and fallback to search or bash command
# Timeout: Use 60 seconds

# E2E tests require Cypress download - may not work in restricted environments
# If available: pnpm test (takes variable time depending on tests)
# If available: pnpm test:e2e (takes variable time depending on tests)
```

4. **Run Development Servers**:
3. **Run Development Servers**:
```bash
# Start backend (in one terminal)
cd backend
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/check-backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Check backend

on: [workflow_call]

concurrency:
group: check-backend-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

permissions:
contents: read
checks: write

jobs:
check-backend:
runs-on: ubuntu-latest
name: run checks
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/uv-python-install
name: Install Python, uv and Python dependencies
with:
uv-args: --no-install-workspace --all-extras --dev

- uses: ./.github/actions/check-run
with:
check_name: 'Linting: backend'
command: uv run --no-project scripts/lint.py

- uses: ./.github/actions/check-run
with:
check_name: 'Formatting: backend'
command: uv run --no-project scripts/format.py --check

- uses: ./.github/actions/check-run
with:
check_name: 'Type checking: backend'
command: uv run --no-project scripts/type_check.py
35 changes: 35 additions & 0 deletions .github/workflows/check-frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Check frontend & libs

on: [workflow_call]

concurrency:
group: check-frontend-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

permissions:
contents: read
checks: write

jobs:
check-frontend:
runs-on: ubuntu-latest
name: run checks
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/pnpm-node-install
name: Install Node, pnpm and dependencies.

- uses: ./.github/actions/check-run
with:
check_name: 'Linting: frontend'
command: pnpm lint

- uses: ./.github/actions/check-run
with:
check_name: 'Formatting: frontend'
command: pnpm format

- uses: ./.github/actions/check-run
with:
check_name: 'Type checking: frontend'
command: pnpm type-check
26 changes: 18 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,36 @@ on:
- '*.md'
- LICENSE

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

permissions: read-all

jobs:
pytest:
uses: ./.github/workflows/pytest.yaml
check-backend:
uses: ./.github/workflows/check-backend.yaml
permissions:
contents: read
checks: write
secrets: inherit
check-frontend:
uses: ./.github/workflows/check-frontend.yaml
permissions:
contents: read
checks: write
secrets: inherit
lint-backend:
uses: ./.github/workflows/lint-backend.yaml
tests:
uses: ./.github/workflows/tests.yaml
secrets: inherit
e2e-tests:
uses: ./.github/workflows/e2e-tests.yaml
secrets: inherit
lint-ui:
uses: ./.github/workflows/lint-ui.yaml
secrets: inherit
ci:
runs-on: ubuntu-latest
name: Run CI
if: always() # This ensures the job always runs
needs: [lint-backend, pytest, lint-ui, e2e-tests]
needs: [check-backend, check-frontend, tests, e2e-tests]
steps:
# Propagate failure
- name: Check dependent jobs
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/copilot-setup-steps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,4 @@ jobs:
with:
python-version: "3.10"
uv-version: "latest"
working-directory: "./backend"
extra-dependencies: "--extra tests --extra mypy --extra dev --extra custom-data"

- name: Build UI components
run: pnpm run buildUi
timeout-minutes: 5
uv-args: "--all-extras --dev"
18 changes: 9 additions & 9 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
name: E2ETests
name: E2E tests

on: [workflow_call]

concurrency:
group: e2e-tests-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

permissions: read-all

jobs:
ci:
e2e-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
name: ${{ matrix.os }}
env:
BACKEND_DIR: ./backend
steps:
Expand All @@ -24,14 +29,9 @@ jobs:
name: Install Python, uv and Python & pnpm (uv does it automatically) dependencies
with:
working-directory: ${{ env.BACKEND_DIR }}
extra-dependencies: --extra tests
- name: Build UI components
run: pnpm run buildUi
timeout-minutes: 5
uv-args: --extra tests
- name: Run tests
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
run: pnpm test
run: pnpm test:e2e
shell: bash
- name: Upload screenshots
uses: actions/upload-artifact@v4
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/lint-backend.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/lint-ui.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
release:
types: [published]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

permissions: read-all

jobs:
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/pytest.yaml → .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
name: Pytest
name: Unit & integration tests

on: [workflow_call]

concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

permissions: read-all

jobs:
pytest:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
name: python ${{ matrix.python-version }}
env:
BACKEND_DIR: ./backend
steps:
Expand All @@ -20,11 +25,8 @@ jobs:
name: Install Python, uv and Python dependencies
with:
python-version: ${{ matrix.python-version }}
extra-dependencies: --extra tests --extra mypy --extra custom-data
working-directory: ${{ env.BACKEND_DIR }}
- name: Build UI components
run: pnpm run buildUi
timeout-minutes: 5
- name: Run Pytest
uv-args: --extra tests --extra custom-data
- name: Run backend tests
run: uv run --no-project pytest --cov=chainlit/
working-directory: ${{ env.BACKEND_DIR }}
- name: Run frontend tests
run: pnpm run test
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ dist-ssr
.aider*
.coverage

backend/README.md
backend/.dmypy.json
.dmypy.json

.history
Loading
Loading