Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

Detach porcelain from netx/internal #146

Merged
merged 5 commits into from
Jan 8, 2020

Conversation

bassosimone
Copy link
Contributor

This is yak shaving as part of ooni/probe-engine#2. Specifically, this diff refactors the code such that netx/x/{logger,porcelain} does not depend on netx/internal.

Each individual commit contains its own short rationale.

On a broader level, this diff is related to discussions I had with @FedericoCeratto concerning unifying netx and probe-engine to reduce complexity. I have determined that this won't happen because:

  1. I am using netx also in jafar and it makes sense therefore to keep netx independent

  2. the netx API described in DESIGN.md is not poised to change because it is based on the standard library API, hence we should keep it stable

Thus, I can see how occasionally we'll make the data model richer, or apply fixes, but I see low coupling between the DESIGN.md API and probe-engine.

OTOH, the coupling is very high for two packages in x: porcelain and logger. So, the right approach is to fork these two packages in probe-engine and develop them in there. This PR is precisely aiming at making sure that we can fork them. I also considered deleting them but, since they are clearly marked as experimental, it's also fine to keep them.

This is an internal implementation detail currently used by x/porcelain. We
are planning on forking x/porcelain in probe-engine. So we cannot use any
internal package inside its implementation.
We were previously wrapping the error in porcelain, which was not
100% correct, because technically porcelain is just a set of helpers
on the top the underlying functionality.

Instead, perform this kind of wrapping in the internal RoundTripper.

With also this change committed to master, we have severed the internal
ties between x/porcelain and the rest of netx. This is functional to
my plan of forking x/porcelain inside of probe-engine.
It was not always made obvious enough.
It makes sense to discuss the scoreboard, because this is a
functionality that we hope will eventually be stable.

All the rest is just experiments and currently both x/porcelain
and x/logger are clearly not only track of becoming stable.

Hence, do not spend time mentioning them.
@bassosimone bassosimone added this to the Sprint 4 - Ceffyl Dŵr milestone Jan 8, 2020
@bassosimone bassosimone added the please preserve history Do not squash and merge label Jan 8, 2020
@bassosimone bassosimone merged commit cc9be0f into master Jan 8, 2020
@bassosimone bassosimone deleted the feature/fork_for_probe_engine branch January 8, 2020 14:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
please preserve history Do not squash and merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant