Skip to content

Commit

Permalink
cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarmet committed Mar 6, 2024
1 parent ceb5aa5 commit 6278dd1
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions bert_e/workflow/pr_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,7 @@ def _send_comment(settings, pull_request: AbstractPullRequest, msg: str,
LOG.debug('SENDING MESSAGE %s', msg)


def notify_user(settings, pull_request: AbstractPullRequest,
comment: exceptions.TemplateException):
"""Notify user by sending a comment or a build status in a pull request."""
try:
send_bot_status(settings, pull_request, comment)
return _send_comment(settings, pull_request, str(comment),
comment.dont_repeat_if_in_history)
except exceptions.CommentAlreadyExists:
LOG.info("Comment '%s' already posted", comment.__class__.__name__)


def send_bot_status(settings, pull_request: AbstractPullRequest,
def _send_bot_status(settings, pull_request: AbstractPullRequest,
comment: exceptions.TemplateException):
"""Post the bot status in a pull request."""
if settings.send_bot_status is False:
Expand All @@ -106,3 +95,14 @@ def send_bot_status(settings, pull_request: AbstractPullRequest,
title=comment.title,
summary=str(comment),
)


def notify_user(settings, pull_request: AbstractPullRequest,
comment: exceptions.TemplateException):
"""Notify user by sending a comment or a build status in a pull request."""
try:
_send_bot_status(settings, pull_request, comment)
_send_comment(settings, pull_request, str(comment),
comment.dont_repeat_if_in_history)
except exceptions.CommentAlreadyExists:
LOG.info("Comment '%s' already posted", comment.__class__.__name__)

0 comments on commit 6278dd1

Please sign in to comment.