Skip to content

Commit

Permalink
Add guard for empty body to github_release_report (#3645)
Browse files Browse the repository at this point in the history
Fixes #3640.
  • Loading branch information
jstvz authored Sep 20, 2023
1 parent 794bc2f commit 5d5216c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cumulusci/tasks/github/release_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def _run_task(self):
"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"):
Expand Down
16 changes: 15 additions & 1 deletion cumulusci/tasks/github/tests/test_release_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ def test_run_task(self):
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",
Expand Down Expand Up @@ -91,5 +96,14 @@ def test_run_task(self):
),
"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"]
2 changes: 1 addition & 1 deletion cumulusci/tasks/github/tests/util_github_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def _get_expected_release(self, tag_name, **kw):
"assets": [],
"assets_url": "",
"author": self._get_expected_user("author"),
"body": "",
"body": None,
"created_at": now,
"draft": False,
"html_url": "",
Expand Down

0 comments on commit 5d5216c

Please sign in to comment.