MCPcopy Create free account
hub / github.com/pollinations/pollinations / reopen_issue

Method reopen_issue

apps/polly/src/services/github.py:494–529  ·  view source on GitHub ↗

Reopen a closed issue.

(self, issue_number: int, comment: str | None = None)

Source from the content-addressed store, hash-verified

492 return {"success": False, "error": str(e)}
493
494 async def reopen_issue(self, issue_number: int, comment: str | None = None) -> dict:
495 """Reopen a closed issue."""
496 if not self._has_auth():
497 return {"success": False, "error": "GitHub token not configured"}
498
499 url = f"https://api.github.com/repos/{config.github_repo}/issues/{issue_number}"
500
501 try:
502 session = await self.get_session()
503
504 # Add comment first if provided
505 if comment:
506 await self.add_comment(issue_number, comment, "Admin")
507
508 # Reopen the issue
509 async with session.patch(
510 url,
511 json={"state": "open"},
512 headers=await self._get_headers(),
513 timeout=aiohttp.ClientTimeout(total=10),
514 ) as response:
515 if response.status == 200:
516 logger.info(f"Reopened issue #{issue_number}")
517 return {
518 "success": True,
519 "issue_number": issue_number,
520 "issue_url": f"https://github.com/{config.github_repo}/issues/{issue_number}",
521 }
522 else:
523 return {
524 "success": False,
525 "error": f"GitHub API error: {response.status}",
526 }
527 except Exception as e:
528 logger.error(f"Error reopening issue: {e}")
529 return {"success": False, "error": str(e)}
530
531 async def edit_issue(self, issue_number: int, title: str | None = None, body: str | None = None) -> dict:
532 """Edit an issue's title and/or body."""

Callers 1

tool_github_issueFunction · 0.80

Calls 6

_has_authMethod · 0.95
get_sessionMethod · 0.95
add_commentMethod · 0.95
_get_headersMethod · 0.95
errorMethod · 0.80
infoMethod · 0.65

Tested by

no test coverage detected