List issues for a GitHub repository. Args: ctx: Run context containing DevOpsContext request: Parameters for the issue listing request Returns: List of GitHubIssue objects
(
ctx: RunContext[DevOpsContext],
request: GitHubIssueRequest
)
| 89 | |
| 90 | @function_tool() |
| 91 | async def list_issues( |
| 92 | ctx: RunContext[DevOpsContext], |
| 93 | request: GitHubIssueRequest |
| 94 | ) -> List[GitHubIssue]: |
| 95 | """ |
| 96 | List issues for a GitHub repository. |
| 97 | |
| 98 | Args: |
| 99 | ctx: Run context containing DevOpsContext |
| 100 | request: Parameters for the issue listing request |
| 101 | |
| 102 | Returns: |
| 103 | List of GitHubIssue objects |
| 104 | """ |
| 105 | logger.info(f"Listing issues for {request.owner}/{request.repo} with state={request.state}") |
| 106 | |
| 107 | # Get GitHub client |
| 108 | g = _get_github_client() |
| 109 | |
| 110 | # Get repository |
| 111 | repo = g.get_repo(f"{request.owner}/{request.repo}") |
| 112 | |
| 113 | # Prepare parameters for get_issues |
| 114 | kwargs = {'state': request.state} |
| 115 | |
| 116 | if request.labels: |
| 117 | kwargs['labels'] = request.labels |
| 118 | |
| 119 | if request.assignee: |
| 120 | kwargs['assignee'] = request.assignee |
| 121 | |
| 122 | if request.creator: |
| 123 | kwargs['creator'] = request.creator |
| 124 | |
| 125 | if request.mentioned: |
| 126 | kwargs['mentioned'] = request.mentioned |
| 127 | |
| 128 | if request.sort: |
| 129 | kwargs['sort'] = request.sort |
| 130 | |
| 131 | if request.direction: |
| 132 | kwargs['direction'] = request.direction |
| 133 | |
| 134 | if request.since: |
| 135 | kwargs['since'] = request.since |
| 136 | |
| 137 | # Get issues |
| 138 | issues = repo.get_issues(**kwargs) |
| 139 | |
| 140 | # Convert to GitHubIssue models |
| 141 | result = [] |
| 142 | for issue in issues: |
| 143 | # Skip pull requests (GitHub considers PRs as issues) |
| 144 | if issue.pull_request is not None: |
| 145 | continue |
| 146 | |
| 147 | # Extract labels |
| 148 | labels = [label.name for label in issue.labels] |
nothing calls this directly
no test coverage detected