fix: add explicit in_progress=False to all feature creation paths

Complete the defense-in-depth approach from PR #53 by adding explicit
in_progress=False to all remaining feature creation locations. This
ensures consistency with the MCP server pattern and prevents potential
NULL values in the in_progress field.

Changes:
- server/routers/features.py: Add in_progress=False to create_feature()
  and create_features_bulk() endpoints
- server/services/expand_chat_session.py: Add in_progress=False to
  _create_features_bulk() in the expand chat session
- api/migration.py: Add in_progress field handling in JSON migration,
  reading from source data with False as default

This follows up on PR #53 which added nullable=False constraints and
fixed existing NULL values, but only updated the MCP server creation
paths. Now all 6 feature creation locations explicitly set both
passes=False and in_progress=False.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Auto
2026-01-15 15:14:24 +02:00
parent ab51bb6089
commit 91cc00a9d0
3 changed files with 4 additions and 0 deletions

View File

@@ -82,6 +82,7 @@ def migrate_json_to_sqlite(
description=feature_dict.get("description", ""),
steps=feature_dict.get("steps", []),
passes=feature_dict.get("passes", False),
in_progress=feature_dict.get("in_progress", False),
)
session.add(feature)
imported_count += 1

View File

@@ -175,6 +175,7 @@ async def create_feature(project_name: str, feature: FeatureCreate):
description=feature.description,
steps=feature.steps,
passes=False,
in_progress=False,
)
session.add(db_feature)
@@ -411,6 +412,7 @@ async def create_features_bulk(project_name: str, bulk: FeatureBulkCreate):
description=feature_data.description,
steps=feature_data.steps,
passes=False,
in_progress=False,
)
session.add(db_feature)
session.flush() # Flush to get the ID immediately

View File

@@ -403,6 +403,7 @@ class ExpandChatSession:
description=f.get("description", ""),
steps=f.get("steps", []),
passes=False,
in_progress=False,
)
session.add(db_feature)
created_rows.append(db_feature)