sourcecred/scripts
Dandelion Mané fd95be68a9
Add class for fetching data from Discourse (#1265)
The `DiscourseFetcher` class abstracts over fetching from the Discourse
API, and post-processing and filtering the result into a form that's
convenient for us.

Testing is a bit tricky because the Discourse API keys are sensitive
(they are admin keys) and so I'm reluctant to commit them, even for our
test instance. As a workaround, I've added a shell script which
downloads some data from the SourceCred test instance, and saves it with
a filename which is an encoding of the actual endpoint. Then, in
testing, we can use a mocked fetch which actually hits the snapshots
directory, and thus validate the processing logic on "real" data from
the server. We also test that the fetch headers are set correctly, and
that we handle non-200 error codes appropriately.

Test plan: In addition to the included tests, I have an end-to-end test
which actually uses this fetcher to fully populate the mirror and then
generate a valid SourceCred graph.

This builds on API investigations
[here](https://github.com/sourcecred/sourcecred/issues/865#issuecomment-478026449),
and is general progress towards #865. Thanks to @erlend-sh, without whom
we wouldn't have a test instance.
2019-08-15 13:22:06 +02:00
..
build_static_site.sh change the world: track projects not repos 2019-07-23 01:01:09 +01:00
check-gnu-coreutils.sh Add helpful message when missing gnu-coreutils (#1034) 2019-01-05 12:20:07 -08:00
check-stopships.sh Permit STOPSHIPs in Markdown files (#573) 2018-07-31 10:58:29 -07:00
deploy.sh Include full projects on sourcecred.io (#1270) 2019-08-07 20:07:31 +02:00
ensure-flow.sh ensure-flow.sh: simplify, removing dep on GNU grep (#602) 2018-08-22 11:44:20 -07:00
update_snapshots.sh Add class for fetching data from Discourse (#1265) 2019-08-15 13:22:06 +02:00