sing all you hubbers happy birthday especially with this great audio setup we got here but I better spare you my singing voice :D I just want to say congratulations to all the hubbers here tonight, we see and love all the hard work you are doing, we celebrate the ups and suffer with you trough the downs. Here is to the next 10 years! Congratulations! HAPPY BIRTHDAY! github.com/ten @gr2m | GitHub Constellation LA 2018
is maintained by GitHubbers. .net which is maintained by a community maintainer: Ryan Gribble and now JavaScript. Platform toolkit as in Libraries @gr2m | GitHub Constellation LA 2018
the other languages we try to make it reflect the idioms and conventions of its community. In the case of JavaScript it means that it must run in both Node.js and the browser, itʼs modular and we are watching its bundle size as part of the CI octokit/rest.js // Browser: <script scr="octokit-rest.min.js"></script> // Node: const Octokit = require('@octokit/rest') const octokit = new Octokit() const repos = await octokit.repos.getForOrg({ org: 'octokit', type: 'public' }) @gr2m | GitHub Constellation LA 2018
to handle webhooks. You can load the event handler API client to use it with your server framework of preference or load it as middleware that you can pass into the native http server. octokit/webhooks.js const Webhooks = require('@octokit/webhooks') const {createServer} = require('http') const webhooks = new Webhooks({ secret: 'mysecret' }) webhooks.on('issues', ({id, name, payload}) => { if (payload.action === 'created') { console.log(`New issue ${payload.issue.title}`) } }) createServer(webhooks.middleware).listen(3000) @gr2m | GitHub Constellation LA 2018
also working on tools for OAuth (both client and server), a GraphQL client and a low-level that helps with GitHub Apps. To build actual GitHub apps you can use Probot, which is not part of Octokit but is using it internally. Probot is an independent Open Source project, initiated as a side project by Brandon Keepers. Here you can see the source code for the work in progress app. In less than 20 lines of code, it checks if a pull request has "WIP" in its title and sets the pull request status accordingly. Itʼs also a great segue because JavaScript Octokit is very much work Probot module.exports = (robot)= > { robot.on([ 'pull_request.opened', 'pull_request.edited' ], ({github, payload, repo}) => { const {title, head} = payload.pull_request const isWip = /\bwip\b/i.test(title) github.repos.createStatus(repo({ sha: head.sha, state: isWip ? 'pending' : 'success', description: isWip ? 'work in progress – do not merge!' : 'ready for review', context: 'WIP' })) }) } @gr2m | GitHub Constellation LA 2018
nearly two decades now. Iʼm maintaining or contributing to some JavaScript and Node.js ecosystem projects, for http mocking, automated releases, Greenkeeper (which is automated dependency updates) and Probot, the GitHub App framework that I used to build the work in progress app shown before. Probot is an independent Open Source project, started by GitHubbers, but with many outside contributors. It's hands down the best way to build GitHub apps today and Zeke will show you some more of it today And what is special is that I am not a GitHub employee, but hired as an outside contractor. Gregor Martynus » Maintainer of Octokit.js » JS ecosystem tooling Maintainer/Contributor: » nock (Mocking) » semantic-release » Greenkeeper (Updates) » Probot (GitHub App Framework) » Not a GitHub employee @gr2m | GitHub Constellation LA 2018
I feel your pain. Because just as you, I can only use what is publicly accessible. And everything I do is publicly accessible, not only the result, but everything, the entire process. It also means that you can contribute to accelerate the bits that you care about. I personally care a lot about inclusive, welcoming Open Source communities and working on Octokit gives me not only the opportunity to work on very interesting technology but also make it in a way that allows for outside participation. So if you never contributed to Open Source before or just enjoy working on other projects from time to time, hit me up, Iʼm happy to walk you trough. no shortcuts. open source. @gr2m | GitHub Constellation LA 2018
using the GitHub API, or any external service really, is to create integration tests. You cannot test against the real API so you rely on http mocks. And http mocks have the problem of getting out of date, and what happens then is all your tests pass but your app or service breaks when in production. Iʼm sure that GitHub has tons and tons of mocks in their internal tooling but as mentioned before, I donʼt have access to that. But building a REST API client, I rely heavily on mocks so I created my own Platform toolkit as in HTTP MOCKS @gr2m | GitHub Constellation LA 2018
out of date because we have a daily cron job that records new fixuters, normalizes them and compares them to the existing ones. If there are any changes we recive a pull request. And once merged a new version of the fixtures is released automatically using semantic-release. @gr2m | GitHub Constellation LA 2018
server which we also continously deploy, so you donʼt even need to setup anything and can test against it directly. @gr2m | GitHub Constellation LA 2018
it with npm. If donʼt use Node.js, then you can download it as a single binary for Linux, Windows or Mac, too. With the auto-updating fixtures, we can guarantee that Octokit REST libraries are always working with the latest REST API. And as a nice side effect we caught a few accidental API changes by GitHub that have been resolved before most users realised. npm install @octokit/fixtures npm install @octokit/fixtures-server @gr2m | GitHub Constellation LA 2018
is documentation. GraphQL is less affected by this as the API documentation is part of the specification, but REST API client documentation are notorously affected by it, unless they are generated by the source code. We donʼt have the source code so we did something else Platform toolkit as in Documentation @gr2m | GitHub Constellation LA 2018
up-to-date specification of GitHubʼs REST API. And it is a script that runs on a daily cronjob, which scrapes the entire GitHub REST API documentation and transforms it into the a big JSON file. @gr2m | GitHub Constellation LA 2018