効果的にGitHubを使うために

 効果的にGitHubを使うために

GitHub Constellation Tokyo
https://githubuniverse.com/constellation/

5df67047ff8dd67c1f3b7e0f9b48c2ee?s=128

Takafumi Ikeda

June 07, 2017
Tweet

Transcript

  1. Where software is built ޮՌతʹGitHubΛ࢖͏ͨΊʹ @ikeike443

  2. ! Where software is built Who am I? 2 a

    ikeike443
  3. # Where software is built # $ 3 TAKAFUMI IKEDA

    SOLUTIONS ENGINEER Who am I?
  4. Where software is built % Agenda 4 •͓٬༷ʹڞ௨͢Δ՝୊ •։ൃϑϩʔߏஙͷͨΊͷιϦϡʔγϣϯ •ҙ֎ͱ஌ΒΕ͍ͯͳ͍Tips

    •·ͱΊ %
  5. How people build software % ڞ௨͢Δ՝୊ 5 • OrgΛ෼͚͗͢ɺϓϩδΣΫτຖɺ෦ॺຖʹαΠϩԽ͍ͯ͠Δ •

    CI·Ͱख͕ճΒͳ͍ɺϏϧυखॱ͕ҰఆͰͳ͍ • Pull RequestΛ͏·͘࢖͑ͳ͍ɺϚʔδʹۤ࿑͢Δ • νʔϜͷशख़౓ʹ͹Β͖͕ͭ͋Δ • Φʔϓϯʹ͍͕ͨ͠ɺಉ࣌ʹ҆શੑ΋୲อ͍ͨ͠
  6. How people build software % ຊ೔͸ 6 • Org/Teamͷਖ਼͍͠࢖͍͜ͳ͠ํ •

    GitHub FlowͷԠ༻ɺपลػೳͷ࢖͍ํ • ͦͷଞɺϑϩʔߏஙʹ໾ཱͭҙ֎ͱ஌ΒΕ͍ͯͳ͍ػೳͷ঺հ
  7. How people build software OrganizationͱTeam ࠷ॳʹऔΓ૊Ή΂͖͸͜͜ 7 %

  8. How people build software % 8

  9. How people build software % 9

  10. How people build software % OrganizationΛ෼͚͗͢Δ 10 • Α͋͘Δࣄྫ: •

    ෦ॺ͝ͱʹOrgΛ෼͚Δʢ૊৫ߏ଄ͱҰகͤ͞Α͏ͱ͢Δʣ • ϓϩδΣΫτ͕࢝·ΔͨͼʹOrgΛ෼͚Δ • 200Ҏ্ͷOrg͕͋Δྫ΋
  11. How people build software % Org͕ଟ͍ͱى͖Δ໰୊ 11 • @mention͸OrgΛԣஅͯ͠ಧ͔ͳ͍ͨΊɺαΠϩԽ •

    ϝϯόʔ͕૿͑ΔͨͼʹOrg΁ͷ௥Ճ࡞ۀ͕ൃੜ
  12. How people build software % OrgΛগͳ͘ɺTeamΛଟ͘ 12 • OrgΛͰ͖ΔݶΓগͳ͘͠ɺݟ௨͠ΛΑ͘ •

    TeamΛ࢖ͬͯݖݶ؅ཧΛࡉ͘ઃఆ͢Δ͜ͱ • LDAP Team SyncΛ͏·͘࢖͍ɺϝϯς޻਺Λ࡟ݮ
  13. How people build software % OrgΛগͳ͘͢Δͱෆ҆ 13 • ಁ໌ԽʹΑΔϝϦοτͱɺෆҙͷ৘ใ࿙͍͑ͷؒͰ೰Ή

  14. How people build software % ಁ໌Խͷ༷ʑͳྫ 14 • ͢΂ͯΦʔϓϯ •

    GitHub.comΛ࢖ͬͨOSSӡӦ • ࣾ಺͸͢΂ͯΦʔϓϯɺࣾ֎ʹ͸Ϋϩʔζ • GitHub.com Business Plan Hosted • GHEʹͯPublic Modeӡ༻ • ࣾһʹ͸Φʔϓϯʹɺύʔτφʔʹ͸੍ݶΛೖΕ͍ͨ • ز͔ͭͷύλʔϯ
  15. How people build software % GitHubͰͰ͖Δݖݶ؅ཧ 15 • GHEͷPublic/Private Mode

    • GHEͷΈɺΠϯελϯεશମͷՄࢹੑΛઃఆՄೳ
  16. How people build software % GitHubͰͰ͖Δݖݶ؅ཧ 16 • OrgͷDefault Permission

    • ϝϯόʔͷσϑΥϧτݖݶʹ͍ͭͯ4ͭͷҟͳΔઃఆ͕Մೳ
  17. How people build software % ࣾһʹΦʔϓϯɺύʔτφʔʹ੍ݶ 17 • Α͋͘Δχʔζ •

    ࣾһͱύʔτφʔͰݖݶΛ෼͚͍ͨ • ύʔτφʔʹ͸ಛఆͷϦϙδτϦҎ֎͸Ұ੾Ӿཡ͢Βڐͨ͘͠ͳ͍
  18. How people build software % ࣾһʹΦʔϓϯɺύʔτφʔʹ੍ݶʢ̍ʣ 18 • OrgΛ෼͚Δ •

    OrgΛ෼͚ɺશϦϙδτϦΛPrivateʹ͢Δ • ࣾһͱύʔτφʔͰ࡞Δ΋ͷɺݟΔ΋ͷ͕׬શʹผͷ৔߹ʹ༗ޮ • ྆ऀͷίϥϘϨʔγϣϯΛॏࢹ͠ͳ͍έʔε
  19. How people build software % ࣾһʹΦʔϓϯɺύʔτφʔʹ੍ݶʢ̎ʣ 19 • ίϥϘϨʔλΛ͏·͘׆༻͢Δ •

    ࣾһ͚ͩͷOrgΛ࡞ΓɺύʔτφʔΛೖΕͳ͍ • ύʔτφʔͷڠྗ͕ඞཁͳϦϙδτϦʹରͯ͠͸ɺݸผʹίϥϘϨʔ λͱͯ͠௥Ճ
  20. How people build software % ࣾһʹΦʔϓϯɺύʔτφʔʹ੍ݶʢ̏ʣ 20 • OrgͷσϑΥϧτઃఆΛNoneʹ͢Δ •

    ࣾһ΋ύʔτφʔ΋ಉ͡Orgʹॴଐ͠ɺTeamͰ෼͚ΔΠϝʔδ • σϑΥϧτͰ͸Ұ੾PrivateϦϙδτϦΛݟΔ͜ͱ͕Ͱ͖ͳ͘ͳΔ • ύʔτφʔTeamΛݸผʹϦϙδτϦʹ௥Ճ͢Δ͜ͱͰݖݶ؅ཧ • ͨͩ͠ɺࣾһTeam΋ݸผʹ௥Ճ͢Δඞཁ͋Γɺগ͠൥ࡶ
  21. How people build software % Org/Team ·ͱΊ 21 • OrgΛগͳ͘ɺTeamΛଟ͘

    • @mention͸OrgΛ·ͨ͛ͳ͍ • OrgͷDefault Permission, Private ModeΛ࢖͍͜ͳ͢ • Outside Collaborator͸֎෦ύʔτʔφʔʹ࠷ద
  22. How people build software % Org/Team Tips 22 • TeamΛ૊৫ߏ଄ͱҰகͤ͞Δඞཁ͸ͳ͍

    • Java Specialists, Security, SQL, Managers, Designers, … • ઐ໳ੑ΍ؔ৺ࣄͰ౎౓άϧʔϐϯά͢Δ͜ͱ΋େม༗ޮ • See also: https://github.com/blog/2316-organize-your-experts-with-ad-hoc-teams
  23. How people build software % Org/Team Tips 23 • OrgΛू໿͢Δͱ

    • ϦϙδτϦͷ਺͕๲େʹͳΓ୳͢ͷ͕େมʁ
  24. How people build software % Org/Team Tips 24 • Topics

    • ϦϙδτϦͷλά෇͚͕Մೳɺݕࡧʹ΋࢖͑Δ • GHE͸2.10ΑΓ
  25. How people build software % Org/Team Tips 25 • Pinned

    Repositories • ୅දతͳϦϙδτϦ͸ઌ಄ʹషΓ෇͚͓͚ͯΔ
  26. How people build software % ໺ੜͷ Org/Team ྫ 26

  27. How people build software GitHub Flow ͢΂ͯͷجຊͰ͢ 27 %

  28. How people build software % GitHub Flow 28

  29. Create a Feature Branch

  30. Add commits

  31. Open a Pull Request

  32. Discuss and Review Code

  33. How people build software % ίʔυϨϏϡʔ 33

  34. % % hubot

  35. How people build software % Hubot 35

  36. How people build software % CI status Λ PR ʹ໭͢

    36
  37. Ship

  38. How people build software % Deployment API 38

  39. Merge with master

  40. How people build software % 40

  41. How people build software % Α͋͘Δޡղ 41 • ϚʔδલʹσϓϩΠͳΜͯͰ͖ͳ͍͔Βҧ͏ϑϩʔʹ •

    GitHub Flow͸Web։ൃҎ֎ʹ͸࢖͑ͳ͍ • Git-Flow͕େن໛։ൃʹ͸޲͍͍ͯΔ
  42. How people build software % ϙΠϯτ 42 • ੜଘظؒͷ௕͍ϒϥϯνΛݮΒ͢͜ͱ •

    ཧ૝తʹ͸MasterҰຊͷΈ • Pull Requestϒϥϯν͸Ͱ͖Δ͚ͩૣ͘Ϛʔδ͢Δ • ҰͭҰͭͷมߋΛখ͘͞ • ϑΟʔνϟʔϑϥάͳͲ΋༗ޮʹ࢖͏ • Ϛʔδͨ͠Β͙͢ʹফ͢
  43. How people build software % ෳ਺ͷϒϥϯν͕ඞཁ 43 • ͦΕͧΕͷϒϥϯνʹରͯ͠GitHub Flow͕Մೳ

    Open a Pull Request Open a Pull Request
  44. How people build software % ෳ਺ͷϒϥϯν͕ඞཁ 44 • ϒϥϯν͕ଟ͍΄ͲBack Portͷ਺͕૿͑ɺෳࡶԽ

    • ϒϥϯνΛݮΒ͢Α͏ʹ޻෉͢Δ͜ͱ͕ॏཁ
  45. How people build software % λάͰ୅ସͰ͖ͳ͍͔ߟ͑ͯΈΔ 45 • ग़ՙόʔδϣϯɺίʔυϑϦʔζɺQAظ͕ؒඞཁͰ͋Ε͹ɺλάͰ୅ସͰ͖ͳ͍͔ •

    ඞཁ͕ੜͨ͡ͱ͖ͷΈϒϥϯνΛ࡞ΓɺऴΘͬͨΒফ͢ • ͜͜Ͱ΋ෳ਺όʔδϣϯ͕ಉ࣌ʹଘࡏ͢ΔͱෳࡶʹͳΔ͜ͱʹ஫ҙ v0.1.pre v0.1.pre.2 v0.1 v0.2.pre
  46. How people build software % GitHub Flow·ͱΊ 46 • GitHub

    Flow͸Ԡ༻Մೳ • ௕ظؒϒϥϯνͷ਺ΛͰ͖Δ͚ͩݮΒ͢ • λάΛ༗ޮ׆༻͢Δ
  47. How people build software Pull Requestपลͷศརͳػೳ ͞·͟·ͳϫʔΫϑϩʔΛՄೳʹ 47 %

  48. How people build software % ศརͳػೳ 48 • Revert •

    Blame • Update Branch • Conflictͷղফ • ֤छϚʔδΦϓγϣϯ • ForkઌͷฤूڐՄ • etc
  49. How people build software % Revert 49

  50. how software is built % Revert 50 ೔ຊޠԽͨ͠ ςετ΋मਖ਼ ؔ܎ͷͳ͍मਖ਼

    REVERT Pull Request Pull Request͕ؔ࿈͢ΔίϛοτΛ஌͍ͬͯΔ
  51. how software is built % Blame 51

  52. the best way to build and ship software % 52

    Web UI͔ΒͷConflictղফ
  53. How people build software Protected Branches ॊೈ͔ͭηΩϡΞͳϫʔΫϑϩʔߏஙΛՄೳʹ 53 %

  54. How people build software % Protected Branches 54 • ༷ʑͳܗͰϒϥϯνΛอޢ

    • Delete, Push -f ͷېࢭ • ϨϏϡʔͷඞਢԽ • CIͳͲεςʔλενΣοΫ • ϚʔδՄೳͳਓ/TeamΛ੍ݶ
  55. How people build software ͦͷଞͷศརػೳ ࡉ͔͗ͯ͢఻ΘΒͳ͍ػೳ 55 %

  56. How people build software % ҙ֎ͱ஌ΒΕ͍ͯͳ͍ػೳ܈ 56 • Release •

    Pre-Receive Hooks (GHE Only) • ͞·͟·ͳRenderingΦϓγϣϯ • SVN Bridge • git-import
  57. How people build software % Release 57 • Tagʹؔ࿈෇͚ͯΞηοτ΍ςΩετΛ؅ཧͰ͖Δ

  58. How people build software % Pre Receive Hooks 58 •

    GHE only͕ͩɺαʔόαΠυͷPre Receive Hook͕ॻ͚Δ • ৘ใ࿙͍͑νΣοΫɺPGP伴ͷνΣοΫͳͲͳͲʹ • ηΩϡϦςΟ্ͷݒ೦Λ༧๷తʹνΣοΫͰ͖Δ • ࣗ෼ͷ޷͖ͳϥΠϒϥϦɺݴޠΛΠϯετʔϧՄೳ • Chroot, DockerରԠ • جຊతʹ͸ͳΜͰ΋Ͱ͖ΔͷͰӡ༻ʹ͸஫ҙ͕ඞཁ
  59. How people build software % ༷ʑͳϨϯμϦϯά 59 • ը૾ •

    PDF • GeoJson • Jupyternootbook • STL • CSV/TSV • Markdown • etc
  60. How people build software % ༷ʑͳϨϯμϦϯά: STL 60

  61. How people build software % ༷ʑͳϨϯμϦϯά: CSV/TSV 61

  62. How people build software % SVN Bridge 62 • GitHubͷΫϥΠΞϯτͱͯ͠SVNΛར༻Մೳ

  63. How people build software % git-import 63 • ༷ʑͳVCS͔ΒͷҠߦΛαϙʔτ

  64. How people build software % ·ͱΊ 64 • Org/TeamΛ஌Γɺ্खʹ࢖͍͜ͳͦ͏ •

    GitHub Flow͸༷ʑͳܗͰԠ༻Մೳ • Protected BranchesΛ࢝ΊɺػೳΛ஌Γɺ։ൃϑϩʔΛߏங͠Α͏ • ࢼߦࡨޡ͠ɺࣗ͝਎ʹͱͬͯͷ࠷దղΛݟग़ͦ͏
  65. How people build software Thank you!

  66. How people build software Questions?