Skip to content

fix(storage): handle DNS resolution errors in git repository connection checks#4965

Merged
erka merged 1 commit into
v2from
rd/v2/dns-connection
Oct 30, 2025
Merged

fix(storage): handle DNS resolution errors in git repository connection checks#4965
erka merged 1 commit into
v2from
rd/v2/dns-connection

Conversation

@erka

@erka erka commented Oct 29, 2025

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Oct 29, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.29%. Comparing base (0d67a97) to head (ed789cb).
⚠️ Report is 2 commits behind head on v2.

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              
Flag Coverage Δ
integrationtests 34.91% <0.00%> (-0.02%) ⬇️
unittests 51.31% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@erka
erka marked this pull request as ready for review October 29, 2025 23:17
@erka
erka requested a review from a team as a code owner October 29, 2025 23:17
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Oct 29, 2025
@dosubot

dosubot Bot commented Oct 29, 2025

Copy link
Copy Markdown

Documentation Updates

Checked 4 published document(s). No updates required.

How did I do? Any feedback?  Join Discord

@erka
erka force-pushed the rd/v2/dns-connection branch from 942e7da to 4c9d8e1 Compare October 30, 2025 11:45
…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]>
@erka
erka force-pushed the rd/v2/dns-connection branch from 4c9d8e1 to ed789cb Compare October 30, 2025 11:50
@markphelps
markphelps requested a review from Copilot October 30, 2025 13:29

@markphelps markphelps left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm do you think we should create a new patch release?

@erka
erka merged commit 1c942c2 into v2 Oct 30, 2025
33 checks passed
@erka
erka deleted the rd/v2/dns-connection branch October 30, 2025 13:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 IsConnectionRefused to detect DNS errors (IsNotFound or IsTemporary)
  • Added support for network timeout detection using the net.Error interface
  • 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.

Comment thread internal/storage/git/repository_test.go
Comment thread internal/storage/git/repository.go
@erka

erka commented Oct 30, 2025

Copy link
Copy Markdown
Contributor Author

lgtm do you think we should create a new patch release?

We could just build v2-nightly. I think João is only working on the POC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants