Disable issue reopen on gerrit activity

* Few issues identified in BOT in reopening the issue on gerrit activity
  => When an old PS (tagged with issue number) is abandoned, BOT reopens
     the issue considering some activity on the issue in gerrit.
  => When a PS is merged and closed by BOT, in the next run if it identifies some
     event due to Post/Promote Job, then the issue is immediately re-opened.

Relates-To: #502
Change-Id: Id8516fb10c812873f1b4e4c3f2794845e29824d6
This commit is contained in:
siraj.yasin 2021-04-19 17:31:38 +00:00
parent d72c3e435e
commit 272078ce19

View File

@ -116,14 +116,19 @@ def add_comments(gh: github.Github, change: dict, affected_issues: dict,
return
comment_msg = get_issue_comment(change, key, skip_approvals)
if issue.state == 'closed':
LOG.debug(f'Issue #{issue_number} was closed, reopening...')
# Disable this feature to reopen issue on any gerrit activity on closed issue
# Issues identified:
# 1. When an old PS (tagged with closed issue number) is abandoned, it reopens the issue
# 2. post/promote job events are also considered as some gerrit activity on a
# closed issue and is reopened in the next immediate run of bot
#if issue.state == 'closed':
# LOG.debug(f'Issue #{issue_number} was closed, reopening...')
# NOTE(howell): Reopening a closed issue will move it from the
# "Done" column to the "In Progress" column on the project
# board via Github automation.
issue.edit(state='open')
comment_msg += '\n\nIssue reopened due to new activity on Gerrit.'
# issue.edit(state='open')
# comment_msg += '\n\nIssue reopened due to new activity on Gerrit.'
bot_comment = github_issues.get_bot_comment(issue, gh.get_user().login, change['number'])
if not bot_comment: