isTransientSHAResolutionError returns true when the ref-to-SHA failure appears transient and worth retrying (rate limits, network/timeout failures, or HTTP 5xx). All other errors are treated as permanent and fail immediately.
(err error)
| 267 | // transient and worth retrying (rate limits, network/timeout failures, or HTTP 5xx). |
| 268 | // All other errors are treated as permanent and fail immediately. |
| 269 | func isTransientSHAResolutionError(err error) bool { |
| 270 | if err == nil { |
| 271 | return false |
| 272 | } |
| 273 | |
| 274 | errorText := strings.ToLower(err.Error()) |
| 275 | if strings.Contains(errorText, "http 429") || |
| 276 | strings.Contains(errorText, "rate limit") || |
| 277 | strings.Contains(errorText, "timeout") || |
| 278 | strings.Contains(errorText, "timed out") || |
| 279 | strings.Contains(errorText, "context deadline exceeded") || |
| 280 | strings.Contains(errorText, "temporary") || |
| 281 | strings.Contains(errorText, "connection reset") || |
| 282 | strings.Contains(errorText, "connection refused") || |
| 283 | strings.Contains(errorText, "eof") { |
| 284 | return true |
| 285 | } |
| 286 | |
| 287 | return transientHTTP5xxPattern.MatchString(errorText) |
| 288 | } |
| 289 | |
| 290 | // fetchGenericURLWorkflow fetches a workflow from an arbitrary HTTP(S) URL and dispatches |
| 291 | // on the response Content-Type to produce a FetchedWorkflow. |
no test coverage detected