|
19 | 19 | constants, |
20 | 20 | ) |
21 | 21 | from app.services.dynamo import get_state_information |
22 | | -from app.utils.handler_utils import is_duplicate_event, trigger_async_processing, respond_with_eyes |
| 22 | +from app.utils.handler_utils import ( |
| 23 | + is_duplicate_event, |
| 24 | + trigger_async_processing, |
| 25 | + respond_with_eyes, |
| 26 | + trigger_pull_request_processing, |
| 27 | +) |
23 | 28 | from app.slack.slack_events import store_feedback |
24 | 29 |
|
25 | 30 | logger = get_logger() |
@@ -139,16 +144,20 @@ def mention_handler(event, ack, body, client): |
139 | 144 | return |
140 | 145 |
|
141 | 146 | if cleaned.lower().startswith(constants.PULL_REQUEST_PREFIX): |
142 | | - pull_request_id, extracted_message = _extract_pull_request_id(cleaned) |
143 | | - logger.debug(f"Handling message for pull request {pull_request_id}", extra={"pull_request_id": pull_request_id}) |
144 | 147 | try: |
| 148 | + pull_request_id, extracted_message = _extract_pull_request_id(cleaned) |
| 149 | + pull_request_lambda_arn = trigger_pull_request_processing(pull_request_id) |
| 150 | + logger.debug( |
| 151 | + f"Handling message for pull request {pull_request_id}", |
| 152 | + extra={"pull_request_id": pull_request_id, "pull_request_lambda_arn": pull_request_lambda_arn}, |
| 153 | + ) |
145 | 154 | client.chat_postMessage( |
146 | 155 | channel=channel_id, |
147 | | - text=f"Handling message for pull request {pull_request_id}", |
| 156 | + text=f"Handling message for pull request {pull_request_id} by calling {pull_request_lambda_arn}", |
148 | 157 | thread_ts=thread_root, |
149 | 158 | ) |
150 | 159 | except Exception as e: |
151 | | - logger.error(f"Failed to post channel feedback ack: {e}", extra={"error": traceback.format_exc()}) |
| 160 | + logger.error(f"Can not find pull request details: {e}", extra={"error": traceback.format_exc()}) |
152 | 161 | return |
153 | 162 |
|
154 | 163 | # Normal mention -> async processing |
|
0 commit comments