-
Notifications
You must be signed in to change notification settings - Fork 418
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c01f29
commit f4d67f2
Showing
3 changed files
with
31 additions
and
6 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
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,21 @@ | ||
import os | ||
from typing import Any, Dict | ||
|
||
from loguru import logger | ||
|
||
LINEAR_LABEL_NAME = os.environ.get("LINEAR_LABEL_NAME", "sweep") | ||
|
||
def handle_linear_ticket(event: Dict[str, Any]): | ||
try: | ||
ticket_data = event["data"] | ||
ticket_labels = ticket_data.get("labels", []) | ||
|
||
if any(label["name"].lower() == LINEAR_LABEL_NAME.lower() for label in ticket_labels): | ||
logger.info(f"Sweep label detected on Linear ticket {ticket_data['id']}") | ||
# TODO: Implement Sweep workflow logic here | ||
# Reference on_jira_ticket.py for how to process the ticket and kick off Sweep | ||
else: | ||
logger.info(f"Sweep label not found on Linear ticket {ticket_data['id']}") | ||
|
||
except Exception as e: | ||
logger.exception(f"Error processing Linear webhook event: {e}") |