From 272078ce1909896d6467bb63806441322fdb3546 Mon Sep 17 00:00:00 2001 From: "siraj.yasin" Date: Mon, 19 Apr 2021 17:31:38 +0000 Subject: [PATCH] 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 --- gerrit_to_github_issues/engine.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gerrit_to_github_issues/engine.py b/gerrit_to_github_issues/engine.py index e588256..925a442 100644 --- a/gerrit_to_github_issues/engine.py +++ b/gerrit_to_github_issues/engine.py @@ -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: