* 1557048: Add reason codes to the metrics ping
This adds support for sending reason codes along with pings. The reason codes
are defined as an enumeration in the pings.yaml file, and only these values
are allowed on specific pings.
Additionally, this builds on that to add reason codes to the metrics ping.
* Use short form for enums
* Suppress compiler warning
* swiftlint
* NoReasonCodes -> NoExtraKeys
* Fix descriptions
This is the first part of the effort to move ping uploading logic,
as much as possible, to glean-core.
In this commit, a new `upload` module is created in rust,
with the following features:
* Sweep the pending pings directory (off main thread, on init)
and create a `PingRequest` object from each valid file in there;
* Manage a queue of pending `PingRequest`s,
enqueueing all swept `PingRequest`s on startup and
exposing functionality to enqueue a new PingRequest on demand,
dequeue the first in line and clear the whole queue.
This module is not exposed on the Glean or FFI object yet.
It might not have been initialized, but the reset functions handle that.
Once all data is cleared, destroy the handle.
Individual tests will start Glean if necessary.
Previously the MetricsPingSchedulerTest would hang when run in isolation.
This changes CI in the following ways:
* iOS jobs (build, test and integration test) become manual-approval-required on PRs
* That means the expensive job is not even run unless someone does so
manually
* iOS jobs are still run by default on master merges
Due to how CircleCI works the iOS tests become their own workflow on PRs,
but must be in the ci workflow on master merges (so that the doc deploy can depend on it).
The default test target runs both testDebugUnitTest and testReleaseUnitTest, effectively running everything twice.
This seems like a waste of resources (and time) and just running it once seems fine.
Now we could decide to run testReleaseUnitTest on CI, but testDebugUnitTest for developer machines.
Coverage reports by now are merely a noise, take extra CI time and we
ran into some problems before generating them.
This also allows us to drop the one usage of a "xlarge" instance on CircleCI.
Because glean_preview is a global-singleton, we need to run the tests one-by-one to avoid different tests stomping over each other.
This is only an issue because we're resetting Glean, this cannot happen in normal use of glean-preview.
We use a global lock to force synchronization of all tests, even if run multi-threaded.
This allows us to run without `--test-threads 1`.`