Answer product-owner round 1: 0 🔴, 3 🟡 (0 misread); comment before the scores are set, score no issue whose work has landed, and say after which issues one starts

This commit is contained in:
Lilleman
2026-11-20 15:14:14 +01:00
parent 6c406b2609
commit 4557dced58
8 changed files with 45 additions and 22 deletions
+7 -4
View File
@@ -232,11 +232,14 @@ class Jira(Case):
self.jira.answers[("GET", read)] = {"fields": {"parent": {"key": "ABC-12"}}, "properties": {"plan-item": "L 2"}}
self.assertEqual(store.set_scores(key, scores, "", "Scored."), Failure(f"{key}'s issue property plan-item is not a JSON object"))
del self.jira.answers[("GET", read)]
self.jira.answers[("PUT", f"{ISSUES}/{key}")] = Failure("Jira answered 503")
self.assertEqual(store.set_scores(key, scores, "", "Scored."), Failure(f"cannot score {key}: Jira answered 503"))
del self.jira.answers[("PUT", f"{ISSUES}/{key}")]
self.jira.answers[("POST", f"{ISSUES}/{key}/comment")] = Failure("Jira answered 503")
self.assertEqual(store.set_scores(key, scores, "", "Scored."), Failure(f"{key} is scored, but the comment that tells its team could not be posted: 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.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}")]
# 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."))
def test_says_why_the_epics_status_cannot_be_read(self) -> None:
for answer, reason in ((Failure("Jira answered 503"), "cannot read ABC-12's status: Jira answered 503"), ({"fields": {}}, "ABC-12's status is not in the shape Jira Cloud's REST API version 3 documents: its status category has no key that is text"), (["ABC-12"], "ABC-12's status is not in the shape Jira Cloud's REST API version 3 documents: its status category has no key that is text"), ({"fields": {"status": {"statusCategory": {"key": 3}}}}, "ABC-12's status is not in the shape Jira Cloud's REST API version 3 documents: its status category has no key that is text")):