forked from longhorn/bot
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new issue to default project
Signed-off-by: Jack Yu <[email protected]>
- Loading branch information
Showing
10 changed files
with
100 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from harvester_github_bot.global_variables import * | ||
from harvester_github_bot.config import * | ||
from harvester_github_bot.route import * |
23 changes: 23 additions & 0 deletions
23
github-bot/harvester_github_bot/action_added_to_default_project.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from harvester_github_bot.issue_transfer import IssueTransfer | ||
from harvester_github_bot.action import Action | ||
from harvester_github_bot import app, gtihub_project_manager, \ | ||
ZENHUB_PIPELINE, ZENHUB_PIPELINE | ||
|
||
class ActionAddedToDefaultProject(Action): | ||
def __init__(self): | ||
pass | ||
|
||
def isMatched(self, actionRequest): | ||
if actionRequest.event_type not in ['issue']: | ||
return False | ||
if actionRequest.action not in ['opened']: | ||
return False | ||
return True | ||
|
||
def action(self, request): | ||
if gtihub_project_manager.prepared is False: | ||
return | ||
|
||
issue = request.get('issue') | ||
item = gtihub_project_manager.get_issue(issue["number"]) | ||
gtihub_project_manager.add_issue_to_project(item['id']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
from flask import Flask | ||
|
||
app = Flask(__name__) | ||
gh_api = {} | ||
zenh_api = {} | ||
repo = {} | ||
repo_test = {} | ||
gtihub_project_manager = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters