fix(storage): handle DNS resolution errors in git repository connection checks#4965
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v2 #4965 +/- ##
==========================================
+ Coverage 60.27% 60.29% +0.01%
==========================================
Files 136 136
Lines 13373 13378 +5
==========================================
+ Hits 8061 8066 +5
Misses 4630 4630
Partials 682 682
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
942e7da to
4c9d8e1
Compare
…onnection checks The IsConnectionRefused method now detects DNS-related errors (e.g., "no such host") and timeout (i/o timeout) in addition to existing syscall network errors. This allows the lenient fetch policy to properly handle scenarios where git remotes are temporarily unreachable due to DNS failures or i/o. Signed-off-by: Roman Dmytrenko <[email protected]>
4c9d8e1 to
ed789cb
Compare
markphelps
left a comment
There was a problem hiding this comment.
lgtm do you think we should create a new patch release?
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the IsConnectionRefused method to handle DNS resolution errors and network timeouts in addition to connection refused errors, enabling better error handling for network-related failures during repository fetches.
- Extended
IsConnectionRefusedto detect DNS errors (IsNotFoundorIsTemporary) - Added support for network timeout detection using the
net.Errorinterface - Added comprehensive test coverage for DNS errors and timeout scenarios
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/storage/git/repository.go | Extended IsConnectionRefused to handle DNS errors and timeouts; added warning log when lenient fetch policy allows continuation despite fetch failures |
| internal/storage/git/repository_test.go | Added test cases for DNS errors (not found, server failure, permanent failure) and I/O timeout scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
We could just build |
The IsConnectionRefused method now detects DNS-related errors (e.g.,
"no such host") in addition to existing syscall network errors. This
allows the lenient fetch policy to properly handle scenarios where git
remotes are temporarily unreachable due to DNS failures.
related #4907