(installation_id: str)
| 133 | |
| 134 | |
| 135 | def delete_github_installation(installation_id: str) -> requests.Response: # type: ignore[return] |
| 136 | url = f"{GITHUB_API_URL}app/installations/{installation_id}" |
| 137 | headers = build_request_headers(installation_id, use_jwt=True) |
| 138 | try: |
| 139 | response = requests.delete( |
| 140 | url, headers=headers, timeout=GITHUB_API_CALLS_TIMEOUT |
| 141 | ) |
| 142 | response.raise_for_status() |
| 143 | return response |
| 144 | except HTTPError: |
| 145 | response_content = response.content.decode("utf-8") |
| 146 | error_data = json.loads(response_content) |
| 147 | if error_data.get("message") == "Not Found" and response.status_code == 404: |
| 148 | logger.info( |
| 149 | f"The GitHub application with the installation ID: {installation_id} was not found." |
| 150 | ) |
| 151 | return response |
| 152 | |
| 153 | |
| 154 | def fetch_search_github_resource( |
no test coverage detected
searching dependent graphs…