Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(netxlite): use *Netx for the system resolver #1248

Merged
merged 8 commits into from
Sep 12, 2023
Merged

Conversation

bassosimone
Copy link
Contributor

@bassosimone bassosimone commented Sep 11, 2023

This diff modifies how we construct netxlite's system resolver such that public functions use the *Netx equivalents.

While there, recognize that there wasn't enough testing for the optional wrappers provided by model.DNSTransportWrapper and that we are not using this functionality. So, rather than writing new tests for this functionality, we can actually just drop it and simplify the codebase.

While there, recognize that netxlite.WrapDNSTransport could easily become private.

While there, recognize that ./legacy/netx needs lots of public function being exported by netxlite but we don't need to expose that many implementation details to new code that will be using *Netx. So, make sure all the new methods we create for *Netx are actually private methods. (Ideally, the API surface of netxlite should be smaller; we would not be able to get there for quite some time, but we can at least avoid increasing the API surface.)

The general idea for which I am pushing here is to have additional clarity about dependencies, to better analyze the requirements of non measuring code for ooni/probe#2531.

This code modifies how we construct netxlite's system resolver such that
public functions use the *Netx equivalents.

The general idea for which I am pushing here is to have additional
clarity about dependencies, to better analyze the requirements of non
measuring code for ooni/probe#2531.
@bassosimone bassosimone merged commit 7224984 into master Sep 12, 2023
6 checks passed
@bassosimone bassosimone deleted the issue/2531 branch September 12, 2023 05:53
Murphy-OrangeMud pushed a commit to Murphy-OrangeMud/probe-cli that referenced this pull request Feb 13, 2024
This diff modifies how we construct netxlite's system resolver such that
public functions use the *Netx equivalents.

While there, recognize that there wasn't enough testing for the optional
wrappers provided by `model.DNSTransportWrapper` and that we are not
using this functionality. So, rather than writing new tests for this
functionality, we can actually just drop it and simplify the codebase.

While there, recognize that `netxlite.WrapDNSTransport` could easily
become private.

While there, recognize that `./legacy/netx` needs lots of public
function being exported by `netxlite` but we don't need to expose that
many implementation details to new code that will be using `*Netx`. So,
make sure all the new methods we create for `*Netx` are actually private
methods. (Ideally, the API surface of `netxlite` should be smaller; we
would not be able to get there for quite some time, but we can at least
avoid increasing the API surface.)

The general idea for which I am pushing here is to have additional
clarity about dependencies, to better analyze the requirements of non
measuring code for ooni/probe#2531.
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.

1 participant