Cut release 0.15.1

This commit is contained in:
Lilleman
2026-11-24 10:17:59 +01:00
parent 0c2f2a5fd1
commit dcd55df69a
7 changed files with 79 additions and 18 deletions
+7 -6
View File
@@ -119,12 +119,13 @@ class FakeJira:
assert isinstance(body, dict)
self.comments.setdefault(str(held["key"]), []).append(body["body"])
return {"id": "1"}
if method == "PUT" and (held := next((issue for issue in self.issues if url.startswith(f"{ISSUES}/{issue['key']}/properties/")), None)):
held.setdefault("properties", {})[url.rpartition("/")[2]] = body # type: ignore[attr-defined]
return None
if method == "PUT" and (held := next((issue for issue in self.issues if url == f"{ISSUES}/{issue['key']}"), None)):
assert isinstance(body, dict)
if "properties" in body:
[entry] = body["properties"]
held.setdefault("properties", {})[entry["key"]] = entry["value"] # type: ignore[attr-defined]
return None
if "fields" not in body and "update" not in body:
return Failure("Jira answered 400: one of 'fields' or 'update' required")
added = [change["add"] for change in body["update"]["labels"]]
held["fields"]["labels"] = sorted({*held["fields"]["labels"], *added}) # type: ignore[index]
return None
@@ -286,9 +287,9 @@ class Jira(Case):
self.jira.answers[("POST", f"{ISSUES}/{key}/comment")] = Failure("Jira answered 503")
self.assertEqual(store.set_scores(key, scores, "", "Scored."), Failure(f"cannot comment on {key} to tell its team the scores: Jira answered 503"))
del self.jira.answers[("POST", f"{ISSUES}/{key}/comment")]
self.jira.answers[("PUT", f"{ISSUES}/{key}")] = Failure("Jira answered 503")
self.jira.answers[("PUT", f"{ISSUES}/{key}/properties/plan-item")] = Failure("Jira answered 503")
self.assertEqual(store.set_scores(key, scores, "", "Scored."), Failure(f"the comment on {key} tells its team the scores, but they could not be set, so the next run scores it again: Jira answered 503"))
del self.jira.answers[("PUT", f"{ISSUES}/{key}")]
del self.jira.answers[("PUT", f"{ISSUES}/{key}/properties/plan-item")]
# No scores were set while the comment failed, so the issue is still scored once Jira answers.
self.assertIsNone(store.set_scores(key, scores, "", "Scored."))