GlowstoneMC/Glowstone — pull request #426 by dequis (2014-10-13 22:41:30+00:00)
Title: Add a script that fetches glowkit PRs for travis

Also reorganize .travis.yml slightly (actual build stuff goes in the script step, preparations go in the install step)

The script uses the github API to fetch the pull request body (which is needed to find the relevant PR links). Since the github api has very strict rate limits for unauthenticated users, I've included an [oauth personal access token][0] with scope for public repositories only. This means that compared to unauthenticated access, it's only useful to bypass the rate limit, but i'd still recommend using the travis encryption features, just in case. I'd like to revoke that access token as soon as testing is done. Also note that using the encryption features means the script won't work in other repos, but this isn't an issue since it's also hardcoded to fetch PRs from Glowstone/Glowstone and Glowstone/Glowkit.

Did some testing for it [here][1] and [here][2]. The commit labeled "TESTING SHIT" (now reverted) calls the script three times with hardcoded ids instead of `$TRAVIS_PULL_REQUEST`. These PRs are:

* #374 - no glowkit PRs required
* #402 - two PRs required, ignored by the script. The author of that PRs
* #413 - one PR required, detected correctly by the script and built successfully, but in the end the build fails because the glowstone side doesn't have the required changes. For the purposes of my script, this means it works.

[0]: https://github.com/settings/tokens/new
[1]: https://travis-ci.org/dequis/Glowstone/pull_requests
[2]: https://travis-ci.org/dequis/Glowstone/builds