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:
@@ -34,7 +34,7 @@ class TestSprintCreateValidation:
|
||||
assert sprint.status == SprintStatus.PLANNED
|
||||
assert sprint.goal is None
|
||||
assert sprint.planned_points is None
|
||||
assert sprint.completed_points is None
|
||||
assert sprint.velocity is None
|
||||
|
||||
def test_sprint_create_with_all_fields(self, valid_uuid):
|
||||
"""Test creating sprint with all optional fields."""
|
||||
@@ -49,7 +49,7 @@ class TestSprintCreateValidation:
|
||||
end_date=today + timedelta(days=14),
|
||||
status=SprintStatus.PLANNED,
|
||||
planned_points=21,
|
||||
completed_points=0,
|
||||
velocity=0,
|
||||
)
|
||||
|
||||
assert sprint.name == "Full Sprint"
|
||||
@@ -252,8 +252,8 @@ class TestSprintPointsValidation:
|
||||
errors = exc_info.value.errors()
|
||||
assert any("planned_points" in str(e).lower() for e in errors)
|
||||
|
||||
def test_valid_completed_points(self, valid_uuid):
|
||||
"""Test valid completed_points values."""
|
||||
def test_valid_velocity(self, valid_uuid):
|
||||
"""Test valid velocity values."""
|
||||
today = date.today()
|
||||
|
||||
for points in [0, 5, 21]:
|
||||
@@ -263,26 +263,26 @@ class TestSprintPointsValidation:
|
||||
number=1,
|
||||
start_date=today,
|
||||
end_date=today + timedelta(days=14),
|
||||
completed_points=points,
|
||||
velocity=points,
|
||||
)
|
||||
assert sprint.completed_points == points
|
||||
assert sprint.velocity == points
|
||||
|
||||
def test_completed_points_negative_fails(self, valid_uuid):
|
||||
"""Test that negative completed_points raises ValidationError."""
|
||||
def test_velocity_negative_fails(self, valid_uuid):
|
||||
"""Test that negative velocity raises ValidationError."""
|
||||
today = date.today()
|
||||
|
||||
with pytest.raises(ValidationError) as exc_info:
|
||||
SprintCreate(
|
||||
project_id=valid_uuid,
|
||||
name="Negative Completed Sprint",
|
||||
name="Negative Velocity Sprint",
|
||||
number=1,
|
||||
start_date=today,
|
||||
end_date=today + timedelta(days=14),
|
||||
completed_points=-1,
|
||||
velocity=-1,
|
||||
)
|
||||
|
||||
errors = exc_info.value.errors()
|
||||
assert any("completed_points" in str(e).lower() for e in errors)
|
||||
assert any("velocity" in str(e).lower() for e in errors)
|
||||
|
||||
|
||||
class TestSprintUpdateValidation:
|
||||
@@ -310,7 +310,7 @@ class TestSprintUpdateValidation:
|
||||
end_date=today + timedelta(days=21),
|
||||
status=SprintStatus.ACTIVE,
|
||||
planned_points=34,
|
||||
completed_points=20,
|
||||
velocity=20,
|
||||
)
|
||||
|
||||
assert update.name == "Updated Name"
|
||||
|
||||
Reference in New Issue
Block a user