-
Notifications
You must be signed in to change notification settings - Fork 142
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
engine: merge into the cli repository #1335
Comments
The first problem I identified is the way in which
This was happening because the import path The first step to fix this issue has been to tag v0.4.0. This is what happens now:
This is quite an improvement. The binary we build fails and tells us what import path we should be using. (I can further improve that by listing the correct command to build and the full import path, but you get the idea.) A second improvement is to make sure we can use a recent version of Go to build the correct binary. I implemented this change in ooni/probe-cli#200. This is what we can do now:
Here I needed to force BTW, of the two options available for releasing v2-or-higher Go modules, I chose the easier one. Just change |
This is how I did it: 1. `git clone https://github.com/ooni/probe-engine internal/engine` 2. ``` (cd internal/engine && git describe --tags) v0.23.0 ``` 3. `nvim go.mod` (merging `go.mod` with `internal/engine/go.mod` 4. `rm -rf internal/.git internal/engine/go.{mod,sum}` 5. `git add internal/engine` 6. `find . -type f -name \*.go -exec sed -i 's@/ooni/probe-engine@/ooni/probe-cli/v3/internal/engine@g' {} \;` 7. `go build ./...` (passes) 8. `go test -race ./...` (temporary failure on RiseupVPN) 9. `go mod tidy` 10. this commit message Once this piece of work is done, we can build a new version of `ooniprobe` that is using `internal/engine` directly. We need to do more work to ensure all the other functionality in `probe-engine` (e.g. making mobile packages) are still WAI. Part of ooni/probe#1335
Now, the second step (ooni/probe-cli#201) is that of putting the |
This is how I did it: 1. `git clone https://github.com/ooni/probe-engine internal/engine` 2. ``` (cd internal/engine && git describe --tags) v0.23.0 ``` 3. `nvim go.mod` (merging `go.mod` with `internal/engine/go.mod` 4. `rm -rf internal/.git internal/engine/go.{mod,sum}` 5. `git add internal/engine` 6. `find . -type f -name \*.go -exec sed -i 's@/ooni/probe-engine@/ooni/probe-cli/v3/internal/engine@g' {} \;` 7. `go build ./...` (passes) 8. `go test -race ./...` (temporary failure on RiseupVPN) 9. `go mod tidy` 10. this commit message Once this piece of work is done, we can build a new version of `ooniprobe` that is using `internal/engine` directly. We need to do more work to ensure all the other functionality in `probe-engine` (e.g. making mobile packages) are still WAI. Part of ooni/probe#1335
Now, my task is to figure out which tests are failing and why. Exciting times 😬. This work has now been done here: ooni/probe-cli#202. (For the records, the problem here is that some We're basically down to the same amount of failures we see in probe-engine. |
* fix: add missing files causing tests to fail See ooni/probe#1335 (comment) * fix: toggle verbose so we better understand the tests output
Of course, also move the specific test checking whether we are still able of building miniooni. Part of ooni/probe#1335
In ooni/probe-cli#203 we're adding support for building miniooni from probe-cli. |
* refactor: build miniooni from toplevel Of course, also move the specific test checking whether we are still able of building miniooni. Part of ooni/probe#1335 * build for current branch just to confirm * fix: correct the path where linux/arm binary is * okay, it works, we can remove the special rule
This diff is part of ooni/probe#1335. We are moving more probe-engine workflows to toplevel. The general idea here is to migrate all possible workflows and to delete the ones that we cannot use in this repo (if any).
In ooni/probe-cli#204 I'm migrating probe-engine workflows to probe-cli. |
This diff is part of ooni/probe#1335. We are moving more probe-engine workflows to toplevel. The general idea here is to migrate all possible workflows and to delete the ones that we cannot use in this repo (if any).
Part of ooni/probe#1335. This seems also a good moment to move some packages out of the engine, e.g., oonimkall. This package, for example, is a consumer of the engine, so it makes sense it's not _inside_ it.
The next step is automatically publishing an Android package. We're working on this in ooni/probe-cli#205. |
* refactor: start building an Android package Part of ooni/probe#1335. This seems also a good moment to move some packages out of the engine, e.g., oonimkall. This package, for example, is a consumer of the engine, so it makes sense it's not _inside_ it. * fix: committed some stuff I didn't need to commit * fix: oonimkall needs to be public to build The side effect is that we will probably need to bump the major version number every time we change one of these APIs. (We can also of course choose to violate the basic guidelines of Go software, but I believe this is bad form.) I have no problem in bumping the major quite frequently and in any case this monorepo solution is convinving me more than continuing to keep a split between engine and cli. The need to embed assets to make the probe more reliable trumps the negative effects of having to ~frequently bump major because we expose a public API. * fix: let's not forget about libooniffi Honestly, I don't know what to do with this library. I added it to provide a drop in replacement for MK but I have no idea whether it's used and useful. I would not feel comfortable exposing it, unlike oonimkall, since we're not using it. It may be that the right thing to do here is just to delete the package and reduce the amount of code we're maintaining? * woops, we're still missing the publish android script * fix(publish-android.bash): add proper API key * ouch fix another place where the name changed
This is part of ooni/probe#1335. We also need to think whether we wanna keep libminiooni and miniooni separated. The previous use case for having a top-level libminiooni was that of enabling others to integrate miniooni into other binaries. This was usegul when studying internet censorship in Spain in May 2020. I am wondering whether we should be keeping this complexity. I am not sure about this and probably we should be killing it. (In any case, reducing complexity is not the objective of this diff, since I would like instead to move things around with minimal changes and make sure we have a ~good repository organization here.)
More refactoring underway in ooni/probe-cli#206. It's a set of minor changes and movements after we merged the two codebases. This is ~easy and quite useful to help me identify optional complexity to kill. |
* doc: ensure all top dirs have an explanatory README This makes the repository a lil bit nicer to newcomers. Part of ooni/probe#1335 * fix: re-run bindata to embed the README The readme is small, so we can pay the price of adding it. On a related note, I am very pleased the Go team implemented the `//go:embed` feature, so we can get rid of this bindata thing.
* doc: merge the engine and the cli readmes Part of ooni/probe#1335 * refactor: we don't wanna export pkg/oonimkall/tasks See ooni/probe#1335
The merge is complete. We can now continue working on the engine inside of |
This is how I did it: 1. `git clone https://github.com/ooni/probe-engine internal/engine` 2. ``` (cd internal/engine && git describe --tags) v0.23.0 ``` 3. `nvim go.mod` (merging `go.mod` with `internal/engine/go.mod` 4. `rm -rf internal/.git internal/engine/go.{mod,sum}` 5. `git add internal/engine` 6. `find . -type f -name \*.go -exec sed -i 's@/ooni/probe-engine@/ooni/probe-cli/v3/internal/engine@g' {} \;` 7. `go build ./...` (passes) 8. `go test -race ./...` (temporary failure on RiseupVPN) 9. `go mod tidy` 10. this commit message Once this piece of work is done, we can build a new version of `ooniprobe` that is using `internal/engine` directly. We need to do more work to ensure all the other functionality in `probe-engine` (e.g. making mobile packages) are still WAI. Part of ooni/probe#1335
* fix: add missing files causing tests to fail See ooni/probe#1335 (comment) * fix: toggle verbose so we better understand the tests output
* refactor: build miniooni from toplevel Of course, also move the specific test checking whether we are still able of building miniooni. Part of ooni/probe#1335 * build for current branch just to confirm * fix: correct the path where linux/arm binary is * okay, it works, we can remove the special rule
This diff is part of ooni/probe#1335. We are moving more probe-engine workflows to toplevel. The general idea here is to migrate all possible workflows and to delete the ones that we cannot use in this repo (if any).
* refactor: start building an Android package Part of ooni/probe#1335. This seems also a good moment to move some packages out of the engine, e.g., oonimkall. This package, for example, is a consumer of the engine, so it makes sense it's not _inside_ it. * fix: committed some stuff I didn't need to commit * fix: oonimkall needs to be public to build The side effect is that we will probably need to bump the major version number every time we change one of these APIs. (We can also of course choose to violate the basic guidelines of Go software, but I believe this is bad form.) I have no problem in bumping the major quite frequently and in any case this monorepo solution is convinving me more than continuing to keep a split between engine and cli. The need to embed assets to make the probe more reliable trumps the negative effects of having to ~frequently bump major because we expose a public API. * fix: let's not forget about libooniffi Honestly, I don't know what to do with this library. I added it to provide a drop in replacement for MK but I have no idea whether it's used and useful. I would not feel comfortable exposing it, unlike oonimkall, since we're not using it. It may be that the right thing to do here is just to delete the package and reduce the amount of code we're maintaining? * woops, we're still missing the publish android script * fix(publish-android.bash): add proper API key * ouch fix another place where the name changed
* refactor: miniooni should be outside of the engine This is part of ooni/probe#1335. We also need to think whether we wanna keep libminiooni and miniooni separated. The previous use case for having a top-level libminiooni was that of enabling others to integrate miniooni into other binaries. This was usegul when studying internet censorship in Spain in May 2020. I am wondering whether we should be keeping this complexity. I am not sure about this and probably we should be killing it. (In any case, reducing complexity is not the objective of this diff, since I would like instead to move things around with minimal changes and make sure we have a ~good repository organization here.) * fix: import in libminiooni
* refactor: move more commands to internal/cmd Part of ooni/probe#1335. We would like all commands to be at the same level of engine rather than inside engine (now that we can do it). * fix: update .gitignore * refactor: also move jafar outside engine * We should be good now?
* refactor: enable QA tests and jafar self test Part of ooni/probe#1335 * chore: make sure all workflows run on release branches
* refactor: enable automatic iOS builds Part of ooni/probe#1335 * fix: go mod tidy
* chore: remove duplicate code of conduct * chore: remove AUTHORS file I doubt this actually has any value in the era of GitHub. * chore: move CODEOWNERS to toplevel * chore: move CONTRIBUTING.md to toplevel and adapt it * chore: remove duplicated LICENSE file * chore(engine): remove now-obsolete design document * chore: remove the testusing test We're not going to make this code importable from third parties like we did for probe-engine. It seems this feature was only used for the experiment in Spain so it makes sense to drop it. * chore: enable code generation tests See ooni/probe#1335 * chore: enable code-ql checks * cleanup: remove libooniffi code and tests It seems this code is not used. We are not aware of anyone using it. And we don't want to expose it publicly as an API. So, what to do? I guess it's fine to delete it. If there is anyone that needs it, we have in the history a reference to it and we can always reinstate it. * chore: move issue templates to ooni/probe
Part of ooni/probe#1335. Tracked also by ooni/probe#1338.
Part of ooni/probe#1335. Motivation: we want all workflows to be green only when we are approaching a release. It's fine if some less core tests are failing during the development process. We have daily builds anyway so we know of new breakages the day after, which is OK.
* doc: ensure all top dirs have an explanatory README This makes the repository a lil bit nicer to newcomers. Part of ooni/probe#1335 * fix: re-run bindata to embed the README The readme is small, so we can pay the price of adding it. On a related note, I am very pleased the Go team implemented the `//go:embed` feature, so we can get rid of this bindata thing.
* doc: merge the engine and the cli readmes Part of ooni/probe#1335 * refactor: we don't wanna export pkg/oonimkall/tasks See ooni/probe#1335
This diff includes some cleanups while we finish moving packages away from the internal/engine package. With this diff, we have finally finished merging probe-engine into probe-cli, a process initiated in February 2021. See ooni/probe#1335. Closes ooni/probe#2115.
This diff includes some cleanups while we finish moving packages away from the internal/engine package. With this diff, we have finally finished merging probe-engine into probe-cli, a process initiated in February 2021. See ooni/probe#1335. Closes ooni/probe#2115.
We are going to use Go 1.16's new feature that enables embedding assets. To this end, it would greatly simplify our life to have a single Go repository containing all the sources. This issue is about merging the
cli
and theengine
repositories.We could merge the
cli
into theengine
, or theengine
into thecli
. Since thecli
is tagging publicly available version numbers we will merge theengine
into thecli
.Because of Go strict semantic versioning rules, we cannot export anything from the
engine
into the new repository, otherwise, we will need to break the import path at basically every new release ofooniprobe
.Therefore, we will basically vendor the engine codebase inside
internal/engine
. We still to hammer out a bunch of details including what to do of the existingengine
repository, etc.The text was updated successfully, but these errors were encountered: