AP2.2d: B2b Product-Backlog und B3 Sprint-Backlog in UI.
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Successful in 2m40s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 19s
Test Suite / playwright-smoke (push) Successful in 13s
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Successful in 2m40s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 19s
Test Suite / playwright-smoke (push) Successful in 13s
Zeitbox-API im Frontend, Plan/Ausführen Sprint-Ansichten, Backlog-Convert in aktiven Sprint. agile_iteration bei aktiver Zeitbox für continuous_product. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
0b57e2ec75
commit
82a5b9adec
27 files changed
+646
-27
No files matched your search
@@ -34,6 +34,8 @@ class BacklogUpdateRequest(BaseModel):
|
||||
|
||||
class BacklogConvertRequest(BaseModel):
|
||||
assigned_actor_ids: list[str] = Field(default_factory=list)
|
||||
work_cycle_id: Optional[str] = None
|
||||
assign_active_sprint: bool = True
|
||||
|
||||
|
||||
@router.get("/{backlog_item_id}")
|
||||
@@ -103,6 +105,8 @@ def convert_backlog_to_action(
|
||||
backlog_item_id=backlog_item_id,
|
||||
user_id=ctx.user_id,
|
||||
assigned_actor_ids=assigned,
|
||||
work_cycle_id=body.work_cycle_id,
|
||||
assign_active_sprint=body.assign_active_sprint,
|
||||
)
|
||||
except ValueError as exc:
|
||||
detail = str(exc)
|
||||
|
||||
@@ -295,6 +295,8 @@ def convert_backlog_to_action(
|
||||
backlog_item_id: str,
|
||||
user_id: Optional[str] = None,
|
||||
assigned_actor_ids: Optional[list[str]] = None,
|
||||
work_cycle_id: Optional[str] = None,
|
||||
assign_active_sprint: bool = True,
|
||||
) -> dict[str, Any]:
|
||||
existing = get_backlog_item(tenant_id=tenant_id, backlog_item_id=backlog_item_id)
|
||||
if not existing:
|
||||
@@ -304,6 +306,16 @@ def convert_backlog_to_action(
|
||||
if existing["status"] not in ("accepted", "triaged", "new"):
|
||||
raise ValueError("Backlog-Item kann in diesem Status nicht konvertiert werden")
|
||||
|
||||
resolved_cycle_id = work_cycle_id
|
||||
if not resolved_cycle_id and assign_active_sprint:
|
||||
from services.work_cycle import get_active_work_cycle
|
||||
|
||||
active = get_active_work_cycle(
|
||||
tenant_id=tenant_id, initiative_id=existing["initiative_id"]
|
||||
)
|
||||
if active:
|
||||
resolved_cycle_id = active["id"]
|
||||
|
||||
action = create_action(
|
||||
tenant_id=tenant_id,
|
||||
initiative_id=existing["initiative_id"],
|
||||
@@ -311,6 +323,7 @@ def convert_backlog_to_action(
|
||||
description=existing["description"] or "",
|
||||
priority=existing["priority"],
|
||||
roadmap_item_id=existing.get("roadmap_item_id"),
|
||||
work_cycle_id=resolved_cycle_id,
|
||||
assigned_actor_ids=assigned_actor_ids or [],
|
||||
user_id=user_id,
|
||||
)
|
||||
|
||||
@@ -25,6 +25,25 @@ def _resolve_method_key(ctx: TenantContext, initiative_id: str | None) -> str:
|
||||
return "generic_operating"
|
||||
|
||||
|
||||
def _resolve_next_action_strategy_key(
|
||||
ctx: TenantContext, initiative_id: str | None
|
||||
) -> str:
|
||||
method_key = _resolve_method_key(ctx, initiative_id)
|
||||
method = get_method(method_key)
|
||||
strategy_key = method.next_action_strategy_key if method else default_strategy.key
|
||||
if not initiative_id:
|
||||
return strategy_key
|
||||
|
||||
from services.work_cycle import get_active_work_cycle
|
||||
|
||||
active = get_active_work_cycle(tenant_id=ctx.tenant_id, initiative_id=initiative_id)
|
||||
if active and strategy_key == "continuous_product":
|
||||
agile = get_next_action_strategy("agile_iteration")
|
||||
if agile:
|
||||
return agile.key
|
||||
return strategy_key
|
||||
|
||||
|
||||
def evaluate(
|
||||
ctx: TenantContext,
|
||||
kind: SignalKind = "attention",
|
||||
@@ -35,10 +54,6 @@ def evaluate(
|
||||
if kind == "attention":
|
||||
return default_rules.get_attention_items(ctx)
|
||||
|
||||
method_key = _resolve_method_key(ctx, initiative_id)
|
||||
method = get_method(method_key)
|
||||
strategy_key = (
|
||||
method.next_action_strategy_key if method else default_strategy.key
|
||||
)
|
||||
strategy_key = _resolve_next_action_strategy_key(ctx, initiative_id)
|
||||
strategy = get_next_action_strategy(strategy_key) or default_strategy
|
||||
return strategy.evaluate(ctx, initiative_id=initiative_id, limit=limit)
|
||||
@@ -0,0 +1,44 @@
|
||||
"""AP2.2d — Backlog convert assigns active sprint."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from tests.factories import provision_user_in_tenant
|
||||
from tests.test_initiatives_actions import _auth, _create_initiative, _login
|
||||
|
||||
|
||||
def test_convert_backlog_assigns_active_work_cycle(client):
|
||||
user = provision_user_in_tenant(tenant_role="admin")
|
||||
token = _login(client, user)
|
||||
|
||||
created = _create_initiative(
|
||||
client,
|
||||
token,
|
||||
title="Product Backlog",
|
||||
archetype_key="initiative.product",
|
||||
)
|
||||
initiative_id = created.json()["id"]
|
||||
|
||||
cycle = client.post(
|
||||
f"/api/initiatives/{initiative_id}/work-cycles",
|
||||
json={"title": "Sprint R1", "status": "active"},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert cycle.status_code == 201
|
||||
cycle_id = cycle.json()["id"]
|
||||
|
||||
backlog = client.post(
|
||||
f"/api/initiatives/{initiative_id}/backlog",
|
||||
json={"title": "Feature X", "status": "accepted"},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert backlog.status_code == 201
|
||||
backlog_id = backlog.json()["id"]
|
||||
|
||||
converted = client.post(
|
||||
f"/api/backlog/{backlog_id}/convert-to-action",
|
||||
json={"assign_active_sprint": True},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert converted.status_code == 201
|
||||
action = converted.json()["action"]
|
||||
assert action["work_cycle_id"] == cycle_id
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
APP_VERSION = "0.20.1-ap2.2bc"
|
||||
APP_VERSION = "0.20.2-ap2.2d"
|
||||
DB_SCHEMA_VERSION = "025"
|
||||
APP_NAME = "jinkendo-kairo"
|
||||
Reference in new issue
Block a user