engine, api: protype new check-in API #2445
Labels
enhancement
improving existing code or new feature
ooni/probe-engine
priority/low
testing
wontfix
when an issue won't be addressed (add a comment to the issue as to why this is the case)
We discussed with @FedericoCeratto improving the check-in API. We are going to create a prototype new API in the private namespace (
/api/_/check-in
) as an experiment to support developing the probe alongside it.We determined we need a new check-in API for the following reasons:
The new check-in API will now return the following response:
The two main changes between this new experimental data format and the previous format are:
options
specific to eachtarget
(to support richer input);nettests
is now a list of nettests to run as opposed to being just a dictionary (because the dictionary based format is possibly too rigid and binding, while the list seems more flexible in light of future, unforeseen changes).The data format with which we describe each nettest is the same we want to have for a OONI Run v2 version that supports running experiments along with richer input. In Go the new data format looks like:
The reason why we're using such a data format for nettests is that it describes a superset of the operations one could run from the command line using
miniooni
(themap[string]any
type used for options allows us to potentially include any type we could include for JSON, while usingjson.RawMessage
directly allows to use any data format used by JSON by it seems we need additional refactoring to use such a type directly).In addition to changing the data format, we would also need to (1) ensure we generate a ReportID for each possible experiment and (2) include proper input for any experiment requiring it. The former change ensures we can always use the check-in API to obtain a report ID and we never need to call the "open report" API again. The latter change ensures that we do not need to vendor experiment specific input inside of experiments.
While at it, it may also be a good place to clarify what the experiment input is: URL or string? It seems it's a URL in most cases, and we need to continue the conversation on this topic and collect more data.
This issue is part of ooni/ooni.org#1295 and ooni/ooni.org#1291.
The following list summarizes the changes we need to implement:
input
being a URL for experiments [answer: no];/api/_/check-in
with the desired data format;The text was updated successfully, but these errors were encountered: