Report receiver: say whether a report came from MiniServer or CoreDesktop
shellcheck / shellcheck (push) Failing after 22s
shellcheck / shellcheck (push) Failing after 22s
Every issue said it came from CoreDesktop. MiniServer's reports send a version starting with "MiniServer ", so sender() reads the product from that, and the issue's version row and footer now name it, with the prefix taken off the version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -199,7 +199,18 @@ def issue_title(details):
|
|||||||
return title[:200]
|
return title[:200]
|
||||||
|
|
||||||
|
|
||||||
|
def sender(details):
|
||||||
|
"""Which product sent the report, and its version without the product's
|
||||||
|
name: MiniServer's versions start with "MiniServer ", CoreDesktop's
|
||||||
|
don't."""
|
||||||
|
version = details["version"]
|
||||||
|
if version.startswith("MiniServer "):
|
||||||
|
return "MiniServer", version[len("MiniServer "):]
|
||||||
|
return "CoreDesktop", version
|
||||||
|
|
||||||
|
|
||||||
def issue_body(report_id, details, log, received):
|
def issue_body(report_id, details, log, received):
|
||||||
|
product, version = sender(details)
|
||||||
lines = log.rstrip("\n").split("\n")
|
lines = log.rstrip("\n").split("\n")
|
||||||
excerpt = "\n".join(lines[-EXCERPT_LINES:])
|
excerpt = "\n".join(lines[-EXCERPT_LINES:])
|
||||||
marks = fence(excerpt)
|
marks = fence(excerpt)
|
||||||
@@ -210,7 +221,7 @@ def issue_body(report_id, details, log, received):
|
|||||||
"| | |",
|
"| | |",
|
||||||
"|---|---|",
|
"|---|---|",
|
||||||
f"| Kind | {cell(details['kind'])} |",
|
f"| Kind | {cell(details['kind'])} |",
|
||||||
f"| CoreDesktop | {cell(details['version'])} |",
|
f"| {product} | {cell(version)} |",
|
||||||
f"| Failed | {cell(details['failed'])} |",
|
f"| Failed | {cell(details['failed'])} |",
|
||||||
f"| Kernel | {cell(details['kernel'])} |",
|
f"| Kernel | {cell(details['kernel'])} |",
|
||||||
f"| Siblings | {cell(details['siblings'])} |",
|
f"| Siblings | {cell(details['siblings'])} |",
|
||||||
@@ -221,7 +232,7 @@ def issue_body(report_id, details, log, received):
|
|||||||
excerpt,
|
excerpt,
|
||||||
marks,
|
marks,
|
||||||
"",
|
"",
|
||||||
"Sent with `report` from a CoreDesktop machine. Its user name, host name, home folder, "
|
f"Sent with `report` from a {product} machine. Its user name, host name, home folder, "
|
||||||
"email, IP and MAC addresses, Tailscale names, Core domains, the user's name, and "
|
"email, IP and MAC addresses, Tailscale names, Core domains, the user's name, and "
|
||||||
"passwords, tokens and keys it recognized were replaced before sending.",
|
"passwords, tokens and keys it recognized were replaced before sending.",
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -213,6 +213,22 @@ class PartsTest(unittest.TestCase):
|
|||||||
self.assertIn("`````\n````\nlog\n`````", body)
|
self.assertIn("`````\n````\nlog\n`````", body)
|
||||||
self.assertEqual(receiver.issue_title(details), "Update failed in a b (v _ 1)")
|
self.assertEqual(receiver.issue_title(details), "Update failed in a b (v _ 1)")
|
||||||
|
|
||||||
|
def test_the_body_names_the_product_that_sent_the_report(self):
|
||||||
|
details = {"kind": "update", "version": "MiniServer 2026.11.19 (1c5b28b)", "failed": "x",
|
||||||
|
"kernel": "", "siblings": ""}
|
||||||
|
self.assertEqual(receiver.sender(details), ("MiniServer", "2026.11.19 (1c5b28b)"))
|
||||||
|
body = receiver.issue_body("CD-TEST23", details, "log\n", "now")
|
||||||
|
self.assertIn("| MiniServer | `2026.11.19 (1c5b28b)` |", body)
|
||||||
|
self.assertIn("from a MiniServer machine.", body)
|
||||||
|
self.assertNotIn("CoreDesktop", body)
|
||||||
|
|
||||||
|
details["version"] = "2026.11.19 (d456e31)"
|
||||||
|
self.assertEqual(receiver.sender(details), ("CoreDesktop", "2026.11.19 (d456e31)"))
|
||||||
|
body = receiver.issue_body("CD-TEST23", details, "log\n", "now")
|
||||||
|
self.assertIn("| CoreDesktop | `2026.11.19 (d456e31)` |", body)
|
||||||
|
self.assertIn("from a CoreDesktop machine.", body)
|
||||||
|
self.assertNotIn("MiniServer", body)
|
||||||
|
|
||||||
def test_ids_are_easy_to_read_out(self):
|
def test_ids_are_easy_to_read_out(self):
|
||||||
for _ in range(100):
|
for _ in range(100):
|
||||||
report_id = receiver.new_id()
|
report_id = receiver.new_id()
|
||||||
|
|||||||
Reference in New Issue
Block a user