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>
75 lines
2.2 KiB
Python
75 lines
2.2 KiB
Python
# app/models/syndarix/sprint.py
|
|
"""
|
|
Sprint model for Syndarix AI consulting platform.
|
|
|
|
A Sprint represents a time-boxed iteration for organizing and delivering work.
|
|
"""
|
|
|
|
from sqlalchemy import Column, Date, Enum, ForeignKey, Index, Integer, String, Text
|
|
from sqlalchemy.dialects.postgresql import UUID as PGUUID
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.models.base import Base, TimestampMixin, UUIDMixin
|
|
|
|
from .enums import SprintStatus
|
|
|
|
|
|
class Sprint(Base, UUIDMixin, TimestampMixin):
|
|
"""
|
|
Sprint model representing a time-boxed iteration.
|
|
|
|
Tracks:
|
|
- Sprint metadata (name, number, goal)
|
|
- Date range (start/end)
|
|
- Progress metrics (planned vs completed points)
|
|
"""
|
|
|
|
__tablename__ = "sprints"
|
|
|
|
# Foreign key to project
|
|
project_id = Column(
|
|
PGUUID(as_uuid=True),
|
|
ForeignKey("projects.id", ondelete="CASCADE"),
|
|
nullable=False,
|
|
index=True,
|
|
)
|
|
|
|
# Sprint identification
|
|
name = Column(String(255), nullable=False)
|
|
number = Column(Integer, nullable=False) # Sprint number within project
|
|
|
|
# Sprint goal (what we aim to achieve)
|
|
goal = Column(Text, nullable=True)
|
|
|
|
# Date range
|
|
start_date = Column(Date, nullable=False, index=True)
|
|
end_date = Column(Date, nullable=False, index=True)
|
|
|
|
# Status
|
|
status: Column[SprintStatus] = Column(
|
|
Enum(SprintStatus),
|
|
default=SprintStatus.PLANNED,
|
|
nullable=False,
|
|
index=True,
|
|
)
|
|
|
|
# Progress metrics
|
|
planned_points = Column(Integer, nullable=True) # Sum of story points at start
|
|
velocity = Column(Integer, nullable=True) # Sum of completed story points
|
|
|
|
# Relationships
|
|
project = relationship("Project", back_populates="sprints")
|
|
issues = relationship("Issue", back_populates="sprint")
|
|
|
|
__table_args__ = (
|
|
Index("ix_sprints_project_status", "project_id", "status"),
|
|
Index("ix_sprints_project_number", "project_id", "number"),
|
|
Index("ix_sprints_date_range", "start_date", "end_date"),
|
|
)
|
|
|
|
def __repr__(self) -> str:
|
|
return (
|
|
f"<Sprint {self.name} (#{self.number}) "
|
|
f"project={self.project_id} status={self.status.value}>"
|
|
)
|