1515 ToolError ,
1616 ToolRunOptions ,
1717)
18- from ymir .tools .base import CloneableTool as Tool
1918from pydantic import BaseModel , Field
2019
2120from ymir .common import CVEEligibilityResult , TriageEligibility , load_rhel_config
2221from ymir .common .base_utils import get_jira_auth_headers
2322from ymir .common .constants import JIRA_SEARCH_PATH
2423from ymir .common .version_utils import get_fix_version_variants , normalize_fix_version , parse_rhel_version
24+ from ymir .tools .base import CloneableTool as Tool
2525from ymir .tools .constants import AIOHTTP_TIMEOUT
2626
2727if os .getenv ("MOCK_JIRA" , "False" ).lower () == "true" :
@@ -1200,9 +1200,7 @@ async def _run(
12001200 f"on { issue_key } (this is expected, not an error)"
12011201 )
12021202
1203- jira_url = urljoin (
1204- os .getenv ("JIRA_URL" ), f"rest/api/2/issue/{ issue_key } /comment/{ comment_id } "
1205- )
1203+ jira_url = urljoin (os .getenv ("JIRA_URL" ), f"rest/api/2/issue/{ issue_key } /comment/{ comment_id } " )
12061204 logger .info ("Updating comment %s on %s" , comment_id , issue_key )
12071205
12081206 async with aiohttpClientSession (timeout = AIOHTTP_TIMEOUT ) as session :
@@ -1214,13 +1212,9 @@ async def _run(
12141212 ) as response :
12151213 response .raise_for_status ()
12161214 except aiohttp .ClientError as e :
1217- raise ToolError (
1218- f"Failed to update comment { comment_id } on { issue_key } : { e } "
1219- ) from e
1215+ raise ToolError (f"Failed to update comment { comment_id } on { issue_key } : { e } " ) from e
12201216
1221- return StringToolOutput (
1222- result = f"Successfully updated comment { comment_id } on { issue_key } "
1223- )
1217+ return StringToolOutput (result = f"Successfully updated comment { comment_id } on { issue_key } " )
12241218
12251219
12261220class AddJiraAttachmentsToolInput (BaseModel ):
@@ -1267,9 +1261,7 @@ async def _run(
12671261 f"to { issue_key } (this is expected, not an error)"
12681262 )
12691263
1270- jira_url = urljoin (
1271- os .getenv ("JIRA_URL" ), f"rest/api/2/issue/{ issue_key } /attachments"
1272- )
1264+ jira_url = urljoin (os .getenv ("JIRA_URL" ), f"rest/api/2/issue/{ issue_key } /attachments" )
12731265 headers = dict (get_jira_auth_headers ())
12741266 # Remove Content-Type so aiohttp sets multipart correctly
12751267 headers .pop ("Content-Type" , None )
@@ -1301,9 +1293,7 @@ async def _run(
13011293 raise ToolError (f"Failed to add attachments to { issue_key } : { e } " ) from e
13021294
13031295 filenames = ", " .join (a ["filename" ] for a in attachments )
1304- return StringToolOutput (
1305- result = f"Successfully added attachments ({ filenames } ) to { issue_key } "
1306- )
1296+ return StringToolOutput (result = f"Successfully added attachments ({ filenames } ) to { issue_key } " )
13071297
13081298
13091299class GetJiraAttachmentToolInput (BaseModel ):
@@ -1366,8 +1356,6 @@ async def _run(
13661356 try :
13671357 text = content .decode ("utf-8" )
13681358 except UnicodeDecodeError :
1369- return StringToolOutput (
1370- result = f"Failed to decode attachment { filename } as UTF-8"
1371- )
1359+ return StringToolOutput (result = f"Failed to decode attachment { filename } as UTF-8" )
13721360
13731361 return StringToolOutput (result = text )
0 commit comments