Repository: SFDO-Tooling/CumulusCI (python)

Issue:
github_release_report errors if ANY release  is missing notes
### Describe the bug

Task github_release_report throw an error `Error: 'NoneType' object has no attribute 'splitlines'` when trying to parse the Release Body if any release in all of the repo history has a blank body.

To make this worse, blank body is the default behavior of the github_release task so it is very, very easy to hit this situation and make the report useless

### Reproduction steps

1. Use `cci task run github_release` to create a release
2. attempt to report on it with `cci task run github_release_report`

EXPECTED: report to run
ACTUAL: `Error: 'NoneType' object has no attribute 'splitlines'`


### Your CumulusCI and Python versions

CumulusCI version: 3.77.0 (/Users/kai.amundsen/.local/bin/cci)
Python version: 3.10.9 (/Users/kai.amundsen/.local/pipx/venvs/cumulusci/bin/python)


### Operating System

macOS 13.4.1

### Windows environment

_No response_

### CumulusCI installation method

pipx

### Error Gist

_No response_

### Additional information

_No response_

Pull request:
Add guard for empty body to github_release_report
Fixes #3640.


Patch:
diff --git a/cumulusci/tasks/github/release_report.py b/cumulusci/tasks/github/release_report.py
index b88310653..bdf104453 100644
--- a/cumulusci/tasks/github/release_report.py
+++ b/cumulusci/tasks/github/release_report.py
@@ -69,7 +69,8 @@ class ReleaseReport(BaseGithubTask):
                 "time_push_sandbox": None,
                 "time_push_production": None,
             }
-            for line in release.body.splitlines():
+            release_body = release.body or ""
+            for line in release_body.splitlines():
                 m = regex_compiled_prefix.match(line)
                 if m:
                     if not m.group("remaining"):


Test patch:
diff --git a/cumulusci/tasks/github/tests/test_release_report.py b/cumulusci/tasks/github/tests/test_release_report.py
index 701b7ddf4..de2f1eb1f 100644
--- a/cumulusci/tasks/github/tests/test_release_report.py
+++ b/cumulusci/tasks/github/tests/test_release_report.py
@@ -49,6 +49,11 @@ Sandbox orgs: bogusdate
 Sandbox orgs: 2018-08-01
 Production orgs: 2018-09-01""",
                 ),
+                self._get_expected_release(
+                    "rel/2.1",
+                    created_at="2018-01-02T00:00:00Z",
+                    url="https://api.github.com/repos/SalesforceFoundation/Cumulus/releases/5",
+                ),
                 self._get_expected_release(
                     "rel/1.0",
                     created_at="2017-01-01T00:00:00Z",
@@ -91,5 +96,14 @@ Production orgs: 2018-09-01""",
                 ),
                 "time_push_sandbox": datetime(2018, 8, 1, 0, 0, 0, 2, tzinfo=pytz.UTC),
                 "url": "",
-            }
+            },
+            {
+                "beta": False,
+                "name": "1.0",
+                "tag": "rel/2.1",
+                "time_created": datetime(2018, 1, 2, 0, 0, tzinfo=pytz.UTC),
+                "time_push_production": None,
+                "time_push_sandbox": None,
+                "url": "",
+            },
         ] == task.return_values["releases"]
diff --git a/cumulusci/tasks/github/tests/util_github_api.py b/cumulusci/tasks/github/tests/util_github_api.py
index 7dfeafb47..c807e0cd2 100644
--- a/cumulusci/tasks/github/tests/util_github_api.py
+++ b/cumulusci/tasks/github/tests/util_github_api.py
@@ -530,7 +530,7 @@ class GithubApiTestMixin:
             "assets": [],
             "assets_url": "",
             "author": self._get_expected_user("author"),
-            "body": "",
+            "body": None,
             "created_at": now,
             "draft": False,
             "html_url": "",