Read each epic issue's scores, blockers and whether the loop filed it, from both backends
CI / tests (pull_request) Successful in 2m41s
CI / tests (pull_request) Successful in 2m41s
This commit is contained in:
@@ -476,7 +476,7 @@ def issue_of(raw: object) -> Issue | Failure:
|
||||
# The answer's nested fields are read as Jira documents them; one missing or of another type ends the read here, as a Failure, so no later step meets it.
|
||||
try:
|
||||
fields = raw["fields"]
|
||||
links = tuple(Link(link["inwardIssue"]["key"], link["id"]) for link in fields["issuelinks"] if "inwardIssue" in link and link["type"]["inward"] == "is blocked by")
|
||||
links = blocked_by_links(fields)
|
||||
held = raw.get("properties", {}).get(PROPERTY, {})
|
||||
summary, description, versions = fields["summary"].strip(), fields["description"], tuple(version["name"] for version in fields["fixVersions"])
|
||||
except (AttributeError, KeyError, TypeError) as failure:
|
||||
@@ -489,6 +489,11 @@ def issue_of(raw: object) -> Issue | Failure:
|
||||
return issue
|
||||
|
||||
|
||||
def blocked_by_links(fields: dict[str, typing.Any]) -> tuple[Link, ...]:
|
||||
"""The "is blocked by" links among an issue's `issuelinks` field; a KeyError, TypeError or AttributeError where it isn't in the shape Jira documents."""
|
||||
return tuple(Link(link["inwardIssue"]["key"], link["id"]) for link in fields["issuelinks"] if "inwardIssue" in link and link["type"]["inward"] == "is blocked by")
|
||||
|
||||
|
||||
def keys_of(answered: list[object]) -> set[object]:
|
||||
"""The key of each issue in the search's answer."""
|
||||
return {raw.get("key") for raw in answered if isinstance(raw, dict)}
|
||||
|
||||
Reference in New Issue
Block a user