Pulse/tests/integration/docker-compose.test.yml
rcourtman f907440f6b fix(ai): improve AI settings UX with validation and smart fallbacks
Backend:
- Add smart provider fallback when selected model's provider isn't configured
- Automatically switch to a model from a configured provider instead of failing
- Log warning when fallback occurs for visibility

Frontend (AISettings.tsx):
- Add helper functions to check if model's provider is configured
- Group model dropdown: configured providers first, unconfigured marked with ⚠️
- Add inline warning when selecting model from unconfigured provider
- Validate on save that model's provider is configured (or being added)
- Warn before clearing last configured provider (would disable AI)
- Warn before clearing provider that current model uses
- Add patrol interval validation (must be 0 or >= 10 minutes)
- Show red border + inline error for invalid patrol intervals 1-9
- Update patrol interval hint: '(0=off, 10+ to enable)'

These changes prevent confusing '500 Internal Server Error' and
'AI is not enabled or configured' errors when model/provider mismatch.
2025-12-17 18:30:19 +00:00

79 lines
2.4 KiB
YAML

services:
# Seed a deterministic bootstrap token for first-run setup E2E flows.
# This is only used by the test stack and is safe to keep deterministic.
seed-bootstrap-token:
image: alpine:3.20
container_name: pulse-test-seed-bootstrap-token
environment:
- PULSE_E2E_BOOTSTRAP_TOKEN=${PULSE_E2E_BOOTSTRAP_TOKEN:-0123456789abcdef0123456789abcdef0123456789abcdef}
volumes:
- test-data:/data
command: >
sh -c "set -e; umask 077; echo \"$PULSE_E2E_BOOTSTRAP_TOKEN\" > /data/.bootstrap_token"
networks:
- test-network
# Mock GitHub API server for controlled testing
mock-github:
image: pulse-mock-github:test
container_name: pulse-mock-github
ports:
- "${PULSE_E2E_MOCK_GITHUB_PORT:-8080}:8080"
environment:
- PORT=8080
- MOCK_BASE_URL=http://mock-github:8080
# Control test scenarios via environment variables
- MOCK_CHECKSUM_ERROR=${MOCK_CHECKSUM_ERROR:-false}
- MOCK_NETWORK_ERROR=${MOCK_NETWORK_ERROR:-false}
- MOCK_RATE_LIMIT=${MOCK_RATE_LIMIT:-false}
- MOCK_STALE_RELEASE=${MOCK_STALE_RELEASE:-false}
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 5s
timeout: 3s
retries: 3
start_period: 5s
networks:
- test-network
# Pulse server under test
pulse-test:
image: pulse:test
container_name: pulse-test-server
ports:
- "${PULSE_E2E_PORT:-7655}:7655"
environment:
- TZ=UTC
# Point to mock GitHub server
- PULSE_UPDATE_SERVER=http://mock-github:8080
# Use /data which is already owned by pulse user via entrypoint
- PULSE_DATA_DIR=/data
# Enable debug logging
- PULSE_LOG_LEVEL=debug
# Mock mode for faster testing
- PULSE_MOCK_MODE=true
- PULSE_ALLOW_DOCKER_UPDATES=true
- PULSE_UPDATE_STAGE_DELAY_MS=250
volumes:
- test-data:/data
depends_on:
seed-bootstrap-token:
condition: service_completed_successfully
mock-github:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:7655/api/health"]
interval: 5s
timeout: 3s
retries: 5
start_period: 10s
networks:
- test-network
volumes:
test-data:
driver: local
networks:
test-network:
driver: bridge