diff --git a/rosdistro_reviewer/review.py b/rosdistro_reviewer/review.py index 6842c59..4ff7f06 100644 --- a/rosdistro_reviewer/review.py +++ b/rosdistro_reviewer/review.py @@ -136,9 +136,11 @@ def summarize(self) -> str: if not self._elements: return '(No changes to supported elements were detected)' - message = 'This is an automated review.' - for element, criteria in self.elements.items(): - message += f'\n\nFor changes related to {element}:' + message = '' + for idx, (element, criteria) in enumerate(self.elements.items()): + if idx: + message += '\n\n' + message += f'For changes related to {element}:' for criterion in criteria: message += '\n* ' + criterion.recommendation.as_symbol() message += ' ' + textwrap.indent(criterion.rationale, ' ')[2:] diff --git a/rosdistro_reviewer/submitter/github.py b/rosdistro_reviewer/submitter/github.py index c2a2242..0ca8c53 100644 --- a/rosdistro_reviewer/submitter/github.py +++ b/rosdistro_reviewer/submitter/github.py @@ -16,6 +16,12 @@ GITHUB_TOKEN_ENVIRONMENT_VARIABLE = EnvironmentVariable( 'GITHUB_TOKEN', 'Authentication token secret for GitHub') +BODY_HEADER = """Hi there, thanks for contributing to ROS! + +This is an automated review generated by the [rosdistro-reviewer tool](https://github.com/ros-infrastructure/rosdistro-reviewer). If you'd like the tool to run again, just [re-request review from GitHub Actions](https://github.com/ros-infrastructure/rosdistro-reviewer?tab=readme-ov-file#running-rosdistro-reviewer-in-github-actions). + +""" # noqa: E501 + class GitHubSubmitter(ReviewSubmitterExtensionPoint): """Submit reviews to GitHub pull requests.""" @@ -86,6 +92,6 @@ def _annotation_to_comment( recommendation = review.recommendation pr.create_review( - body=message, + body=BODY_HEADER + message, event=RECOMMENDATION_EVENTS[recommendation], comments=comments)