feat(dns): Add real-time DNS speed benchmark and 'Fastest' auto-selection option - #4935
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (8)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughAdds the Fastest DNS option. It benchmarks eligible providers over TCP port 53, selects the lowest-latency successful result, updates DNS and DoH settings, and preserves existing settings when no provider succeeds. ChangesFastest DNS selection
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant WPFchangedns
participant SetWinUtilDNS
participant GetWinUtilDNSBenchmark
participant DNSProvider
WPFchangedns->>SetWinUtilDNS: Select Fastest
SetWinUtilDNS->>GetWinUtilDNSBenchmark: Request latency results
GetWinUtilDNSBenchmark->>DNSProvider: Probe TCP port 53
DNSProvider-->>GetWinUtilDNSBenchmark: Return latency or failure
GetWinUtilDNSBenchmark-->>SetWinUtilDNS: Return sorted results
SetWinUtilDNS-->>WPFchangedns: Apply provider or return failure
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3df14ad33
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@functions/private/Get-WinUtilDNSBenchmark.ps1`:
- Around line 42-55: Update the TCP probe around the visible $client and
$asyncResult operations to use try/finally cleanup: after a successful wait,
call $asyncResult.EndConnect() and ensure $client is closed or disposed on every
success, timeout, and exception path. Preserve the 9999 fallback latency, and do
not dispose $asyncResult.AsyncWaitHandle.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 16975faa-5874-48d4-93ce-bfa656774f1e
📒 Files selected for processing (3)
config/tweaks.jsonfunctions/private/Get-WinUtilDNSBenchmark.ps1functions/private/Set-WinUtilDNS.ps1
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.biomeignore:
- Line 4: Remove the broad *.json rule from .biomeignore so JSON files under
docs, including package-lock.json, package.json, and tsconfig.json, remain
included; retain the existing config-specific ignore rules.
- Around line 1-4: Remove the inert .biomeignore file and move its JSON
exclusion patterns into a supported Biome ignore mechanism, preferably the
excludes configuration in biome.json; preserve coverage for config/*.json,
nested config/*.json, and all *.json files.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 14808587-468d-44cb-b543-75eed0159b70
📒 Files selected for processing (3)
.biomeignorefunctions/private/Get-WinUtilDNSBenchmark.ps1functions/private/Set-WinUtilDNS.ps1
🚧 Files skipped from review as they are similar to previous changes (2)
- functions/private/Set-WinUtilDNS.ps1
- functions/private/Get-WinUtilDNSBenchmark.ps1
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 614cb6b21c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
@coderabbitai full review |
|
Hosted CodeRabbit completed on eb8abd6 with no actionable comments and a successful status. Its bundled Biome tool reports parse failures on existing multiline PowerShell strings in config/tweaks.json; the PR only adds Fastest to ComboItems in that file. WinUtil compilation and the full Pester suite validate the configuration successfully. No broad lint exclusions were introduced. Local Codex review is also clean; the requested hosted Codex review has not returned yet. |
✅ Action performedFull review finished. |
|
Final review verification for eb8abd6: CodeRabbit full review cf1be907-ef9e-487e-90c5-39f402794393 covered all eight PR files against current main f65d263 and returned zero actionable comments. Hosted compile and CodeRabbit checks pass; all seven review threads are resolved. Local Codex review is clean. The separately requested hosted Codex review has not responded. GitHub reports MERGEABLE but BLOCKED / REVIEW_REQUIRED because a code-owner approval is still required. No merge performed. |
Summary
Adds Fastest to the Tweaks DNS dropdown. WinUtil compares TCP port 53 connection times for explicitly eligible, unfiltered providers (Google and Cloudflare), then applies the quickest measured provider through the existing IPv4/IPv6 and DoH configuration path.
Filtering providers are excluded by default through
BenchmarkEligiblemetadata inconfig/dns.json. If no probe succeeds, adapter settings are preserved and the DNS step returns failure. Probes dispose their clients on success, timeout, and connection failure.TCP connection time is a rough latency estimate, not a DNS lookup or DoH benchmark. The two sequential probes have 1500 ms timeouts, so the scan can take about three seconds when both time out.
Review fixes
.biomeignorewas already removed; this PR introduces no JSON lint exclusions.Validation
Import-Module Pester -RequiredVersion 5.8.0 -Force; Invoke-Pester -Path 'pester/*.Tests.ps1' -Output Detailed -CI: 844 passed, 0 failed, 1 existing UAC-dependent test skipped on Windows / PowerShell 7.pester/dns.Tests.ps1andpester/dns-benchmark.Tests.ps1: 18 passed in Windows PowerShell 5.1 and PowerShell 7.Invoke-ScriptAnalyzer -Path . -Settings ./lint/PSScriptAnalyser.ps1 -Recurse: no errors; convention/test-stub warnings remain../Compile.ps1: passed; generatedwinutil.ps1is ignored and not committed.