* feat(blackbox): add package with models, CLI, and HTMX dashboard * test(blackbox): add comprehensive test coverage for dashboard * feat(blackbox): cache session scanning via watcher invalidation * docs(blackbox): add README and use fastapi[standard] for dev server * refactor(blackbox): extract presentation logic into formatter classes * refactor(blackbox): extract classify_error helpers * feat(blackbox): wire analytics into session detail view Show token usage, tool breakdowns, and session stats in a collapsible panel when viewing a session. * feat(blackbox): add codeflash plugin detection Detect codeflash agent names, skills, and commands in transcripts. Surface language, optimization domain, and capability badges in the analytics panel. * refactor(blackbox): remove underscore prefixes from internal functions * chore: add ty python-version to root pyproject.toml * chore(blackbox): fix lint errors in test files * style(blackbox): apply ruff formatting to analytics * feat(blackbox): add Playwright E2E tests for dashboard Refactor app.py to expose create_app() factory accepting a projects_dir override, enabling tests to run against fixture data instead of the real ~/.claude/projects/ directory. Routes now read projects_dir from app.state instead of the module-level constant. Add 26 Playwright tests across 5 files covering dashboard loading, session list, session detail with filters and analytics, sidebar collapse/localStorage persistence, and SSE log streaming. All tests pass on chromium, firefox, and webkit (78 total). CI gets a new e2e-blackbox job with a browser matrix strategy running all three engines in parallel, conditional on blackbox path changes, with trace upload on failure. * fix(ci): sync only blackbox package in e2e job * fix(ci): exclude e2e tests from unit test job The test job doesn't install Playwright browsers, so e2e tests error when pytest collects them. Ignore tests/e2e/ directories in the test job — those are handled by the dedicated e2e-blackbox job.
127 lines
3.5 KiB
YAML
127 lines
3.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [main]
|
|
|
|
concurrency:
|
|
group: ci-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
prek:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: astral-sh/setup-uv@v8.0.0
|
|
with:
|
|
python-version: "3.12"
|
|
enable-cache: true
|
|
- run: uv sync --all-packages
|
|
- uses: j178/prek-action@v2
|
|
|
|
changes:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
outputs:
|
|
packages: ${{ steps.filter.outputs.changes }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: dorny/paths-filter@v3
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
codeflash-core:
|
|
- 'packages/codeflash-core/**'
|
|
codeflash-python:
|
|
- 'packages/codeflash-core/**'
|
|
- 'packages/codeflash-python/**'
|
|
codeflash-api:
|
|
- 'packages/codeflash-api/**'
|
|
blackbox:
|
|
- 'packages/blackbox/**'
|
|
github-app:
|
|
- 'packages/github-app/**'
|
|
|
|
test:
|
|
needs: changes
|
|
if: >-
|
|
github.event_name == 'push'
|
|
|| needs.changes.outputs.packages != '[]'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: astral-sh/setup-uv@v8.0.0
|
|
with:
|
|
python-version: "3.12"
|
|
enable-cache: true
|
|
- run: uv sync --all-packages
|
|
- name: Test changed packages
|
|
run: |
|
|
if [ "${{ github.event_name }}" = "push" ]; then
|
|
uv run pytest packages/ -v --ignore=packages/blackbox/tests/e2e
|
|
else
|
|
CHANGED='${{ needs.changes.outputs.packages }}'
|
|
for pkg in $(echo "$CHANGED" | jq -r '.[]'); do
|
|
echo "::group::Testing $pkg"
|
|
uv run pytest "packages/$pkg" -v --ignore="packages/$pkg/tests/e2e"
|
|
echo "::endgroup::"
|
|
done
|
|
fi
|
|
env:
|
|
CI: "true"
|
|
|
|
e2e-blackbox:
|
|
needs: changes
|
|
if: >-
|
|
github.event_name == 'push'
|
|
|| contains(fromJSON(needs.changes.outputs.packages), 'blackbox')
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
browser: [chromium, firefox, webkit]
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: astral-sh/setup-uv@v8.0.0
|
|
with:
|
|
python-version: "3.12"
|
|
enable-cache: true
|
|
- run: uv sync --package blackbox
|
|
- name: Install Playwright browsers
|
|
run: uv run playwright install --with-deps ${{ matrix.browser }}
|
|
- name: Run E2E tests (${{ matrix.browser }})
|
|
run: uv run pytest packages/blackbox/tests/e2e/ -v --browser ${{ matrix.browser }} --tracing=retain-on-failure
|
|
- name: Upload Playwright traces
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: playwright-traces-${{ matrix.browser }}
|
|
path: test-results/
|
|
retention-days: 7
|
|
|
|
version:
|
|
if: github.event_name == 'pull_request'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: astral-sh/setup-uv@v8.0.0
|
|
with:
|
|
python-version: "3.12"
|
|
enable-cache: true
|
|
- run: uv sync --all-packages
|
|
- name: Check version bump
|
|
run: uv run python scripts/versioning.py check-version
|