-
Notifications
You must be signed in to change notification settings - Fork 351
Move action handlers to hackbot api #6802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
10471ef
a967218
fa8c68e
e039535
735703e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,24 @@ | ||
| from hackbot_runtime.actions.handlers.base import ActionHandler | ||
| from hackbot_runtime.actions.handlers.bugzilla_handler import ( | ||
| from app.action_handlers.base import ActionHandler | ||
| from app.action_handlers.bugzilla_handler import ( | ||
| AddAttachmentHandler, | ||
| AddCommentHandler, | ||
| CreateBugHandler, | ||
| UpdateBugHandler, | ||
| ) | ||
| from hackbot_runtime.actions.handlers.email_handler import SendEmailHandler | ||
| from hackbot_runtime.actions.handlers.phabricator_handler import ( | ||
| from app.action_handlers.email_handler import SendEmailHandler | ||
| from app.action_handlers.phabricator_handler import ( | ||
| AddCommentHandler as PhabricatorAddCommentHandler, | ||
| ) | ||
| from hackbot_runtime.actions.handlers.phabricator_handler import ( | ||
| from app.action_handlers.phabricator_handler import ( | ||
| SubmitPatchHandler, | ||
| UpdatePatchHandler, | ||
| ) | ||
| from hackbot_runtime.actions.handlers.slack_handler import PostMessageHandler | ||
| from hackbot_runtime.actions.handlers.testrail_handler import SubmitTestPlanHandler | ||
| from hackbot_runtime.actions.handlers.try_server_handler import PushHandler | ||
| from app.action_handlers.slack_handler import PostMessageHandler | ||
| from app.action_handlers.testrail_handler import SubmitTestPlanHandler | ||
| from app.action_handlers.try_server_handler import PushHandler | ||
|
|
||
| # Actions that submit source changes to Phabricator. | ||
| PATCH_ACTION_TYPES = frozenset({"phabricator.submit_patch", "phabricator.update_patch"}) | ||
|
Comment on lines
+20
to
+21
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this a duplicate now? If so, we should file a follow-up issue and link it here, so we could fix that later. If we have other cases, we could use the same issue to track all of them. |
||
|
|
||
| # Maps a recorded action's dotted `type` to the handler that applies it. | ||
| # Adding a new action type later is a one-line addition here — the dispatch | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,16 +9,29 @@ | |
| """ | ||
|
|
||
| import json | ||
| import subprocess | ||
| from base64 import b64decode | ||
| from datetime import datetime, timezone | ||
|
|
||
| import pytest | ||
| from hackbot_runtime.actions.handlers import ApplyContext, try_server_handler | ||
| from hackbot_runtime.actions.handlers.registry import get_handler | ||
| from hackbot_runtime.actions.try_server import TRY_ACTION_TYPES | ||
| from hackbot_runtime.changes import _git | ||
| from app.action_handlers import ApplyContext, try_server_handler | ||
| from app.action_handlers.registry import get_handler | ||
| from lando_client import LandoClient | ||
|
|
||
| # Actions that submit source changes to the Try server. | ||
| TRY_ACTION_TYPES = frozenset({"try_server.push"}) | ||
|
|
||
|
|
||
| def _git(repo, *args: str) -> str: | ||
| """Run a git command in ``repo`` and return its stdout.""" | ||
| return subprocess.run( | ||
| ["git", "-C", str(repo), *args], | ||
| check=True, | ||
| capture_output=True, | ||
| text=True, | ||
| ).stdout | ||
|
|
||
|
Comment on lines
+25
to
+33
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need this here? The hackbot-api service does not have a git repo! |
||
|
|
||
| _SUBMISSION = { | ||
| "base_commit": "a" * 40, | ||
| "base_commit_vcs": "git", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we adding this?