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

GitHub: Behind the Feature

GitHub: Behind the Feature

In the beginning of 2013, we shipped a new version of Search to GitHub.com. This talk takes a peek behind the scenes to illustrate how we build features at GitHub. It's a good beginner-level look at how startups work in teams together and deploy a product to the general public.

Zach Holman

March 28, 2013
Tweet

More Decks by Zach Holman

Other Decks in Programming

Transcript

  1. github
    Behind the Feature

    View full-size slide

  2. January 2013
    Search

    View full-size slide

  3. 4-9 months
    Search

    View full-size slide

  4. elasticsearch
    Search

    View full-size slide

  5. design
    Search

    View full-size slide

  6. @jonrohan
    @TwP

    View full-size slide

  7. We knew search sucked

    View full-size slide

  8. Start by talking about it

    View full-size slide

  9. From: [email protected]
    Subject: Search Results
    If you have a spare moment, go to github.com/search.
    These search pages need some lovin’
    in a bad, bad way.

    View full-size slide

  10. Backend
    Two-person teams

    View full-size slide

  11. Two-person teams
    Frontend

    View full-size slide

  12. Okay, let’s build something

    View full-size slide

  13. git checkout -b search-next
    BRANCHES

    View full-size slide

  14. Really simple branching
    BRANCHES

    View full-size slide

  15. Cut a branch from master
    BRANCHES
    (rarely from non-master branch)

    View full-size slide

  16. Push whenever; let others help
    BRANCHES

    View full-size slide

  17. No need for complicated forks
    BRANCHES

    View full-size slide

  18. git commit -m “Design Search”
    COMMITS

    View full-size slide

  19. git commit -m “:lipstick:”
    COMMITS

    View full-size slide

  20. We don’t rebase or
    do any fancy merge strategies
    COMMITS

    View full-size slide

  21. Small, incremental commits
    COMMITS

    View full-size slide

  22. PULL REQUESTS

    View full-size slide

  23. Open a Pull Request
    PULL REQUESTS

    View full-size slide

  24. Sometimes we open pulls before code
    PULL REQUESTS

    View full-size slide

  25. PULL REQUESTS
    Sometimes we open pulls after code

    View full-size slide

  26. PULL REQUESTS
    Sometimes pulls aren’t for merging

    View full-size slide

  27. 130 commits 10 contributors
    2 months

    View full-size slide

  28. PULL REQUESTS
    Let your pulls evolve

    View full-size slide

  29. MENTIONS
    Low-overhead way to ask for help

    View full-size slide

  30. MENTIONS
    Non-intrusive way to ask for help

    View full-size slide

  31. MENTIONS
    Feel good about a ship by
    mentioning the relevant team

    View full-size slide

  32. TESTING
    Tests are kinda critical

    View full-size slide

  33. TESTING
    Every commit we push triggers three builds:
    ruby 1.8
    ruby 1.9
    github enterprise

    View full-size slide

  34. Build notifications

    View full-size slide

  35. TESTING
    Make it hard to ignore failures

    View full-size slide

  36. STAFF-SHIPPING
    Limit your exposure

    View full-size slide

  37. STAFF-SHIPPING
    We have ~35 features staff-shipped

    View full-size slide

  38. STAFF-SHIPPING
    My GitHub looks different from yours:

    View full-size slide

  39. STAFF-SHIPPING
    Ranges from four-line config changes
    to entire feature redesigns

    View full-size slide

  40. STAFF-SHIPPING
    Coworkers are the only real beta testers

    View full-size slide

  41. STAFF-SHIPPING
    def search_enabled?
    current_user.staff?
    end
    master

    View full-size slide

  42. STAFF-SHIPPING
    def search_enabled?
    true
    end
    ship-search

    View full-size slide

  43. STAFF-SHIPPING
    No risky deploys;
    it’s already production-tested

    View full-size slide

  44. STAFF-SHIPPING
    Search’s design
    was staff-shipped for two months

    View full-size slide

  45. STAFF-SHIPPING
    Search’s backend
    was staff-shipped for four months

    View full-size slide

  46. STAFF-SHIPPING
    Gist 2.0
    was staff-shipped for a year

    View full-size slide

  47. STAFF-SHIPPING
    More real-world
    usage means fewer surprises

    View full-size slide

  48. STAFF-SHIPPING
    Shipping is scary; reduce surprises

    View full-size slide

  49. DEPLOYMENT

    View full-size slide

  50. DEPLOYMENT
    Deploying is scary; reduce surprises

    View full-size slide

  51. DEPLOYMENT
    Deploying to production involves 80
    servers and hundreds of Unicorn
    processes and magic and it’s a
    wonder this stuff works

    View full-size slide

  52. DEPLOYMENT
    We want it easy enough for a
    designer to deploy

    View full-size slide

  53. github/hubot

    View full-size slide

  54. DEPLOYMENT
    hubot deploy github

    View full-size slide

  55. DEPLOYMENT
    Hubot talks to an API that knows
    how to deploy every app

    View full-size slide

  56. DEPLOYMENT
    hubot deploy github/ship-search

    View full-size slide

  57. DEPLOYMENT
    Deploy a branch;
    rollback by deploying master

    View full-size slide

  58. DEPLOYMENT
    hubot deploy github/master

    View full-size slide

  59.  CHATOPS
    Chat’s important to us

    View full-size slide

  60.  CHATOPS
    Search didn’t need standup meetings

    View full-size slide

  61.  CHATOPS
    Chat is asynchronous and non-blocking

    View full-size slide

  62.  CHATOPS
    “Chatops”

    View full-size slide

  63.  CHATOPS
    Transparent way of handling ops

    View full-size slide

  64.  CHATOPS
    Search deployed, check perf

    View full-size slide

  65.  CHATOPS
    /graph me -1h substr(es-*_github.load)

    View full-size slide

  66.  CHATOPS
    load on es-storage15 is higher
    than the other storage nodes

    View full-size slide

  67.  CHATOPS
    let's let it go a bit- could just be due to
    relocating shards causing iowait

    View full-size slide

  68.  CHATOPS
    Working over SSH is non-collaborative

    View full-size slide

  69.  CHATOPS
    Makes it obvious what needs
    automation and tooling

    View full-size slide

  70.  POST-SHIP

    View full-size slide

  71.  POST-SHIP
    Keep shipping

    View full-size slide

  72.  BUGS
    Keep fixing

    View full-size slide

  73.  BUGS
    Don’t assume someone else will fix ‘em

    View full-size slide