Skip to content
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

refactor: move Saver, Submitter, and InputProcessor to oonirun #1543

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

bassosimone
Copy link
Contributor

My current objective is to cleanup and rationalize the engine package such that it is more explicit how we're using probeservices APIs.

In performing this task, I noticed that Saver and InputProcessor are only ever used by the oonirun package.

This happens because:

  1. the Saver is just a tiny wrapper around SaveMeasurement that constructs either a model.Saver or a fake one depending on the configuration, which seems a pretty specific use case of oonirun given the current API we're using;

  2. we can same basically the same for the Submitter;

  3. the InputProcessor, albeit nice, is probably not flexible enough to be used elsewhere unless we hammer it a lot.

Additionally, in the future, ./cmd/ooniprobe should probably be based on oonirun, and possibly also ./pkg/oonimkall.

Also, ./internal/cmd/miniooni is already based on oonirun.

To conclude, oonirun should be the focus of future work and changes, while the functionality I'm moving here, could either be in engine or oonirun. But my current goal is to focus on the engine, so it's fine to move these types.

Part of ooni/probe#2700

My current objective is to cleanup and rationalize the engine package
such that it is more explicit how we're using probeservices APIs.

In performing this task, I noticed that Saver and InputProcessor are
only ever used by the oonirun package.

This happens because:

1. the Saver is just a tiny wrapper around SaveMeasurement that
constructs either a model.Saver or a fake one depending on the
configuration, which seems a pretty specific use case of oonirun
given the current API we're using;

2. we can same basically the same for the Submitter;

3. the InputProcessor, albeit nice, is probably not flexible
enough to be used elsewhere unless we hammer it a lot.

Additionally, in the future, ./cmd/ooniprobe should probably be
based on oonirun, and possibly also ./pkg/oonimkall.

Also, ./internal/cmd/miniooni is already based on oonirun.

To conclude, oonirun should be the focus of future work and
changes, while the functionality I'm moving here, could either
be in engine or oonirun. But my current goal is to focus on
the engine, so it's fine to move these types.

Part of ooni/probe#2700
@bassosimone bassosimone merged commit 75c36e6 into master Apr 4, 2024
26 checks passed
@bassosimone bassosimone deleted the issue/2700e branch April 4, 2024 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant