From 26d807c50f9d45fdaf754186de32f53d271389b9 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Thu, 4 Feb 2021 11:00:27 +0100 Subject: [PATCH] fix: always use probe-cli version (and make it alpha) (#219) See https://github.com/ooni/probe-engine/issues/1181 While there, run `go fmt ./...` --- cmd/ooniprobe/internal/cli/app/app.go | 2 +- cmd/ooniprobe/internal/cli/root/root.go | 2 +- cmd/ooniprobe/internal/cli/version/version.go | 2 +- internal/cmd/apitool/main.go | 2 +- internal/cmd/jafar/uncensored/uncensored.go | 2 +- internal/cmd/oohelper/internal/client.go | 4 ++-- internal/cmd/oohelper/oohelper.go | 2 +- internal/cmd/oohelperd/internal/internal.go | 2 +- internal/engine/experiment.go | 2 +- internal/engine/experiment/dnscheck/dnscheck.go | 2 +- internal/engine/experiment/run/urlgetter.go | 2 +- internal/engine/experiment/tlstool/tlstool.go | 2 +- internal/engine/experiment/tor/tor.go | 2 +- internal/engine/experiment/urlgetter/runner.go | 2 +- internal/engine/experiment/whatsapp/whatsapp.go | 2 +- internal/engine/geolocate/geolocate.go | 4 ++-- internal/engine/internal/mockable/mockable.go | 4 ++-- internal/engine/internal/psiphonx/psiphonx_test.go | 2 +- internal/engine/internal/sessionresolver/sessionresolver.go | 2 +- internal/engine/legacy/netx/handlers/handlers.go | 2 +- internal/engine/legacy/oonitemplates/oonitemplates.go | 2 +- internal/engine/netx/netx.go | 2 +- internal/engine/netx/resolver/bogon.go | 2 +- internal/engine/session.go | 4 ++-- internal/engine/session_integration_test.go | 2 +- internal/engine/version/version.go | 5 ----- internal/libminiooni/libminiooni.go | 2 +- {cmd/ooniprobe/internal => internal}/version/version.go | 2 +- pkg/oonimkall/internal/tasks/runner.go | 2 +- pkg/oonimkall/session.go | 2 +- 30 files changed, 33 insertions(+), 38 deletions(-) delete mode 100644 internal/engine/version/version.go rename {cmd/ooniprobe/internal => internal}/version/version.go (81%) diff --git a/cmd/ooniprobe/internal/cli/app/app.go b/cmd/ooniprobe/internal/cli/app/app.go index 5530bfa..27b1404 100644 --- a/cmd/ooniprobe/internal/cli/app/app.go +++ b/cmd/ooniprobe/internal/cli/app/app.go @@ -5,7 +5,7 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/root" - "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/version" + "github.com/ooni/probe-cli/v3/internal/version" ) // Run the app. This is the main app entry point diff --git a/cmd/ooniprobe/internal/cli/root/root.go b/cmd/ooniprobe/internal/cli/root/root.go index 642c01b..df4b387 100644 --- a/cmd/ooniprobe/internal/cli/root/root.go +++ b/cmd/ooniprobe/internal/cli/root/root.go @@ -8,7 +8,7 @@ import ( "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/log/handlers/syslog" "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/ooni" "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/utils" - "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/version" + "github.com/ooni/probe-cli/v3/internal/version" ) // Cmd is the root command diff --git a/cmd/ooniprobe/internal/cli/version/version.go b/cmd/ooniprobe/internal/cli/version/version.go index 14d5d8a..88b7c81 100644 --- a/cmd/ooniprobe/internal/cli/version/version.go +++ b/cmd/ooniprobe/internal/cli/version/version.go @@ -5,7 +5,7 @@ import ( "github.com/alecthomas/kingpin" "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/root" - "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/version" + "github.com/ooni/probe-cli/v3/internal/version" ) func init() { diff --git a/internal/cmd/apitool/main.go b/internal/cmd/apitool/main.go index d2762dd..61e1e44 100644 --- a/internal/cmd/apitool/main.go +++ b/internal/cmd/apitool/main.go @@ -21,7 +21,7 @@ import ( "github.com/ooni/probe-cli/v3/internal/engine/kvstore" "github.com/ooni/probe-cli/v3/internal/engine/netx" "github.com/ooni/probe-cli/v3/internal/engine/probeservices" - "github.com/ooni/probe-cli/v3/internal/engine/version" + "github.com/ooni/probe-cli/v3/internal/version" ) func newclient() probeservices.Client { diff --git a/internal/cmd/jafar/uncensored/uncensored.go b/internal/cmd/jafar/uncensored/uncensored.go index 6e4d36d..9fce757 100644 --- a/internal/cmd/jafar/uncensored/uncensored.go +++ b/internal/cmd/jafar/uncensored/uncensored.go @@ -9,8 +9,8 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter" - "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/netx" + "github.com/ooni/probe-cli/v3/internal/engine/runtimex" ) // Client is DNS, HTTP, and TCP client. diff --git a/internal/cmd/oohelper/internal/client.go b/internal/cmd/oohelper/internal/client.go index 7da96d9..60e98ac 100644 --- a/internal/cmd/oohelper/internal/client.go +++ b/internal/cmd/oohelper/internal/client.go @@ -14,9 +14,9 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/experiment/webconnectivity" "github.com/ooni/probe-cli/v3/internal/engine/httpheader" - "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/netx" - "github.com/ooni/probe-cli/v3/internal/engine/version" + "github.com/ooni/probe-cli/v3/internal/engine/runtimex" + "github.com/ooni/probe-cli/v3/internal/version" ) type ( diff --git a/internal/cmd/oohelper/oohelper.go b/internal/cmd/oohelper/oohelper.go index c63620c..df5482c 100644 --- a/internal/cmd/oohelper/oohelper.go +++ b/internal/cmd/oohelper/oohelper.go @@ -11,8 +11,8 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/cmd/oohelper/internal" - "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/netx" + "github.com/ooni/probe-cli/v3/internal/engine/runtimex" ) var ( diff --git a/internal/cmd/oohelperd/internal/internal.go b/internal/cmd/oohelperd/internal/internal.go index 70b5f45..35adad6 100644 --- a/internal/cmd/oohelperd/internal/internal.go +++ b/internal/cmd/oohelperd/internal/internal.go @@ -8,7 +8,7 @@ import ( "net/http" "github.com/ooni/probe-cli/v3/internal/engine/netx" - "github.com/ooni/probe-cli/v3/internal/engine/version" + "github.com/ooni/probe-cli/v3/internal/version" ) // Handler implements the Web Connectivity test helper HTTP API. diff --git a/internal/engine/experiment.go b/internal/engine/experiment.go index 891f3be..3669123 100644 --- a/internal/engine/experiment.go +++ b/internal/engine/experiment.go @@ -18,7 +18,7 @@ import ( "github.com/ooni/probe-cli/v3/internal/engine/netx/httptransport" "github.com/ooni/probe-cli/v3/internal/engine/probeservices" "github.com/ooni/probe-cli/v3/internal/engine/resources" - "github.com/ooni/probe-cli/v3/internal/engine/version" + "github.com/ooni/probe-cli/v3/internal/version" ) const dateFormat = "2006-01-02 15:04:05" diff --git a/internal/engine/experiment/dnscheck/dnscheck.go b/internal/engine/experiment/dnscheck/dnscheck.go index 417bd70..1a17b3e 100644 --- a/internal/engine/experiment/dnscheck/dnscheck.go +++ b/internal/engine/experiment/dnscheck/dnscheck.go @@ -15,11 +15,11 @@ import ( "time" "github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter" - "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/model" "github.com/ooni/probe-cli/v3/internal/engine/netx" "github.com/ooni/probe-cli/v3/internal/engine/netx/archival" "github.com/ooni/probe-cli/v3/internal/engine/netx/trace" + "github.com/ooni/probe-cli/v3/internal/engine/runtimex" ) const ( diff --git a/internal/engine/experiment/run/urlgetter.go b/internal/engine/experiment/run/urlgetter.go index e653fa8..70a96ef 100644 --- a/internal/engine/experiment/run/urlgetter.go +++ b/internal/engine/experiment/run/urlgetter.go @@ -7,7 +7,7 @@ import ( "github.com/ooni/probe-cli/v3/internal/engine/model" ) -type urlGetterMain struct {} +type urlGetterMain struct{} func (m *urlGetterMain) do(ctx context.Context, input StructuredInput, sess model.ExperimentSession, measurement *model.Measurement, diff --git a/internal/engine/experiment/tlstool/tlstool.go b/internal/engine/experiment/tlstool/tlstool.go index 66ccc53..cf965f2 100644 --- a/internal/engine/experiment/tlstool/tlstool.go +++ b/internal/engine/experiment/tlstool/tlstool.go @@ -16,10 +16,10 @@ import ( "time" "github.com/ooni/probe-cli/v3/internal/engine/experiment/tlstool/internal" - "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/model" "github.com/ooni/probe-cli/v3/internal/engine/netx" "github.com/ooni/probe-cli/v3/internal/engine/netx/archival" + "github.com/ooni/probe-cli/v3/internal/engine/runtimex" ) const ( diff --git a/internal/engine/experiment/tor/tor.go b/internal/engine/experiment/tor/tor.go index 53396b0..ee409cc 100644 --- a/internal/engine/experiment/tor/tor.go +++ b/internal/engine/experiment/tor/tor.go @@ -14,12 +14,12 @@ import ( "github.com/ooni/probe-cli/v3/internal/engine/atomicx" "github.com/ooni/probe-cli/v3/internal/engine/httpheader" - "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/legacy/netxlogger" "github.com/ooni/probe-cli/v3/internal/engine/legacy/oonidatamodel" "github.com/ooni/probe-cli/v3/internal/engine/legacy/oonitemplates" "github.com/ooni/probe-cli/v3/internal/engine/model" "github.com/ooni/probe-cli/v3/internal/engine/netx/errorx" + "github.com/ooni/probe-cli/v3/internal/engine/runtimex" ) const ( diff --git a/internal/engine/experiment/urlgetter/runner.go b/internal/engine/experiment/urlgetter/runner.go index ed94b09..f02600d 100644 --- a/internal/engine/experiment/urlgetter/runner.go +++ b/internal/engine/experiment/urlgetter/runner.go @@ -11,9 +11,9 @@ import ( "net/url" "github.com/ooni/probe-cli/v3/internal/engine/httpheader" - "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/netx" "github.com/ooni/probe-cli/v3/internal/engine/netx/errorx" + "github.com/ooni/probe-cli/v3/internal/engine/runtimex" ) const httpRequestFailed = "http_request_failed" diff --git a/internal/engine/experiment/whatsapp/whatsapp.go b/internal/engine/experiment/whatsapp/whatsapp.go index e8d085d..eac221d 100644 --- a/internal/engine/experiment/whatsapp/whatsapp.go +++ b/internal/engine/experiment/whatsapp/whatsapp.go @@ -14,8 +14,8 @@ import ( "github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter" "github.com/ooni/probe-cli/v3/internal/engine/internal/httpfailure" - "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/model" + "github.com/ooni/probe-cli/v3/internal/engine/runtimex" ) const ( diff --git a/internal/engine/geolocate/geolocate.go b/internal/engine/geolocate/geolocate.go index 3b29d73..d1371ae 100644 --- a/internal/engine/geolocate/geolocate.go +++ b/internal/engine/geolocate/geolocate.go @@ -7,9 +7,9 @@ import ( "fmt" "net/http" - "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/model" - "github.com/ooni/probe-cli/v3/internal/engine/version" + "github.com/ooni/probe-cli/v3/internal/engine/runtimex" + "github.com/ooni/probe-cli/v3/internal/version" ) const ( diff --git a/internal/engine/internal/mockable/mockable.go b/internal/engine/internal/mockable/mockable.go index 4ef0379..1ce50af 100644 --- a/internal/engine/internal/mockable/mockable.go +++ b/internal/engine/internal/mockable/mockable.go @@ -6,14 +6,14 @@ import ( "net/http" "net/url" - "github.com/ooni/probe-cli/v3/internal/engine/kvstore" "github.com/ooni/probe-cli/v3/internal/engine/internal/psiphonx" - "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/internal/torx" "github.com/ooni/probe-cli/v3/internal/engine/internal/tunnel" + "github.com/ooni/probe-cli/v3/internal/engine/kvstore" "github.com/ooni/probe-cli/v3/internal/engine/model" "github.com/ooni/probe-cli/v3/internal/engine/probeservices" "github.com/ooni/probe-cli/v3/internal/engine/probeservices/testorchestra" + "github.com/ooni/probe-cli/v3/internal/engine/runtimex" ) // Session allows to mock sessions. diff --git a/internal/engine/internal/psiphonx/psiphonx_test.go b/internal/engine/internal/psiphonx/psiphonx_test.go index 7f7da19..b5fc1be 100644 --- a/internal/engine/internal/psiphonx/psiphonx_test.go +++ b/internal/engine/internal/psiphonx/psiphonx_test.go @@ -6,11 +6,11 @@ import ( "os" "testing" - "github.com/ooni/psiphon/oopsi/github.com/Psiphon-Labs/psiphon-tunnel-core/ClientLibrary/clientlib" "github.com/apex/log" engine "github.com/ooni/probe-cli/v3/internal/engine" "github.com/ooni/probe-cli/v3/internal/engine/internal/mockable" "github.com/ooni/probe-cli/v3/internal/engine/internal/psiphonx" + "github.com/ooni/psiphon/oopsi/github.com/Psiphon-Labs/psiphon-tunnel-core/ClientLibrary/clientlib" ) func TestStartWithCancelledContext(t *testing.T) { diff --git a/internal/engine/internal/sessionresolver/sessionresolver.go b/internal/engine/internal/sessionresolver/sessionresolver.go index 8dec4a8..190d5f1 100644 --- a/internal/engine/internal/sessionresolver/sessionresolver.go +++ b/internal/engine/internal/sessionresolver/sessionresolver.go @@ -9,8 +9,8 @@ import ( "time" "github.com/ooni/probe-cli/v3/internal/engine/atomicx" - "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/netx" + "github.com/ooni/probe-cli/v3/internal/engine/runtimex" ) // Resolver is the session resolver. diff --git a/internal/engine/legacy/netx/handlers/handlers.go b/internal/engine/legacy/netx/handlers/handlers.go index e401dc7..48f79b2 100644 --- a/internal/engine/legacy/netx/handlers/handlers.go +++ b/internal/engine/legacy/netx/handlers/handlers.go @@ -6,8 +6,8 @@ import ( "fmt" "sync" - "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/legacy/netx/modelx" + "github.com/ooni/probe-cli/v3/internal/engine/runtimex" ) type stdoutHandler struct{} diff --git a/internal/engine/legacy/oonitemplates/oonitemplates.go b/internal/engine/legacy/oonitemplates/oonitemplates.go index 496f45e..1b0e861 100644 --- a/internal/engine/legacy/oonitemplates/oonitemplates.go +++ b/internal/engine/legacy/oonitemplates/oonitemplates.go @@ -21,10 +21,10 @@ import ( goptlib "git.torproject.org/pluggable-transports/goptlib.git" "github.com/ooni/probe-cli/v3/internal/engine/atomicx" - "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/legacy/netx" "github.com/ooni/probe-cli/v3/internal/engine/legacy/netx/handlers" "github.com/ooni/probe-cli/v3/internal/engine/legacy/netx/modelx" + "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "gitlab.com/yawning/obfs4.git/transports" obfs4base "gitlab.com/yawning/obfs4.git/transports/base" ) diff --git a/internal/engine/netx/netx.go b/internal/engine/netx/netx.go index e56698a..59b38af 100644 --- a/internal/engine/netx/netx.go +++ b/internal/engine/netx/netx.go @@ -31,7 +31,6 @@ import ( "net/url" "github.com/lucas-clemente/quic-go" - "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/netx/bytecounter" "github.com/ooni/probe-cli/v3/internal/engine/netx/dialer" "github.com/ooni/probe-cli/v3/internal/engine/netx/gocertifi" @@ -40,6 +39,7 @@ import ( "github.com/ooni/probe-cli/v3/internal/engine/netx/resolver" "github.com/ooni/probe-cli/v3/internal/engine/netx/selfcensor" "github.com/ooni/probe-cli/v3/internal/engine/netx/trace" + "github.com/ooni/probe-cli/v3/internal/engine/runtimex" ) // Logger is the logger assumed by this package diff --git a/internal/engine/netx/resolver/bogon.go b/internal/engine/netx/resolver/bogon.go index 3748325..2b4fe50 100644 --- a/internal/engine/netx/resolver/bogon.go +++ b/internal/engine/netx/resolver/bogon.go @@ -4,8 +4,8 @@ import ( "context" "net" - "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/netx/errorx" + "github.com/ooni/probe-cli/v3/internal/engine/runtimex" ) var privateIPBlocks []*net.IPNet diff --git a/internal/engine/session.go b/internal/engine/session.go index 6431f7b..980e7e1 100644 --- a/internal/engine/session.go +++ b/internal/engine/session.go @@ -13,16 +13,16 @@ import ( "github.com/ooni/probe-cli/v3/internal/engine/atomicx" "github.com/ooni/probe-cli/v3/internal/engine/geolocate" - "github.com/ooni/probe-cli/v3/internal/engine/kvstore" "github.com/ooni/probe-cli/v3/internal/engine/internal/platform" "github.com/ooni/probe-cli/v3/internal/engine/internal/sessionresolver" "github.com/ooni/probe-cli/v3/internal/engine/internal/tunnel" + "github.com/ooni/probe-cli/v3/internal/engine/kvstore" "github.com/ooni/probe-cli/v3/internal/engine/model" "github.com/ooni/probe-cli/v3/internal/engine/netx" "github.com/ooni/probe-cli/v3/internal/engine/netx/bytecounter" "github.com/ooni/probe-cli/v3/internal/engine/probeservices" "github.com/ooni/probe-cli/v3/internal/engine/resources" - "github.com/ooni/probe-cli/v3/internal/engine/version" + "github.com/ooni/probe-cli/v3/internal/version" ) // SessionConfig contains the Session config diff --git a/internal/engine/session_integration_test.go b/internal/engine/session_integration_test.go index 18f240d..48cf551 100644 --- a/internal/engine/session_integration_test.go +++ b/internal/engine/session_integration_test.go @@ -18,7 +18,7 @@ import ( "github.com/ooni/probe-cli/v3/internal/engine/model" "github.com/ooni/probe-cli/v3/internal/engine/netx" "github.com/ooni/probe-cli/v3/internal/engine/probeservices" - "github.com/ooni/probe-cli/v3/internal/engine/version" + "github.com/ooni/probe-cli/v3/internal/version" ) func TestNewSessionBuilderChecks(t *testing.T) { diff --git a/internal/engine/version/version.go b/internal/engine/version/version.go deleted file mode 100644 index 7f384e6..0000000 --- a/internal/engine/version/version.go +++ /dev/null @@ -1,5 +0,0 @@ -// Package version contains the probe-engine version. -package version - -// Version is the version of the engine -const Version = "0.23.0" diff --git a/internal/libminiooni/libminiooni.go b/internal/libminiooni/libminiooni.go index 2d4231b..6a6d01f 100644 --- a/internal/libminiooni/libminiooni.go +++ b/internal/libminiooni/libminiooni.go @@ -32,7 +32,7 @@ import ( "github.com/ooni/probe-cli/v3/internal/engine/humanizex" "github.com/ooni/probe-cli/v3/internal/engine/model" "github.com/ooni/probe-cli/v3/internal/engine/netx/selfcensor" - "github.com/ooni/probe-cli/v3/internal/engine/version" + "github.com/ooni/probe-cli/v3/internal/version" "github.com/pborman/getopt/v2" ) diff --git a/cmd/ooniprobe/internal/version/version.go b/internal/version/version.go similarity index 81% rename from cmd/ooniprobe/internal/version/version.go rename to internal/version/version.go index c79c858..0fabebc 100644 --- a/cmd/ooniprobe/internal/version/version.go +++ b/internal/version/version.go @@ -3,5 +3,5 @@ package version const ( // Version is the software version - Version = "3.5.1" + Version = "3.6.0-alpha" ) diff --git a/pkg/oonimkall/internal/tasks/runner.go b/pkg/oonimkall/internal/tasks/runner.go index 531d135..cc106c8 100644 --- a/pkg/oonimkall/internal/tasks/runner.go +++ b/pkg/oonimkall/internal/tasks/runner.go @@ -8,8 +8,8 @@ import ( "time" engine "github.com/ooni/probe-cli/v3/internal/engine" - "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/model" + "github.com/ooni/probe-cli/v3/internal/engine/runtimex" ) const ( diff --git a/pkg/oonimkall/session.go b/pkg/oonimkall/session.go index 2972b41..4a58dd1 100644 --- a/pkg/oonimkall/session.go +++ b/pkg/oonimkall/session.go @@ -10,9 +10,9 @@ import ( engine "github.com/ooni/probe-cli/v3/internal/engine" "github.com/ooni/probe-cli/v3/internal/engine/atomicx" - "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/model" "github.com/ooni/probe-cli/v3/internal/engine/probeservices" + "github.com/ooni/probe-cli/v3/internal/engine/runtimex" ) // AtomicInt64 allows us to export atomicx.Int64 variables to