$30 off During Our Annual Pro Sale. View Details »

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 Slide

  2. View Slide

  3. Search

    View Slide

  4. January 2013
    Search

    View Slide

  5. 4-9 months
    Search

    View Slide

  6. elasticsearch
    Search

    View Slide

  7. design
    Search

    View Slide

  8. @jonrohan
    @TwP

    View Slide

  9. @holman

    View Slide

  10. Planning

    View Slide

  11. We knew search sucked

    View Slide

  12. Start by talking about it

    View Slide

  13. View Slide

  14. 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 Slide

  15. Backend
    Two-person teams

    View Slide

  16. Two-person teams
    Frontend

    View Slide

  17. Building

    View Slide

  18. Okay, let’s build something

    View Slide

  19. BRANCHES

    View Slide

  20. git checkout -b search-next
    BRANCHES

    View Slide

  21. Really simple branching
    BRANCHES

    View Slide

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

    View Slide

  23. Push whenever; let others help
    BRANCHES

    View Slide

  24. No need for complicated forks
    BRANCHES

    View Slide

  25. COMMITS

    View Slide

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

    View Slide

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

    View Slide

  28. COMMITS

    View Slide

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

    View Slide

  30. Small, incremental commits
    COMMITS

    View Slide

  31. PULL REQUESTS

    View Slide

  32. Open a Pull Request
    PULL REQUESTS

    View Slide

  33. View Slide

  34. Sometimes we open pulls before code
    PULL REQUESTS

    View Slide

  35. PULL REQUESTS
    Sometimes we open pulls after code

    View Slide

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

    View Slide

  37. 130 commits 10 contributors
    2 months

    View Slide

  38. PULL REQUESTS
    Let your pulls evolve

    View Slide

  39. MENTIONS

    View Slide

  40. View Slide

  41. View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  45. TESTING

    View Slide

  46. TESTING
    Tests are kinda critical

    View Slide

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

    View Slide

  48. Build notifications

    View Slide

  49. TESTING
    Make it hard to ignore failures

    View Slide

  50. Shipping

    View Slide

  51. STAFF-SHIPPING
    Limit your exposure

    View Slide

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

    View Slide

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

    View Slide

  54. REDACTED

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  65. DEPLOYMENT

    View Slide

  66. DEPLOYMENT
    Deploying is scary; reduce surprises

    View Slide

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

    View Slide

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

    View Slide

  69. github/hubot

    View Slide

  70. DEPLOYMENT
    hubot deploy github

    View Slide

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

    View Slide

  72. DEPLOYMENT
    hubot deploy github/ship-search

    View Slide

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

    View Slide

  74. DEPLOYMENT
    hubot deploy github/master

    View Slide

  75.  CHATOPS

    View Slide

  76.  CHATOPS
    Chat’s important to us

    View Slide

  77. View Slide

  78.  CHATOPS
    Search didn’t need standup meetings

    View Slide

  79.  CHATOPS
    Chat is asynchronous and non-blocking

    View Slide

  80.  CHATOPS
    “Chatops”

    View Slide

  81.  CHATOPS
    Transparent way of handling ops

    View Slide

  82.  CHATOPS
    Search deployed, check perf

    View Slide

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

    View Slide

  84.  CHATOPS

    View Slide

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

    View Slide

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

    View Slide

  87.  CHATOPS
    Working over SSH is non-collaborative

    View Slide

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

    View Slide

  89. Maintaining

    View Slide

  90.  POST-SHIP

    View Slide

  91.  POST-SHIP
    Keep shipping

    View Slide

  92. View Slide

  93.  BUGS

    View Slide

  94.  BUGS
    Keep fixing

    View Slide

  95. View Slide

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

    View Slide

  97. Thanks.

    View Slide