From 032e8d2084af813d2779b358c5dd37c62719d130 Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Mon, 11 Nov 2024 14:12:15 +0800 Subject: [PATCH] feat: use automation flow instead of using bot to add issue to project Signed-off-by: Jack Yu --- .../label_action/create_backport.py | 12 +----------- .../label_action/create_gui_issue.py | 10 +--------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/github-bot/harvester_github_bot/label_action/create_backport.py b/github-bot/harvester_github_bot/label_action/create_backport.py index fee20be..57d1470 100644 --- a/github-bot/harvester_github_bot/label_action/create_backport.py +++ b/github-bot/harvester_github_bot/label_action/create_backport.py @@ -46,7 +46,6 @@ def action(self, request): bp.create_issue_if_not_exist() bp.create_comment() r = bp.related_release() - bp.related_github_project() msg.append(r) except ExistedBackportComment as e: app.logger.debug(f"issue number {request['issue']['number']} had created backport with labels {backport_label['name']}") @@ -146,13 +145,4 @@ def related_release(self): raise CustomException("failed to associated release(%s) with repo(%d) and issue(%d): %s" % ( release_id, repo.id, self.__issue.number, e)) - return "issue number: %d." % self.__issue.number - - # associated github_project - def related_github_project(self): - if gtihub_project_manager.prepared is False: - return - - issue = gtihub_project_manager.get_issue(self.__issue.number) - gtihub_project_manager.add_issue_to_project(issue['id']) - return + return "issue number: %d." % self.__issue.number \ No newline at end of file diff --git a/github-bot/harvester_github_bot/label_action/create_gui_issue.py b/github-bot/harvester_github_bot/label_action/create_gui_issue.py index 37402d3..4bdcf78 100644 --- a/github-bot/harvester_github_bot/label_action/create_gui_issue.py +++ b/github-bot/harvester_github_bot/label_action/create_gui_issue.py @@ -41,7 +41,6 @@ def action(self, request): return "GUI issue already exist" self.__create_gui_issue() self.__create_comment() - self.__related_github_project() return "create GUI issue success" def __create_gui_issue(self): @@ -63,11 +62,4 @@ def __is_gui_issue_exist(self): for comment in comments: if re.match(comment_pattern, comment.body): return True - return False - - def __related_github_project(self): - if gtihub_project_manager.prepared is False: - return - - issue = gtihub_project_manager.get_issue(self.gui_issue.number) - gtihub_project_manager.add_issue_to_project(issue['id']) \ No newline at end of file + return False \ No newline at end of file