From fabb8d63369b1fc80f7892257d5019d41bb8bb0d Mon Sep 17 00:00:00 2001 From: John Strunk Date: Tue, 4 Jun 2024 14:25:55 +0000 Subject: [PATCH] Hardcode my username as an allowed author for summary updates This is a temporary fix to prevent the summary bot from regenerating summaries due to the bot being moved to its own account instead of using mine. Signed-off-by: John Strunk --- jira_howto.ipynb | 5 +++-- summarizer.py | 9 ++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/jira_howto.ipynb b/jira_howto.ipynb index 8ccf5bb..d0e8b9a 100644 --- a/jira_howto.ipynb +++ b/jira_howto.ipynb @@ -146,7 +146,8 @@ "outputs": [], "source": [ "# Get a list of the custom fields in this issue by finding all fields that start with \"customfield_\"\n", - "custom_fields = [k for k in issue[\"fields\"].keys() if k.startswith(\"customfield_\")]\n", + "custom_fields = [k for k in issue[\"fields\"].keys()\n", + " if k.startswith(\"customfield_\")]\n", "for field in custom_fields:\n", " if issue[\"fields\"].get(field, None) is None:\n", " continue\n", @@ -287,7 +288,7 @@ "metadata": {}, "outputs": [], "source": [ - "jira.user(username=\"assisted-installer-bot\")" + "jira.user(username=\"jstrunk@redhat.com\")" ] }, { diff --git a/summarizer.py b/summarizer.py index 742e921..d406329 100644 --- a/summarizer.py +++ b/summarizer.py @@ -219,9 +219,12 @@ def summary_last_updated(issue: Issue) -> datetime: return last_update for change in issue.changelog: - if change.author == get_self( - issue.client - ).display_name and "Status Summary" in [chg.field for chg in change.changes]: + # This is to prevent regenerating summaries due to the summary bot + # being moved to its own account instead of using mine + if change.author in [ + get_self(issue.client).display_name, + "John Strunk", + ] and "Status Summary" in [chg.field for chg in change.changes]: last_update = max(last_update, change.created) return last_update