Improve posting reviews to chat services, and fix a crash on empty reviews.

Review Request #12698 — Created Oct. 25, 2022 and submitted

Information

rbintegrations
release-2.0.x

Reviewers

When a new review was posted without body_top text and no comment, we
fail to set the body variable, causing a crash.

While the crash is harmless, it does cause spurious issues in the logs.

This change fixes this, and improves the overall behavior in two ways:

1) If the body_top is "Ship It!", we now fall back to the first comment
(if available), rather than an empty string for the text.

2) If a comment is not available, it will now fall back to body_bottom,
which wasn't being considered before.

Unit tests pass. The new tests previously exhibited the behavior reported
by a customer.

Summary ID
Improve posting reviews to chat services, and fix a crash on empty reviews.
When a new review was posted without body_top text and no comment, we fail to set the `body` variable, causing a crash. While the crash is harmless, it does cause spurious issues in the logs. This change fixes this, and improves the overall behavior in two ways: 1) If the body_top is "Ship It!", we now fall back to the first comment (if available), rather than an empty string for the text. 2) If a comment is not available, then it now falls back to `body_bottom`, which wasn't being considered before.
ec9bb60fd579ef86de7813e07c41f7091040dfee
Description From Last Updated

line too long (80 > 79 characters) Column: 80 Error code: E501

reviewbotreviewbot

line too long (83 > 79 characters) Column: 80 Error code: E501

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
maubin
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (837b5b6)