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.

Bf47d3b9da3655bf19e815aaa5446d4a?s=128

Jessica

May 22, 2014
Tweet

Transcript

  1. 1.

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

    Gits! Jessica Lord, GitHub github/jlord ! ⚡ #
  2. 4.

    Wanted: GitHub hosted hack night Leave with your first pull

    request, shiny green contribution squares Late 2013
  3. 11.
  4. 12.

    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!
  5. 14.
  6. 16.

    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.
  7. 17.

    $ Git-it git-it verify the! verify.js! for each challenge run

    Git in background hit GitHub API hit my server other things
  8. 21.

    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
  9. 22.

    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() })
  10. 24.

    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
  11. 26.

    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.
  12. 27.
  13. 30.
  14. 32.

    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}
  15. 33.

    #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?
  16. 35.

    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
  17. 37.

    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
  18. 38.
  19. 39.

    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
  20. 40.

    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.
  21. 43.
  22. 44.

    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!
  23. 46.

    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