@@ -62,6 +62,9 @@ class DemoIssue:
6262 issue_type : str = "Story"
6363 links : tuple [str , ...] = ()
6464 blocked_by : tuple [str , ...] = ()
65+ blocks : tuple [str , ...] = ()
66+ parent : str | None = None
67+ subtasks : tuple [str , ...] = ()
6568
6669
6770SERVICES : typing .Final = (
@@ -199,6 +202,7 @@ class DemoIssue:
199202 category = "done" ,
200203 issue_type = "Bug" ,
201204 links = (f"{ ENDPOINT } /shop/worker/-/merge_requests/31" ,),
205+ blocks = ("SHOP-40" ,),
202206 ),
203207 DemoIssue (
204208 key = "SHOP-36" ,
@@ -207,6 +211,7 @@ class DemoIssue:
207211 category = "indeterminate" ,
208212 links = (f"{ ENDPOINT } /shop/api/-/merge_requests/40" ,),
209213 blocked_by = ("SHOP-45" ,),
214+ subtasks = ("SHOP-46" ,),
210215 ),
211216 DemoIssue (
212217 key = "SHOP-38" ,
@@ -242,6 +247,7 @@ class DemoIssue:
242247 links = (f"{ ENDPOINT } /shop/admin/-/merge_requests/15" ,),
243248 ),
244249 DemoIssue (key = "SHOP-45" , summary = "Pick the dark palette with design" , status = "To Do" , category = "new" ),
250+ DemoIssue (key = "SHOP-46" , summary = "Dark mode in emails" , status = "To Do" , category = "new" , parent = "SHOP-36" ),
245251)
246252
247253
@@ -392,6 +398,9 @@ def _mock_service(router: respx.Router, service: DemoService, now: dt.datetime)
392398 router .get (f"{ api } /pipelines" , params = {"source" : "push" }).respond (json = push )
393399
394400
401+ _BLOCKS : typing .Final = {"name" : "Blocks" , "inward" : "is blocked by" , "outward" : "blocks" }
402+
403+
395404def _issue (issue : DemoIssue ) -> dict [str , typing .Any ]:
396405 return {
397406 "key" : issue .key ,
@@ -400,12 +409,11 @@ def _issue(issue: DemoIssue) -> dict[str, typing.Any]:
400409 "status" : {"name" : issue .status , "statusCategory" : {"key" : issue .category }},
401410 "issuetype" : {"name" : issue .issue_type },
402411 "issuelinks" : [
403- {
404- "type" : {"name" : "Blocks" , "inward" : "is blocked by" , "outward" : "blocks" },
405- "inwardIssue" : {"key" : key },
406- }
407- for key in issue .blocked_by
412+ * ({"type" : _BLOCKS , "inwardIssue" : {"key" : key }} for key in issue .blocked_by ),
413+ * ({"type" : _BLOCKS , "outwardIssue" : {"key" : key }} for key in issue .blocks ),
408414 ],
415+ "parent" : {"key" : issue .parent } if issue .parent else None ,
416+ "subtasks" : [{"key" : key } for key in issue .subtasks ],
409417 },
410418 }
411419
0 commit comments