Repository: fedora-infra/bodhi

Issue:
Missing whitespace in "bodhi update completed push to testing" mails
```
Date: Thu, 13 Jul 2023 02:15:14 +0000 (UTC)
From: Fedora Notifications <notifications@fedoraproject.org>
To: <me>
Subject: [bodhi] robert's openbgpd-8.1-1.fc38 bodhi update completed push to testing

robert's Bodhi update FEDORA-2023-6066e3b755completed push to testing
Builds:
openbgpd-8.1-1.fc38
https://bodhi.fedoraproject.org/updates/FEDORA-2023-6066e3b755
```

From my point of view there should be a whitespace between "FEDORA-2023-6066e3b755" and "completed".


Discussion:
Correct. I'll transfer this issue to the Bodhi repo, where the messages schemas live. Thanks!

Resolving patch:
diff --git a/bodhi-messages/bodhi/messages/schemas/update.py b/bodhi-messages/bodhi/messages/schemas/update.py
--- a/bodhi-messages/bodhi/messages/schemas/update.py
+++ b/bodhi-messages/bodhi/messages/schemas/update.py
@@ -299,7 +299,7 @@ def __str__(self) -> str:
         """
         new_line = "\n"
         return (
-            f"{self.update.user.name}'s Bodhi update {self.update.alias}"
+            f"{self.update.user.name}'s Bodhi update {self.update.alias} "
             f"completed push to {self.update.status}\n"
             f"Builds:\n"
             f"{new_line.join([b.nvr for b in self.update.builds])} ")
@@ -989,3 +989,35 @@ class UpdateReadyForTestingV2(UpdateReadyForTestingV1):
     body_schema['definitions']['build'] = BuildV1.schema()
     body_schema['properties']['update'] = UpdateV1.schema()
     body_schema['required'].append('update')
+
+    @property
+    def summary(self) -> str:
+        """
+        Return a short, human-readable representation of this message.
+
+        This should provide a short summary of the message, much like the subject line
+        of an email.
+
+        Returns:
+            A summary for this message.
+        """
+        return (
+            f"{self.body['update']['user']['name']}'s "
+            f"{truncate(' '.join([b['nvr'] for b in self.body['artifact']['builds']]))} "
+            f"bodhi update is ready for testing")
+
+    def __str__(self) -> str:
+        """
+        Return a human-readable representation of this message.
+
+        This should provide a detailed representation of the message, much like the body
+        of an email.
+
+        Returns:
+            A human readable representation of this message.
+        """
+        new_line = "\n"
+        return (
+            f"{self.body['update']['user']['name']}'s Bodhi update is ready for testing\n"
+            f"Builds:\n"
+            f"{new_line.join([b['nvr'] for b in self.body['artifact']['builds']])} ")


Test patch:
diff --git a/bodhi-messages/tests/test_update.py b/bodhi-messages/tests/test_update.py
--- a/bodhi-messages/tests/test_update.py
+++ b/bodhi-messages/tests/test_update.py
@@ -145,7 +145,7 @@ def test_complete_testing_v1(self):
                 "completed push to testing"
             ),
             "__str__": (
-                "eclipseo's Bodhi update FEDORA-2019-d64d0caab3completed push to testing"
+                "eclipseo's Bodhi update FEDORA-2019-d64d0caab3 completed push to testing"
                 "\nBuilds:\ngolang-github-SAP-go-hdb-0.14.1-1.fc29\ntexworks-0.6.3-1.fc29 "
             ),
             "app_icon": "https://apps.fedoraproject.org/img/icons/bodhi.png",
@@ -248,11 +248,11 @@ def test_ready_for_testing_v2(self):
         expected = {
             "topic": "bodhi.update.status.testing.koji-build-group.build.complete",
             "summary": (
-                "BaseOS CI's libselinux-2.8-6.fc29.x86_64 libsepol-2.… bodhi update "
+                "plautrba's libselinux-2.8-6.fc29.x86_64 libsepol-2.… bodhi update "
                 "is ready for testing"
             ),
             "__str__": (
-                "BaseOS CI's Bodhi update is ready for testing\nBuilds:"
+                "plautrba's Bodhi update is ready for testing\nBuilds:"
                 "\nlibselinux-2.8-6.fc29.x86_64\nlibsepol-2.8-3.fc29.x86_64 "
             ),
             "app_icon": "https://apps.fedoraproject.org/img/icons/bodhi.png",