Merge pull request #949 from langchain-ai/yogesh/linear-webhook-update

fix: Linear webhook project detection by fetching full issue details
This commit is contained in:
Aran Yogesh 2026-02-13 17:29:26 -08:00 • committed by GitHub
commit a8844d3a79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -71,7 +71,13 @@ def get_service_jwt_token_for_user(
LINEAR_TEAM_TO_REPO: dict[str, dict[str, Any] | dict[str, str]] = { LINEAR_TEAM_TO_REPO: dict[str, dict[str, Any] | dict[str, str]] = {
"Brace's test workspace": {"owner": "langchain-ai", "name": "open-swe"}, "Brace's test workspace": {"owner": "langchain-ai", "name": "open-swe"},
"Yogesh-dev": {"owner": "aran-yogesh", "name": "TalkBack"}, "Yogesh-dev": {
"projects": {
"open-swe-v3-test": {"owner": "aran-yogesh", "name": "nimedge"},
"open-swe-dev-test": {"owner": "aran-yogesh", "name": "TalkBack"},
},
"default": {"owner": "aran-yogesh", "name": "TalkBack"} # Fallback for issues without project
},
"LangChain OSS": { "LangChain OSS": {
"projects": { "projects": {
@ -324,6 +330,15 @@ async def fetch_linear_issue_details(issue_id: str) -> dict[str, Any] | None:
title title
description description
url url
project {
id
name
}
team {
id
name
key
}
comments { comments {
nodes { nodes {
id id
@ -760,9 +775,16 @@ async def linear_webhook( # noqa: PLR0911, PLR0912, PLR0915
logger.debug("Ignoring webhook: no issue data in comment") logger.debug("Ignoring webhook: no issue data in comment")
return {"status": "ignored", "reason": "No issue data in comment"} return {"status": "ignored", "reason": "No issue data in comment"}
team = issue.get("team", {}) # Fetch full issue details to get project info (webhook doesn't include it)
issue_id = issue.get("id", "")
full_issue = await fetch_linear_issue_details(issue_id)
if not full_issue:
logger.warning("Failed to fetch full issue details, using webhook data")
full_issue = issue
team = full_issue.get("team", {})
team_name = team.get("name", "") if team else "" team_name = team.get("name", "") if team else ""
project = issue.get("project") project = full_issue.get("project")
project_name = project.get("name", "") if project else "" project_name = project.get("name", "") if project else ""
team_identifier = team_name.strip() if team_name else "" team_identifier = team_name.strip() if team_name else ""