Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Git-it, Share it

Git-it, Share it

On building Git-it, a Node.js terminal app with real time server for GitHub learning GitHub and using time with new users to make GitHub better.

Jessica

May 22, 2014
Tweet

More Decks by Jessica

Other Decks in Programming

Transcript

  1. Git-it, Share it Building servers and tools to teach the

    Gits! Jessica Lord, GitHub github/jlord ! ⚡ #
  2. Wanted: GitHub hosted hack night Leave with your first pull

    request, shiny green contribution squares Late 2013
  3. GitHub Flow » GET GIT ! » REPOSITORY » COMMIT

    TO IT » GITHUBBIN » REMOTE CONTROL » FORKS AND CLONES » BRANCHES AREN'T JUST FOR BIRDS » IT'S A SMALL WORLD » PULL, NEVER OUT OF DATE » REQUESTING YOU PULL, PLEASE » MERGE TADA!
  4. But Git — Fork of `workshopper` that lets me run

    Git and requests in the background to verify user did the right thing. Is not JS, isn’t in files.
  5. $ Git-it git-it verify the! verify.js! for each challenge run

    Git in background hit GitHub API hit my server other things
  6. Git-it, checking user’s Git in verify.js: exec('git --version', function(err, stdout,

    stdrr) { var gitOutput = stdout.trim() if (gitOutput.match("git version")) console.log("Found Git installed.") else console.log("Found no Git installed.” }) Compare Git Expected/Actual
  7. git --config user.username jlord Useful Made up Thing So that

    I can always know a user’s GitHub name for which to make queries with! exec('git config user.username', function(e, so, se) { var user = stdout.trim() })
  8. Git-it to GitHub API Verify user set up GitHub account

    request(url + user + '.json', {json: true}, function (error, response, body) { if (error) return console.log(error) if (!error && response.statusCode == 200) { if (body.error) return console.log("GitHub account matching…”) else console.log("You're on GitHub!") } }) Use require(‘request’) directly from app
  9. A repo to fork GH Pages hosted site with the

    names of all who have completed the workshop. jlord/patchwork User submits name in Pull Request.
  10. No hooks on added as a collaborator :( reporobot.jlord.us/push #8:

    It’s a small world @reporobot account email with cloudmailin.com which sends JSON to server. {JSON}
  11. #8: It’s a small world Check if user added @reporobot

    as collaborator http://reporobot.jlord.us/collab?username= Git-it verify @reporobot, GitHub API permissions.push?
  12. Git-it sends request to @reporobot who hits the GitHub API

    to check for a PR, responds true/false #10: Request you pull http://reporobot.jlord.us/pr?username= Webhook on patchwork sends push on PR to @reporobot http://reporobot.jlord.us/orderin
  13. add name, date, ascii to contributors.json on server Rebuild Patchwork

    Site rebuilds /patchwork site @reporobot is a collaborator on jlord/patchwork @reporobot also a static site generator
  14. Node.js, GitHub API FTW email json requests in collab. check

    PR check requests out write ascii permission.push loop PRs comment PR merge PR push patchwork
  15. a little crazy Testing use test accounts and run through:

    create branch, create file (with ascii art), create PR. @reporobot is doing the writing which means each test account must have patchwork fork & RR as a collaborator. then delete it all & repeat.
  16. NUX Team NUX Team: designers, developers,! user research How can

    GitHub.com be easier, better for new users? What is being new to GitHub like? What tools can we make to help? Experiment!
  17. Share what you know Host an event! nodeschool.io/events Build a

    workshop! Mentor at an event! nodeschool.io/events Watch the GitHub blog - github.com/blog