-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: prepare for renaming all experiments (#1032)
This diff prepares the ground for renaming all experiments. We will move each experiment from internal/engine/experiment/NAME to internal/experiment/NAME. Before we can do that, we need to rename the already existing internal/experiment/webconnectivity to become webconnectivitylte. Otherwise, we will have a naming conflict since there is also internal/engine/experiment/webconnectivity. See ooni/probe#2115
- Loading branch information
1 parent
b080d6c
commit ecedd2c
Showing
24 changed files
with
62 additions
and
26 deletions.
There are no files selected for viewing
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...xperiment/webconnectivity/analysiscore.go → ...riment/webconnectivitylte/analysiscore.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package webconnectivity | ||
package webconnectivitylte | ||
|
||
import ( | ||
"fmt" | ||
|
2 changes: 1 addition & 1 deletion
2
...experiment/webconnectivity/analysisdns.go → ...eriment/webconnectivitylte/analysisdns.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package webconnectivity | ||
package webconnectivitylte | ||
|
||
// | ||
// DNS analysis | ||
|
2 changes: 1 addition & 1 deletion
2
...iment/webconnectivity/analysishttpcore.go → ...nt/webconnectivitylte/analysishttpcore.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package webconnectivity | ||
package webconnectivitylte | ||
|
||
// | ||
// HTTP core analysis | ||
|
2 changes: 1 addition & 1 deletion
2
...iment/webconnectivity/analysishttpdiff.go → ...nt/webconnectivitylte/analysishttpdiff.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package webconnectivity | ||
package webconnectivitylte | ||
|
||
// | ||
// HTTP diff analysis | ||
|
2 changes: 1 addition & 1 deletion
2
...periment/webconnectivity/analysistcpip.go → ...iment/webconnectivitylte/analysistcpip.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package webconnectivity | ||
package webconnectivitylte | ||
|
||
// | ||
// TCP/IP analysis | ||
|
2 changes: 1 addition & 1 deletion
2
...experiment/webconnectivity/analysistls.go → ...eriment/webconnectivitylte/analysistls.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package webconnectivity | ||
package webconnectivitylte | ||
|
||
// | ||
// TLS analysis | ||
|
2 changes: 1 addition & 1 deletion
2
...periment/webconnectivity/cleartextflow.go → ...iment/webconnectivitylte/cleartextflow.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package webconnectivity | ||
package webconnectivitylte | ||
|
||
// | ||
// CleartextFlow | ||
|
2 changes: 1 addition & 1 deletion
2
...rnal/experiment/webconnectivity/config.go → ...l/experiment/webconnectivitylte/config.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package webconnectivity | ||
package webconnectivitylte | ||
|
||
// | ||
// Config | ||
|
2 changes: 1 addition & 1 deletion
2
...nal/experiment/webconnectivity/control.go → .../experiment/webconnectivitylte/control.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package webconnectivity | ||
package webconnectivitylte | ||
|
||
import ( | ||
"context" | ||
|
2 changes: 1 addition & 1 deletion
2
...al/experiment/webconnectivity/dnscache.go → ...experiment/webconnectivitylte/dnscache.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package webconnectivity | ||
package webconnectivitylte | ||
|
||
import "sync" | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...xperiment/webconnectivity/dnsresolvers.go → ...riment/webconnectivitylte/dnsresolvers.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package webconnectivity | ||
package webconnectivitylte | ||
|
||
// | ||
// DNSResolvers | ||
|
2 changes: 1 addition & 1 deletion
2
...l/experiment/webconnectivity/dnswhoami.go → ...xperiment/webconnectivitylte/dnswhoami.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package webconnectivity | ||
package webconnectivitylte | ||
|
||
import ( | ||
"context" | ||
|
4 changes: 2 additions & 2 deletions
4
internal/experiment/webconnectivity/doc.go → ...rnal/experiment/webconnectivitylte/doc.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// Package webconnectivity implements the web_connectivity experiment. | ||
// Package webconnectivitylte implements the web_connectivity experiment. | ||
// | ||
// Spec: https://github.com/ooni/spec/blob/master/nettests/ts-017-web-connectivity.md. | ||
// | ||
// This implementation, in particular, contains extensions over the original model, | ||
// which we document at https://github.com/ooni/probe/issues/2237. | ||
package webconnectivity | ||
package webconnectivitylte |
2 changes: 1 addition & 1 deletion
2
...experiment/webconnectivity/inputparser.go → ...eriment/webconnectivitylte/inputparser.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package webconnectivity | ||
package webconnectivitylte | ||
|
||
// | ||
// Input parsing | ||
|
2 changes: 1 addition & 1 deletion
2
internal/experiment/webconnectivity/iox.go → ...rnal/experiment/webconnectivitylte/iox.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...al/experiment/webconnectivity/measurer.go → ...experiment/webconnectivitylte/measurer.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package webconnectivity | ||
package webconnectivitylte | ||
|
||
// | ||
// Measurer | ||
|
2 changes: 1 addition & 1 deletion
2
...al/experiment/webconnectivity/priority.go → ...experiment/webconnectivitylte/priority.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...l/experiment/webconnectivity/redirects.go → ...xperiment/webconnectivitylte/redirects.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package webconnectivity | ||
package webconnectivitylte | ||
|
||
import "sync/atomic" | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
.../experiment/webconnectivity/secureflow.go → ...periment/webconnectivitylte/secureflow.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package webconnectivity | ||
package webconnectivitylte | ||
|
||
// | ||
// SecureFlow | ||
|
2 changes: 1 addition & 1 deletion
2
...nal/experiment/webconnectivity/summary.go → .../experiment/webconnectivitylte/summary.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package webconnectivity | ||
package webconnectivitylte | ||
|
||
// | ||
// Summary | ||
|
2 changes: 1 addition & 1 deletion
2
...al/experiment/webconnectivity/testkeys.go → ...experiment/webconnectivitylte/testkeys.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package webconnectivity | ||
package webconnectivitylte | ||
|
||
// | ||
// TestKeys for web_connectivity. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,18 +7,18 @@ package registry | |
// | ||
|
||
import ( | ||
"github.com/ooni/probe-cli/v3/internal/experiment/webconnectivity" | ||
"github.com/ooni/probe-cli/v3/internal/experiment/webconnectivitylte" | ||
"github.com/ooni/probe-cli/v3/internal/model" | ||
) | ||
|
||
func init() { | ||
AllExperiments["[email protected]"] = &Factory{ | ||
build: func(config any) model.ExperimentMeasurer { | ||
return webconnectivity.NewExperimentMeasurer( | ||
config.(*webconnectivity.Config), | ||
return webconnectivitylte.NewExperimentMeasurer( | ||
config.(*webconnectivitylte.Config), | ||
) | ||
}, | ||
config: &webconnectivity.Config{}, | ||
config: &webconnectivitylte.Config{}, | ||
interruptible: false, | ||
inputPolicy: model.InputOrQueryBackend, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
if [[ $# -ne 2 ]]; then | ||
echo "usage: $0 {name-before} {name-after}" 1>&2 | ||
exit 1 | ||
fi | ||
name_before=$1 | ||
shift | ||
name_after=$1 | ||
shift | ||
|
||
basename_before=$(basename $name_before) | ||
basename_after=$(basename $name_after) | ||
|
||
echo "git mv $name_before $name_after" | ||
git mv $name_before $name_after | ||
|
||
for file in $(find $name_after -type f -name \*.go); do | ||
echo "replacing the package name of $file" | ||
cat $file | sed -e "s|^package $basename_before|package $basename_after|g" \ | ||
-e "s|^// Package $basename_before|// Package $basename_after|g" > $file.tmp | ||
cat $file.tmp > $file | ||
rm $file.tmp | ||
done | ||
|
||
pkg_prefix=github.com/ooni/probe-cli/v3 | ||
pkg_before=$pkg_prefix/$name_before | ||
pkg_after=$pkg_prefix/$name_after | ||
|
||
for file in $(find . -type f -name \*.go); do | ||
echo "editing the import path of $file" | ||
cat $file | sed -e "s|\"$pkg_before\"|\"$pkg_after\"|g" > $file.tmp | ||
cat $file.tmp > $file | ||
rm $file.tmp | ||
done |