fix: Comprehensive validation and bug fixes

Infrastructure:
- Add Redis and Celery workers to all docker-compose files
- Fix celery migration race condition in entrypoint.sh
- Add healthchecks and resource limits to dev compose
- Update .env.template with Redis/Celery variables

Backend Models & Schemas:
- Rename Sprint.completed_points to velocity (per requirements)
- Add AgentInstance.name as required field
- Rename Issue external tracker fields for consistency
- Add IssueSource and TrackerType enums
- Add Project.default_tracker_type field

Backend Fixes:
- Add Celery retry configuration with exponential backoff
- Remove unused sequence counter from EventBus
- Add mypy overrides for test dependencies
- Fix test file using wrong schema (UserUpdate -> dict)

Frontend Fixes:
- Fix memory leak in useProjectEvents (proper cleanup)
- Fix race condition with stale closure in reconnection
- Sync TokenWithUser type with regenerated API client
- Fix expires_in null handling in useAuth
- Clean up unused imports in prototype pages
- Add ESLint relaxed rules for prototype files

CI/CD:
- Add E2E testing stage with Testcontainers
- Add security scanning with Trivy and pip-audit
- Add dependency caching for faster builds

Tests:
- Update all tests to use renamed fields (velocity, name, etc.)
- Fix 14 schema test failures
- All 1500 tests pass with 91% coverage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-30 10:35:30 +01:00
parent 6ea9edf3d1
commit 742ce4c9c8
57 changed files with 1062 additions and 332 deletions

View File

@@ -12,9 +12,8 @@ Note: These tests mock actual execution since they would require
database access and Redis operations in production.
"""
import pytest
from unittest.mock import patch
import uuid
from unittest.mock import patch
class TestAggregateDailyCostsTask:
@@ -22,8 +21,8 @@ class TestAggregateDailyCostsTask:
def test_aggregate_daily_costs_task_exists(self):
"""Test that aggregate_daily_costs task is registered."""
from app.celery_app import celery_app
import app.tasks.cost # noqa: F401
from app.celery_app import celery_app
assert "app.tasks.cost.aggregate_daily_costs" in celery_app.tasks
@@ -55,8 +54,8 @@ class TestCheckBudgetThresholdsTask:
def test_check_budget_thresholds_task_exists(self):
"""Test that check_budget_thresholds task is registered."""
from app.celery_app import celery_app
import app.tasks.cost # noqa: F401
from app.celery_app import celery_app
assert "app.tasks.cost.check_budget_thresholds" in celery_app.tasks
@@ -85,8 +84,8 @@ class TestRecordLlmUsageTask:
def test_record_llm_usage_task_exists(self):
"""Test that record_llm_usage task is registered."""
from app.celery_app import celery_app
import app.tasks.cost # noqa: F401
from app.celery_app import celery_app
assert "app.tasks.cost.record_llm_usage" in celery_app.tasks
@@ -159,8 +158,8 @@ class TestGenerateCostReportTask:
def test_generate_cost_report_task_exists(self):
"""Test that generate_cost_report task is registered."""
from app.celery_app import celery_app
import app.tasks.cost # noqa: F401
from app.celery_app import celery_app
assert "app.tasks.cost.generate_cost_report" in celery_app.tasks
@@ -211,8 +210,8 @@ class TestResetDailyBudgetCountersTask:
def test_reset_daily_budget_counters_task_exists(self):
"""Test that reset_daily_budget_counters task is registered."""
from app.celery_app import celery_app
import app.tasks.cost # noqa: F401
from app.celery_app import celery_app
assert "app.tasks.cost.reset_daily_budget_counters" in celery_app.tasks
@@ -363,7 +362,8 @@ class TestCostTaskSignatures:
def test_cost_task_chain_creation(self):
"""Test that cost tasks can be chained together."""
from celery import chain
from app.tasks.cost import record_llm_usage, check_budget_thresholds
from app.tasks.cost import check_budget_thresholds, record_llm_usage
agent_id = str(uuid.uuid4())
project_id = str(uuid.uuid4())