Fix mypy type errors in Jira integration (#13181)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Rohit Malhotra
2026-03-03 17:43:44 -05:00
committed by GitHub
parent d19ba0d166
commit 79a0cee7d9
3 changed files with 39 additions and 0 deletions

View File

@@ -155,6 +155,9 @@ class JiraDcExistingConversationView(JiraDcViewInterface):
self.conversation_id, conversation_init_data, user_id
)
if agent_loop_info.event_store is None:
raise StartingConvoException('Event store not available')
final_agent_observation = get_final_agent_observation(
agent_loop_info.event_store
)

View File

@@ -601,6 +601,12 @@ async def get_current_workspace_link(request: Request):
user_auth = cast(SaasUserAuth, await get_user_auth(request))
user_id = await user_auth.get_user_id()
if not user_id:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail='User ID not found',
)
user = await jira_manager.integration_store.get_user_by_active_workspace(
user_id
)
@@ -654,6 +660,12 @@ async def unlink_workspace(request: Request):
user_auth = cast(SaasUserAuth, await get_user_auth(request))
user_id = await user_auth.get_user_id()
if not user_id:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail='User ID not found',
)
user = await jira_manager.integration_store.get_user_by_active_workspace(
user_id
)

View File

@@ -281,6 +281,12 @@ async def create_jira_dc_workspace(
user_id = await user_auth.get_user_id()
user_email = await user_auth.get_user_email()
if not user_id:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail='User ID not found',
)
if JIRA_DC_ENABLE_OAUTH:
# OAuth flow enabled - create session and redirect to OAuth
state = str(uuid.uuid4())
@@ -404,6 +410,12 @@ async def create_workspace_link(request: Request, link_data: JiraDcLinkCreate):
user_id = await user_auth.get_user_id()
user_email = await user_auth.get_user_email()
if not user_id:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail='User ID not found',
)
target_workspace = link_data.workspace_name
if JIRA_DC_ENABLE_OAUTH:
@@ -593,6 +605,12 @@ async def get_current_workspace_link(request: Request):
user_auth = cast(SaasUserAuth, await get_user_auth(request))
user_id = await user_auth.get_user_id()
if not user_id:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail='User ID not found',
)
user = await jira_dc_manager.integration_store.get_user_by_active_workspace(
user_id
)
@@ -645,6 +663,12 @@ async def unlink_workspace(request: Request):
user_auth = cast(SaasUserAuth, await get_user_auth(request))
user_id = await user_auth.get_user_id()
if not user_id:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail='User ID not found',
)
user = await jira_dc_manager.integration_store.get_user_by_active_workspace(
user_id
)