Skip to content

Add random option - #7950

Open
dontcrash wants to merge 1 commit into
AdguardTeam:masterfrom
dontcrash:master
Open

Add random option#7950
dontcrash wants to merge 1 commit into
AdguardTeam:masterfrom
dontcrash:master

Conversation

@dontcrash

@dontcrash dontcrash commented Jul 25, 2025

Copy link
Copy Markdown

Updates #4756

PR required for dnsproxy
AdguardTeam/dnsproxy#467

@windsurf-bot windsurf-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to me 🤙

💡 To request another review, post a new comment with "/windsurf-review".

case UpstreamModeParallel:
conf.UpstreamMode = proxy.UpstreamModeParallel
case UpstreamModeRandom:
conf.UpstreamMode = proxy.UpstreamModeRandom

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.

This won't build without go.mod modifications. You can set the dnsproxy version to the one from your branch, temporarily, via go get.

Comment thread openapi/next.yaml
- 'fastest'
- 'load_balancing'
- 'parallel'
- 'random'

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.

Please update both CHANGELOG.md (that one uses KeepAChangelog standard) and openapi/CHANGELOG.md adding this change.

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.

From what I understand, more changes to the frontend are required?

@ainar-g ainar-g self-assigned this Jul 29, 2025
@Sil3ntVip3r

Copy link
Copy Markdown

I ported the companion feature onto current AdGuard Home master (369d47616342c8be82262bf798f2fed2f64b697f) and validated it against the patched current dnsproxy tree. No commit or push was made.

The current-master port covers the whole setting path rather than only the backend constant:

  • backend configuration, current HTTP API validation/round-trip, proxy mapping, and fixtures;
  • next API schema and round-trip;
  • OpenAPI schema plus regenerated client_v2 model;
  • both the legacy and client_v2 DNS-settings UIs, English strings, summaries, and options;
  • main, next-API, and OpenAPI changelogs plus AGHTechDoc.md;
  • backend, frontend-helper, and generated-API regression coverage.

The dnsproxy side uses equal weights with the existing without-replacement sampler, so random mode is uniform, failed upstreams are retried in random order, and fallback/statistics behavior is preserved. Load balancing remains RTT-weighted.

Validation passed focused backend race tests, the full backend race suite, go vet, make go-check, build, Markdown/text lint, cross-platform Go checks, generated API verification, both frontend lint/typecheck suites, 35/35 legacy tests, 621/621 client_v2 tests, both production builds, translation-key audit, and clean formatting/diff checks. I also independently reran the focused backend tests three times under -race and the new client_v2 helper test.

The remaining dependency gate is mechanical: AdGuard Home currently pins dnsproxy v0.83.1. Once the dnsproxy change from AdguardTeam/dnsproxy#467 has an accepted commit or release, update go.mod and go.sum to that revision and rerun the same gates. The temporary local workspace override used for validation was removed, so this prototype does not conceal a dependency-file change. This addresses the existing requests for frontend coverage and the main/OpenAPI changelogs.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants