(
installation_id: str,
params: PaginatedQueryParams,
)
| 224 | |
| 225 | |
| 226 | def fetch_github_repositories( |
| 227 | installation_id: str, |
| 228 | params: PaginatedQueryParams, |
| 229 | ) -> dict[str, Any]: |
| 230 | url = ( |
| 231 | f"{GITHUB_API_URL}installation/repositories?" |
| 232 | + f"&per_page={params.page_size}&page={params.page}" |
| 233 | ) |
| 234 | |
| 235 | headers: dict[str, str] = build_request_headers(installation_id) |
| 236 | |
| 237 | response = requests.get(url, headers=headers, timeout=GITHUB_API_CALLS_TIMEOUT) |
| 238 | json_response = response.json() |
| 239 | response.raise_for_status() |
| 240 | results = [ |
| 241 | { |
| 242 | "full_name": i["full_name"], |
| 243 | "id": i["id"], |
| 244 | "name": i["name"], |
| 245 | } |
| 246 | for i in json_response["repositories"] |
| 247 | ] |
| 248 | |
| 249 | return build_paginated_response(results, response, json_response["total_count"]) |
| 250 | |
| 251 | |
| 252 | def get_github_issue_pr_title_and_state( |
no test coverage detected
searching dependent graphs…