Skip to content

Commit

Permalink
feat: use automation flow instead of using bot to add issue to project
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Yu <[email protected]>
  • Loading branch information
Yu-Jack committed Nov 11, 2024
1 parent 160b7e7 commit 032e8d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
12 changes: 1 addition & 11 deletions github-bot/harvester_github_bot/label_action/create_backport.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']}")
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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'])
return False

0 comments on commit 032e8d2

Please sign in to comment.