Files
roboco/.github/workflows/ci.yml
T
bed8342e7b [a2a9f601] Panel test gate, baseline vitest tests, and CI enforcement (#237) (#239)
* [05d580eb] test(panel): add baseline vitest tests for 5 source units and widen coverage include (#235)

- panel/src/lib/__tests__/agent-definitions.test.ts: all 7 filter functions covered
  (getBoardAgents, getMainPm, getBackend/Frontend/Ux/Marketing/OnDemandAgents)
  including null/undefined input and CEO/MAIN_PM exclusion logic

- panel/src/lib/__tests__/client.test.ts: getErrorMessage fully covered
  (ECONNABORTED, ERR_NETWORK, string/array/object detail formats,
   HTTP 401/403/404/422/500+, plain Error fallback, unknown input fallback)

- panel/src/store/__tests__/notifications-store.test.ts: useNotificationStore
  (addNotification counter+dedup, markAsRead, markAsAcknowledged, setCounts, clearAll)

- panel/src/store/__tests__/rate-limit-store.test.ts: useRateLimitStore
  (hitRateLimit entry+resumeAt, liftRateLimit deletion, syncFromApi replacement)

- panel/src/lib/__tests__/websocket.test.ts: getWebSocketUrl
  (absolute ws://, absolute wss://, http→ws: relative, https→wss: relative, SSR fallback)

- panel/vitest.config.ts: coverage include widened to src/lib/**, src/store/**,
  src/components/** and global thresholds removed (baseline tests cover only 5 units
  of hundreds; thresholds will be re-added per-file as coverage grows)

pnpm test: 7 test files, 111 tests, 0 failures
pnpm lint: clean
pnpm typecheck: clean



* [1bc8195e] feat(ci): add panel-gate and panel-quality Makefile targets and CI test step (#236)

Add two new .PHONY Makefile targets (panel-gate, panel-quality) that run
pnpm lint, pnpm exec tsc --noEmit, and pnpm test inside the panel directory.
panel-quality depends on panel-gate so a single target drives the full gate.

Add a 'Test (vitest + coverage)' step to the panel job in ci.yml, placed
after the existing Type-check step. The job's default working-directory is
already panel so no override is needed; vitest.config.ts text reporter
prints coverage to stdout automatically.



---------

Co-authored-by: Frontend Developer 1 <fe-dev-1@agents.roboco.dev>
Co-authored-by: Frontend Developer 2 <fe-dev-2@agents.roboco.dev>
2026-06-20 20:25:38 +02:00

145 lines
3.5 KiB
YAML

name: CI
on:
push:
branches:
- master
paths:
- 'roboco/**'
- 'agents/**'
- 'alembic/**'
- 'tests/**'
- 'scripts/**'
- 'docker/**'
- 'docker-compose.yml'
- 'Makefile'
- 'pyproject.toml'
- 'uv.lock'
- 'alembic.ini'
- 'panel/**'
- '.github/workflows/ci.yml'
pull_request:
branches:
- master
paths:
- 'roboco/**'
- 'agents/**'
- 'alembic/**'
- 'tests/**'
- 'scripts/**'
- 'docker/**'
- 'docker-compose.yml'
- 'Makefile'
- 'pyproject.toml'
- 'uv.lock'
- 'alembic.ini'
- 'panel/**'
- '.github/workflows/ci.yml'
workflow_dispatch:
jobs:
quality:
name: Python quality gate
runs-on: ubuntu-latest
services:
postgres:
image: pgvector/pgvector:pg16
env:
POSTGRES_USER: roboco
POSTGRES_PASSWORD: roboco
POSTGRES_DB: roboco
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U roboco"
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
# Runtime settings (roboco.config.Settings reads ROBOCO_*).
ROBOCO_DATABASE_HOST: localhost
ROBOCO_DATABASE_PORT: '5432'
ROBOCO_DATABASE_USER: roboco
ROBOCO_DATABASE_PASSWORD: roboco
ROBOCO_DATABASE_NAME: roboco
ROBOCO_REDIS_HOST: localhost
ROBOCO_REDIS_PORT: '6379'
# Fernet key required by the security layer (utils/crypto). Test-only —
# a valid generated key (the previous value was 43 chars, not a real
# Fernet key, so encryption tests failed with "Incorrect padding").
ROBOCO_ENCRYPTION_KEY: 'yp3Awiv0zmxpRa6Gi9Y9hJbi4pZ2FXHRNr4EI6-Gx9U='
# The pytest harness (tests/conftest.py) provisions its own ephemeral
# databases via an admin connection to the `postgres` DB and reads a
# separate ROBOCO_TEST_DB_* set. The pgvector image's POSTGRES_USER is a
# superuser, so it can CREATE/DROP DATABASE and enable the vector extension.
ROBOCO_TEST_DB_HOST: localhost
ROBOCO_TEST_DB_PORT: '5432'
ROBOCO_TEST_DB_USER: roboco
ROBOCO_TEST_DB_PASSWORD: roboco
ROBOCO_TEST_DB_ADMIN_DB: postgres
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install uv
run: pip install uv
- name: Install dependencies
run: uv sync --extra dev
- name: Apply database migrations
run: uv run alembic upgrade head
- name: Run quality gate
run: make quality
panel:
name: Panel (Next.js)
runs-on: ubuntu-latest
defaults:
run:
working-directory: panel
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: '20'
- name: Enable corepack (pnpm)
run: corepack enable
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint
- name: Type-check
run: pnpm exec tsc --noEmit
- name: Test (vitest + coverage)
run: pnpm test