It's useful to run the API locally for testing purposes. But, to make useful tests, we need real data to work with.
For example, in order for the backend processes to run, we need the uploads table. It's too onerous to require the user to mirror CPAN and run the upload backend process. To test some backend processes, we would need some rows from the test_reports table.
We should have a command, sync, that syncs data from a remote API server. It should take a URL, which is the API URL to request from the remote. It should make the request, and be able to map the data that comes back from the API into the correct CPAN::Testers::Schema ResultSet class to write to the local database.
The sync command should be in a module CPAN::Testers::API::Command::sync using the Mojolicious::Commands CLI framework.
In the future, we could create a sync --push that could take data in the local database and push it to the remote.
This functionality may be more useful in the CPAN::Testers::Schema project, so it can be shared with all CPAN::Testers projects.
It's useful to run the API locally for testing purposes. But, to make useful tests, we need real data to work with.
For example, in order for the backend processes to run, we need the
uploads
table. It's too onerous to require the user to mirror CPAN and run the upload backend process. To test some backend processes, we would need some rows from thetest_reports
table.We should have a command,
sync
, that syncs data from a remote API server. It should take a URL, which is the API URL to request from the remote. It should make the request, and be able to map the data that comes back from the API into the correct CPAN::Testers::Schema ResultSet class to write to the local database.The
sync
command should be in a moduleCPAN::Testers::API::Command::sync
using the Mojolicious::Commands CLI framework.In the future, we could create a
sync --push
that could take data in the local database and push it to the remote.This functionality may be more useful in the CPAN::Testers::Schema project, so it can be shared with all CPAN::Testers projects.