pull-requests: handle exceptions in state change and improve logging.

This commit is contained in:
Marcin Kuzminski 2019-09-10 15:28:20 +02:00
parent 27ead49471
commit 3e5a351479
2 changed files with 24 additions and 8 deletions

View file

@ -507,10 +507,10 @@ class PullRequestModel(BaseModel):
# operation
pull_request = PullRequest.get(pull_request.pull_request_id)
# set as merging, for simulation, and if finished to created so we mark
# set as merging, for merge simulation, and if finished to created so we mark
# simulation is working fine
with pull_request.set_state(PullRequest.STATE_MERGING,
final_state=PullRequest.STATE_CREATED):
final_state=PullRequest.STATE_CREATED) as state_obj:
MergeCheck.validate(
pull_request, auth_user=auth_user, translator=translator)
@ -1099,6 +1099,8 @@ class PullRequestModel(BaseModel):
if not reviewers_ids:
return
log.debug('Notify following reviewers about pull-request %s', reviewers_ids)
pull_request_obj = pull_request
# get the current participants of this pull request
recipients = reviewers_ids