Answer principles round 2: 0 🔴, 2 🟡 (0 misread); workflow-bench hands its effects in as arguments, and no Python file of the repo patches a global
CI / tests (pull_request) Successful in 3m46s
CI / tests (pull_request) Successful in 3m46s
This commit is contained in:
+12
-2
@@ -13,11 +13,12 @@ PAGE = 100
|
||||
MAX_PAGES = 100
|
||||
# The key of the status category Jira Cloud gives every done status.
|
||||
DONE = "done"
|
||||
# How a Failure names an answer in which a field is missing or of another type.
|
||||
SHAPE = "is not in the shape Jira Cloud's REST API version 3 documents"
|
||||
# What a failed create ends with: a request Jira never answered, or answered brokenly, may still have filed the issue.
|
||||
PERHAPS_FILED = "unless Jira refused the request, the issue may exist: look under {under} before filing it again"
|
||||
# What a failed move ends with, for the same reason.
|
||||
SHAPE = "is not in the shape Jira Cloud's REST API version 3 documents"
|
||||
PERHAPS_MOVED ="unless Jira refused the request, the issue may have moved: look at {key} before finishing the item again"
|
||||
PERHAPS_MOVED = "unless Jira refused the request, the issue may have moved: look at {key} before finishing the item again"
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
@@ -72,6 +73,15 @@ def offer_of(raw: object) -> tuple[str, str, str, str] | None:
|
||||
return (id_, name, status, key) if isinstance(id_, str) and isinstance(name, str) and isinstance(status, str) and isinstance(key, str) else None
|
||||
|
||||
|
||||
def status_category(issue: object) -> str | Failure:
|
||||
"""The key of the category of the status in Jira's answer about one issue, or how the answer is not in the shape Jira documents."""
|
||||
fields = issue.get("fields") if isinstance(issue, dict) else None
|
||||
status = fields.get("status") if isinstance(fields, dict) else None
|
||||
category = status.get("statusCategory") if isinstance(status, dict) else None
|
||||
key = category.get("key") if isinstance(category, dict) else None
|
||||
return key if isinstance(key, str) else Failure("its status category has no key that is text")
|
||||
|
||||
|
||||
def finishing_transition(site: str, key: str, finish: Finish, authorization: str, http: Http) -> str | Failure:
|
||||
"""The ID of the transition finish names, as Jira offers it now for the issue named key, which is a plan item or an epic; or why none of those offered finishes it."""
|
||||
offered = http("GET", f"{site}/rest/api/3/issue/{key}/transitions", authorization, None)
|
||||
|
||||
Reference in New Issue
Block a user