(
self,
title: str,
description: str,
reporter: str,
participants: list[str] | None = None,
image_urls: list[str] | None = None,
user_role_ids: list[int] | None = None,
reporter_id: int | None = None,
message_url: str | None = None,
)
| 212 | return [] |
| 213 | |
| 214 | async def create_issue( |
| 215 | self, |
| 216 | title: str, |
| 217 | description: str, |
| 218 | reporter: str, |
| 219 | participants: list[str] | None = None, |
| 220 | image_urls: list[str] | None = None, |
| 221 | user_role_ids: list[int] | None = None, |
| 222 | reporter_id: int | None = None, |
| 223 | message_url: str | None = None, |
| 224 | ) -> dict: |
| 225 | |
| 226 | if not self._has_auth(): |
| 227 | return {"success": False, "error": "GitHub token not configured"} |
| 228 | |
| 229 | if not config.github_repo: |
| 230 | return {"success": False, "error": "GitHub repository not configured"} |
| 231 | |
| 232 | body = self._build_issue_body( |
| 233 | description=description, |
| 234 | reporter=reporter, |
| 235 | participants=participants, |
| 236 | image_urls=image_urls, |
| 237 | reporter_id=reporter_id, |
| 238 | message_url=message_url, |
| 239 | ) |
| 240 | |
| 241 | url = f"https://api.github.com/repos/{config.github_repo}/issues" |
| 242 | |
| 243 | # No labels - external workflows handle labeling |
| 244 | payload = {"title": title, "body": body} |
| 245 | |
| 246 | try: |
| 247 | session = await self.get_session() |
| 248 | async with session.post( |
| 249 | url, |
| 250 | json=payload, |
| 251 | headers=await self._get_headers(), |
| 252 | timeout=aiohttp.ClientTimeout(total=API_TIMEOUT), |
| 253 | ) as response: |
| 254 | if response.status == 201: |
| 255 | data = await response.json() |
| 256 | issue_number = data["number"] |
| 257 | issue_url = data["html_url"] |
| 258 | logger.info(f"Issue created: #{issue_number} - {title}") |
| 259 | return { |
| 260 | "success": True, |
| 261 | "issue_url": issue_url, |
| 262 | "issue_number": issue_number, |
| 263 | } |
| 264 | else: |
| 265 | error_text = await response.text() |
| 266 | logger.error(f"GitHub API error: {response.status} - {error_text[:MAX_ERROR_LENGTH]}") |
| 267 | return { |
| 268 | "success": False, |
| 269 | "error": f"GitHub API error: {response.status}", |
| 270 | } |
| 271 |
no test coverage detected