Skip to content

Commit

Permalink
cleanup: move measurex and tracex inside ./internal/legacy (#1261)
Browse files Browse the repository at this point in the history
This diff moves the measurex and tracex packages inside of the
./internal/legacy package. The reason why I am doing this is because we
don't plan on further developing these packages. We will just fix bugs
if they arise.

I am doing this change before looking into whether we could more clearly
figure out the dependencies these packages need considering that we're
trying to figure out and organize better how we use netxlite throughout
the codebase.

The overall objective of this work is to gently separate code for
measuring and code for communicating with the backend to support
ooni/probe#2531.
  • Loading branch information
bassosimone authored Sep 12, 2023
1 parent 56e4587 commit f837d61
Show file tree
Hide file tree
Showing 103 changed files with 69 additions and 69 deletions.
2 changes: 1 addition & 1 deletion internal/experiment/dash/measurer.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/legacy/netx"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

// Config contains the experiment config.
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/dash/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/humanize"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/runtimex"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

// runnerConfig contains settings for running the dash experiment. This struct
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/dash/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/apex/log"
"github.com/ooni/probe-cli/v3/internal/mocks"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

func TestRunnerRunAllPhasesLocateFailure(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/dnscheck/dnscheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/legacy/netx"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/runtimex"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/fbmessenger/fbmessenger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/netemx"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/runtimex"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

// servicesAddr is the IP address implementing al fbmessenger services in netem-based tests
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/hhfm/hhfm.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/randx"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/hhfm/hhfm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/legacy/mockable"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

func TestNewExperimentMeasurer(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/hirl/hirl.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/randx"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/hirl/hirl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/legacy/netx"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

func TestNewExperimentMeasurer(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/quicping/quicping.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
_ "crypto/sha256"

"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

// A connectionID in QUIC
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/riseupvpn/riseupvpn.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/experiment/urlgetter"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/riseupvpn/riseupvpn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/legacy/mockable"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/stunreachability/stunreachability.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/legacy/netx"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
"github.com/pion/stun"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/tlsmiddlebox/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"sync"

"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

// CompleteTrace records the result of the network trace
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/tlstool/tlstool.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/legacy/netx"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/runtimex"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions internal/experiment/tor/tor.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (
"sync/atomic"
"time"

"github.com/ooni/probe-cli/v3/internal/measurex"
"github.com/ooni/probe-cli/v3/internal/legacy/measurex"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/runtimex"
"github.com/ooni/probe-cli/v3/internal/scrubber"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/tor/tor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/apex/log"
"github.com/google/go-cmp/cmp"
"github.com/ooni/probe-cli/v3/internal/legacy/mockable"
"github.com/ooni/probe-cli/v3/internal/measurex"
"github.com/ooni/probe-cli/v3/internal/legacy/measurex"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/scrubber"
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/torsf/torsf.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/ptx"
"github.com/ooni/probe-cli/v3/internal/runtimex"
"github.com/ooni/probe-cli/v3/internal/torlogs"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
"github.com/ooni/probe-cli/v3/internal/tunnel"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/urlgetter/configurer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/legacy/netx"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

// The Configurer job is to construct a Configuration that can
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/urlgetter/configurer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/apex/log"
"github.com/ooni/probe-cli/v3/internal/experiment/urlgetter"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

func TestConfigurerNewConfigurationVanilla(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/urlgetter/getter.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
"github.com/ooni/probe-cli/v3/internal/tunnel"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/urlgetter/urlgetter.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"time"

"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/vanillator/vanillator.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/runtimex"
"github.com/ooni/probe-cli/v3/internal/torlogs"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
"github.com/ooni/probe-cli/v3/internal/tunnel"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/webconnectivity/httpanalysis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/experiment/urlgetter"
"github.com/ooni/probe-cli/v3/internal/experiment/webconnectivity"
"github.com/ooni/probe-cli/v3/internal/randx"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

func TestHTTPBodyLengthChecks(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/webconnectivity/summary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/ooni/probe-cli/v3/internal/experiment/webconnectivity"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

func TestSummarize(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/webconnectivity/webconnectivity.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/ooni/probe-cli/v3/internal/experiment/webconnectivity/internal"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/experiment/webconnectivity"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

func TestNewExperimentMeasurer(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/webconnectivitylte/testkeys.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"github.com/ooni/probe-cli/v3/internal/experiment/webconnectivity"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

// TestKeys contains the results produced by web_connectivity.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"

"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

// WrapDNSXRoundTripper creates a new DNSXRoundTripper that
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

// WrapResolver creates a new Resolver that saves events into the WritableDB.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion internal/legacy/netx/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/ooni/probe-cli/v3/internal/bytecounter"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

// Config contains configuration for creating new transports, dialers, etc. When
Expand Down
2 changes: 1 addition & 1 deletion internal/legacy/netx/dnstransport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

func TestNewDNSClientInvalidURL(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/legacy/netx/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"

"github.com/ooni/probe-cli/v3/internal/mocks"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

func TestNewHTTPTransportWithDialer(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/legacy/netx/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/apex/log"
"github.com/ooni/probe-cli/v3/internal/bytecounter"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

func TestHTTPTransportWorkingAsIntended(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/legacy/netx/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/apex/log"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

func TestNewResolverBogonResolutionNotBroken(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/legacy/netx/tls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/runtimex"
"github.com/ooni/probe-cli/v3/internal/testingx"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

func TestNewTLSDialer(t *testing.T) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion internal/oohelperd/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/logx"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

// newfailure is a convenience shortcut to save typing.
Expand Down
2 changes: 1 addition & 1 deletion internal/oohelperd/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/runtimex"
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"
)

// TODO(bassosimone): we should refactor the TH to use step-by-step such that we
Expand Down
2 changes: 1 addition & 1 deletion internal/tutorial/experiment/torsf/chapter04/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The `tracex` package contains code used to format internal
measurements representations to the OONI data format.

```Go
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"

```

Expand Down
2 changes: 1 addition & 1 deletion internal/tutorial/experiment/torsf/chapter04/torsf.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import (
// measurements representations to the OONI data format.
//
// ```Go
"github.com/ooni/probe-cli/v3/internal/tracex"
"github.com/ooni/probe-cli/v3/internal/legacy/tracex"

// ```
//
Expand Down
2 changes: 1 addition & 1 deletion internal/tutorial/measurex/chapter01/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import (
"fmt"
"time"

"github.com/ooni/probe-cli/v3/internal/measurex"
"github.com/ooni/probe-cli/v3/internal/legacy/measurex"
"github.com/ooni/probe-cli/v3/internal/runtimex"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/tutorial/measurex/chapter01/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import (
"fmt"
"time"

"github.com/ooni/probe-cli/v3/internal/measurex"
"github.com/ooni/probe-cli/v3/internal/legacy/measurex"
"github.com/ooni/probe-cli/v3/internal/runtimex"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/tutorial/measurex/chapter02/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"fmt"
"time"

"github.com/ooni/probe-cli/v3/internal/measurex"
"github.com/ooni/probe-cli/v3/internal/legacy/measurex"
"github.com/ooni/probe-cli/v3/internal/runtimex"
)

Expand Down
Loading

0 comments on commit f837d61

Please sign in to comment.