mirror of
https://github.com/status-im/sourcecred.git
synced 2025-01-19 09:03:54 +00:00
669f34d009
This commit adds a module, `fetchGithubOrg`, which loads data on GitHub organizations, most notably including the list of repositories in that org. The structure of this commit is heavily influenced by review feedback from @wchargin's [review] of a related PR. Test plan: This logic depends on actually hitting GitHub's API, so the tests are modeled off the related `fetchGithubRepo` module. There is a new shell test, `src/plugins/github/fetchGithubOrgTest.sh`, which verifies that that the org loading logic works via a snapshot. To verify the correctness of this commit, I've performed the following checks: - `yarn test --full` passes - inspection of `src/plugins/github/example/example-organization.json` confirms that the list of repositories matches the repos for the "sourcecred-test-organization" organization - manually breaking the snapshot (by removing a repo from the snapshot) causes `yarn test --full` to fail - running `src/plugins/github/fetchGithubOrgTest.sh -u` restores the snapshot, afterwhich `yarn test --full` passes again. [review]: https://github.com/sourcecred/sourcecred/pull/1089#pullrequestreview-204577637