mirror of
https://github.com/stablyai/orca.git
synced 2026-10-18 00:03:20 +00:00
fix(github): avoid false outage attribution
This commit is contained in:
@@ -20,6 +20,7 @@ describe('classifyGitHubUnavailable', () => {
|
||||
'connect ETIMEDOUT 140.82.112.5:443',
|
||||
'TimeoutError: request aborted',
|
||||
'NetworkError when attempting to fetch resource',
|
||||
'network unavailable',
|
||||
'fetch failed',
|
||||
'socket hang up',
|
||||
'could not resolve host: api.github.com',
|
||||
@@ -41,6 +42,11 @@ describe('classifyGitHubUnavailable', () => {
|
||||
expect(classifyGitHubUnavailable('HTTP 403: Resource not accessible by integration')).toBeNull()
|
||||
expect(classifyGitHubUnavailable('HTTP 404: Not Found')).toBeNull()
|
||||
expect(classifyGitHubUnavailable('could not resolve to a Repository with the name')).toBeNull()
|
||||
expect(
|
||||
classifyGitHubUnavailable(
|
||||
"GraphQL: Could not resolve to a Repository with the name 'network'."
|
||||
)
|
||||
).toBeNull()
|
||||
expect(classifyGitHubUnavailable('gh auth login required')).toBeNull()
|
||||
expect(classifyGitHubUnavailable('')).toBeNull()
|
||||
})
|
||||
|
||||
@@ -23,7 +23,7 @@ const SERVER_ERROR_PATTERN =
|
||||
// both Node (ENOTFOUND/ECONNRESET) and the gh Go client ("dial tcp", "i/o
|
||||
// timeout", "no such host") shapes.
|
||||
const NETWORK_PATTERN =
|
||||
/timeout|\btimed out\b|\bno such host\b|could not resolve host|could not resolve to a host|network|\bconnection (?:refused|reset)\b|\bdial tcp\b|\bi\/o timeout\b|\bfetch failed\b|\bsocket hang up\b|ENOTFOUND|ECONNRESET|ECONNREFUSED|ETIMEDOUT|EAI_AGAIN|ENETUNREACH/i
|
||||
/timeout|\btimed out\b|\bno such host\b|could not resolve host|could not resolve to a host|\bnetwork(?:error| (?:error|unavailable|unreachable|request failed))\b|\bconnection (?:refused|reset)\b|\bdial tcp\b|\bi\/o timeout\b|\bfetch failed\b|\bsocket hang up\b|ENOTFOUND|ECONNRESET|ECONNREFUSED|ETIMEDOUT|EAI_AGAIN|ENETUNREACH/i
|
||||
|
||||
/**
|
||||
* Classify a gh/Octokit error message as a GitHub-reachability problem, or
|
||||
|
||||
Reference in New Issue
Block a user