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

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

chipx86
rbintegrations
release-2.0.x
rbintegrations

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
Improve posting reviews to chat services, and fix a crash on empty reviews.
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: Closed (submitted)

Change Summary:

Pushed to release-2.0.x (837b5b6)
Loading...