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

APIを利用して、生産性を生み出す技術

 APIを利用して、生産性を生み出す技術

話手の所属するGMOペパボはコミュニケーションツールはSlack、業務やソースコードの管理をエンジニア〜バックオフィス職種問わず、すべてGithub Enterprise(GHE)で行っています。そんなGMOペパボにおけるAPIを利用した業務Hackやチーム開発のノウハウを紹介し、半分くらいは僕の半生についてお話します。

Kazuhiko Yamashita

April 16, 2018
Tweet

More Decks by Kazuhiko Yamashita

Other Decks in Programming

Transcript

  1. ʙय़ͷখ઒ͷͤͤΒ͗ͱɺγΣϑͷؾ·͙ΕιʔεΛఴ͑ͯʙ
    !QZBNB(.01FQBCP *OD
    (FFLT8IP%SJOL1VCMJD"1*&EJUJPO
    "1*Λར༻ͯ͠
    ੜ࢈ੑΛੜΈग़ٕ͢ज़

    View full-size slide

  2. ϗεςΟϯάࣄۀ෦νʔϑςΫχΧϧϦʔυ

    ࢁԼ࿨඙!QZBNB

    View full-size slide

  3. ੜ࢈ੑʹόϦϡʔ͔͚ͨ࣌ؒ

    View full-size slide

  4. QZBNBͷҰ೔
    ಡॻ044
    ձ৯
    5XJUUFS
    ίʔυॻ͘
    5XJUUFS
    .5(
    ϥϯν
    4MBDLϨϏϡʔ
    ελʔόοΫεͰ5XJUUFS
    δϣΪϯά
    ਭ຾
    ਭ຾
    δϣΪϯά
    ελʔόοΫεͰ5XJUUFS
    4MBDLϨϏϡʔ
    ϥϯν
    .5(
    5XJUUFS
    ίʔυॻ͘
    5XJUUFS
    ձ৯
    ಡॻ044

    View full-size slide

  5. QZBNBͷҰ೔
    ಡॻ044
    ձ৯
    5XJUUFS
    ίʔυॻ͘
    5XJUUFS
    .5(
    ϥϯν
    4MBDLϨϏϡʔ
    ελʔόοΫεͰ5XJUUFS
    δϣΪϯά
    ਭ຾
    ਭ຾
    δϣΪϯά
    ελʔόοΫεͰ5XJUUFS
    4MBDLϨϏϡʔ
    ϥϯν
    .5(
    5XJUUFS
    ίʔυॻ͘
    5XJUUFS
    ձ৯
    ಡॻ044

    View full-size slide

  6. ੜ࢈ੑΛ্͛ΔͨΊʹɺࠓ೔࿩͢͜ͱ
    w(JUIVC"1*ͷ͋Ε
    w4MBDL"1*ͷ͋Ε
    w๻ͷ༮গظͷՄѪ͔ͬͨ͜Ζ࿩

    View full-size slide

  7. ιʔεϨϏϡʔΛఆظԽ͢Δ
    DPEFS
    SFWJFXFS SFWJFXFS
    1VMM3FRVFTU
    -(5. .BZUIF'PSDFCFXJUIZPV
    QSPEVDUJPO
    3FMFBTF
    ϖύϘͷϦϦʔεϑϩʔ

    View full-size slide

  8. ϨϏϡʔґཔ͸ׂΓࠐΈͰ͋Δ
    wϑϩʔঢ়ଶʹੜ࢈ੑͷߴ͍ঢ়ଶͰ͋Δ
    wϨϏϡʔґཔʹࣗ෼ͷҙਤ͠ͳׂ͍ΓࠐΈλεΫ

    View full-size slide

  9. ׂΓࠐΈΛܭը͞Εͨ΋ͷʹ͢Δ
    wνʔϜ͝ͱʹ࣌ࠁΛఆΊɺϨϏϡʔΛఆظԽ͢Δ

    View full-size slide

  10. ίʔυॻ͍ͯɺϥϕϧ͚ͭΕ͹ɺ͋ͱ͸5XJUUFS͠์୊
    w ༧ΊνʔϜͰఆΊͨϥϕϧΛ΋ͱʹ
    w "1*Ͱݕࡧͯ͠ɺࣗಈ௨஌͢Δ

    View full-size slide

  11. 0DUPLJUͰ(JUIVC"1*Λѻ͏
    repo = “example”
    label = “needs review”
    client = Octokit::Client.new(
    access_token: ENV[‘GITHUB_TOKEN'],
    )
    issues = client.issues(repo, labels: label)
    w IUUQPDUPLJUHJUIVCJP

    View full-size slide

  12. (JUIVC"1*Λར༻ͨ͠ྫ
    wධՁࢿྉ
    GVSJL IUUQTHJUIVCDPNQFQBCPGVSJL
    Λར༻͠ɺ(JUIVC"1*Ͱ
    ࣮੷Λࣗಈग़ྗ
    w(JUIVC্ͷ׆ಈͷ਺஋Խˠੜ࢈ੑͷఆྔԽ
    wυΩϡϝϯτΠϝʔδͷ؅ཧ

    View full-size slide

  13. ը૾΋ࣗಈͰΞοϓϩʔυ
    ΩϟϓνϟऔΔ
    ΫϦοϓϘʔυʹ
    <> ը૾63-

    ͕ຒΊࠐ·ΕΔ
    εΫϦʔϯγϣοτΛHJUIVCDPN΍()&Ͱ؅ཧ͢Δ
    IUUQTUFOTOBQPODPNBSDIJWFT

    ϚʔΫμ΢ϯυΩϡϝϯτͷը૾ૠೖͷखؒΛղܾ

    View full-size slide

  14. ίϛϡχέʔγϣϯ
    πʔϧΛ·ͱΊΔ

    View full-size slide

  15. ීஈݟΔΞϓϦέʔγϣϯ͸গͳ͍ํ͕͍͍
    .VTU
    w4MBDLϝΠϯίϛϡχέʔγϣϯ
    w(JUIVCίʔυࢿ࢈΍ɺετοΫ৘ใ
    w5XJUUFSָ͍͠
    8BOU
    w (NBJMγεςϜ͔Βͷ௨஌΍ࣾ֎࿈བྷ

    View full-size slide

  16. ࣾ֎͔Βͷେࣄͳ࿈བྷ͕ϝʔϧͰདྷΔ
    wϏδωεʹ͓͍ͯ·ͩ·ͩϝʔϧશ੝ظʂʂʂ̍
    wγεςϜϝϯςφϯεͷ࿈བྷ
    w0QFO44-ด࠯ͷ࿈བྷ
    wܾࡁαʔϏε͔Βͷ௨஌

    View full-size slide

  17. ͋Μ·εϥΠυͷॻ͔ͳ͍΄͏͕
    ྑͦ͞͏ͳ࿩Λ͢Δ

    View full-size slide

  18. 1PQQFSJT4ZTUFN(BUFXBZ
    QPQQFS
    (NBJM
    QPQ
    4MBDL"1*
    (JUIVC"1*
    &YFD
    ຊจ΍αϒδΣΫτΛਖ਼نදݱͰ৚݅Ϛον͠
    ࢦఆ͞ΕͨΞΫγϣϯΛ࣮ߦ

    View full-size slide

  19. ීஈݟΔΞϓϦέʔγϣϯ͸গͳ͍ํ͕͍͍
    .VTU
    w4MBDLϝΠϯίϛϡχέʔγϣϯ
    w(JUIVCίʔυࢿ࢈΍ɺετοΫ৘ใ
    w5XJUUFSָ͍͠
    8BOU
    w (NBJMγεςϜ͔Βͷ௨஌΍ࣾ֎࿈བྷ

    View full-size slide

  20. αʔόҠઃۀ຿
    VTFSDPOUFOUT
    "QBDIF)551
    VTFS
    VTFSDPOUFOUT
    ౰ࣾϨϯλϧαʔόαʔϏε͓͍ͯ͸෺ཧαʔόʹ͓٬༷ͷίϯςϯπ͕഑ஔ͞Ε͓ͯΓɺ
    ෛՙঢ়گͳͲΛؑΈͯɺαʔόҠઃ͢Δ͜ͱ͕͋Δ
    Ҡઃ
    "QBDIF)551

    View full-size slide

  21. چདྷͷҠઃ࣌ͷϫʔΫϑϩʔ
    ΧελϚʔ
    αʔϏε
    ΤϯδχΞ
    ͓٬༷
    +FOLJOT
    Ҡઃ೔ௐ੔

    View full-size slide

  22. چདྷͷҠઃ࣌ͷϫʔΫϑϩʔ
    ΧελϚʔ
    αʔϏε
    ΤϯδχΞ
    ͓٬༷
    +FOLJOT
    Ҡઃ೔ௐ੔ Ҡઃ೔ճ౴

    View full-size slide

  23. چདྷͷҠઃ࣌ͷϫʔΫϑϩʔ
    ΧελϚʔ
    αʔϏε
    ΤϯδχΞ
    ͓٬༷
    +FOLJOT
    Ҡઃ೔ௐ੔ Ҡઃ೔ճ౴
    Ҡઃ೔ௐ੔

    View full-size slide

  24. چདྷͷҠઃ࣌ͷϫʔΫϑϩʔ
    ΧελϚʔ
    αʔϏε
    ΤϯδχΞ
    ͓٬༷
    +FOLJOT
    Ҡઃ೔ௐ੔ Ҡઃ೔ճ౴
    Ҡઃ೔ௐ੔
    ࡞ۀ೔ճ౴

    View full-size slide

  25. چདྷͷҠઃ࣌ͷϫʔΫϑϩʔ
    ΧελϚʔ
    αʔϏε
    ΤϯδχΞ
    ͓٬༷
    +FOLJOT
    Ҡઃ೔ௐ੔ Ҡઃ೔ճ౴
    Ҡઃ೔ௐ੔
    ࡞ۀ೔ճ౴
    ࡞ۀґཔ

    View full-size slide

  26. چདྷͷҠઃ࣌ͷϫʔΫϑϩʔ
    ΧελϚʔ
    αʔϏε
    ΤϯδχΞ
    ͓٬༷
    +FOLJOT
    Ҡઃ೔ௐ੔ Ҡઃ೔ճ౴
    Ҡઃ೔ௐ੔
    ࡞ۀ೔ճ౴
    ࡞ۀґཔ
    δϣϒ࣮ߦ

    View full-size slide

  27. چདྷͷҠઃ࣌ͷ՝୊
    wΧελϚʔαʔϏεͷௐ੔Օॴ͕ɺ͓٬༷ɺΤϯδχΞͱ఺͋Γɺ
    Φʔόʔϔου͕͋Δ্ʹϑΥʔΧεͰ͖ͯͳ͍
    w·Εʹਂ໷࡞ۀରԠ͕ඞཁʹͳΓɺΤϯδχΞͷෛՙ૿ཁҼͱͳΔ

    View full-size slide

  28. 4MBDL3VCPUZͰΤϯδχΞΛίʔυԽ͢Δ
    w4MBDL"1* IUUQTBQJTMBDLDPNXFC

    w3VCPUZ IUUQTHJUIVCDPNSLBNVSBSVCPUZ

    View full-size slide

  29. 4MBDL"1*͕࡞Δૉ੖Β͍͠ੈք
    ΧελϚʔ
    αʔϏε
    4MBDL
    3VCPUZ

    ͓٬༷
    +FOLJOT"1*
    Ҡઃ೔ௐ੔ Ҡઃ೔ճ౴
    Ҡઃґཔ
    ҠઃઌαδΣετ
    w 4MBDL"1*Λར༻ͨ͠3VCPUZͰϘοτΛ։ൃ͠ɺҠઃΛ$IBU0QTԽ
    w +FOLJOT"1*Λར༻͠ɺࢦఆͨ࣌ؒ͠ʹδϣϒΛ࣮ߦ͢Δ͜ͱͰਂ໷ରԠ΋
    w ࣾ಺"1*։ൃ͠ɺෛՙͷ௿͍αʔόΛࣗಈͰݕࡧ͠ɺαδΣετ͢Δɻ

    ͦͷ৘ใΛ΋ͱʹɺΧελϚʔαʔϏε͕Ҡઃઌͷαʔόબ୒
    NPOJUPS"1*
    δϣϒ࣮ߦ

    View full-size slide

  30. 4MBDL"1*Λར༻ͨ͠$IBU0QT
    w3VCPUZ࠷ߴʂʂʂ̍
    wΤεΧϨͳͲͷ*TTVFͷϐοΫΞοϓ
    wίʔυࢿ࢈ͷσϓϩΠ
    wαʔϏε"1*ͷ8SBQQFS

    View full-size slide

  31. ๭UZQFUBML
    wϘοτ͸࡞ΕΔ
    ˠݱঢ়͸τϐοΫ͝ͱʹϘοτఆ͕ٛඞཁʁ
    wϘοτͳΜ͚ͩͲɺ8FCIPPL࣮૷ਪ঑ͬΆ͍ʁ
    ˠαʔό࡞Δͷ͸ෑډ͕ߴ͍έʔε΋͋Δ

    View full-size slide

  32. Ϙοτ͔ͩΒ΍ͬͺΓ

    ιέοτͰετϦʔϜ͍ͨ͠͠ɺ
    ετϦʔϜͬͯݴ͍͍ͨ
    ετϦʔϜͬͯڹ͖͕͔͍͍ͬ͜͠ɺ
    ͪΐͬͱιϑτΫϦʔϜʹࣅͯΔ
    ιϑτΫϦʔϜ৯΂͍ͨ

    View full-size slide

  33. Ͷ͐Ͱ΍
    Μͷ

    View full-size slide

  34. IUUQTHJUIVCDPNQZBNB
    SVCPUZUZQFUBML

    View full-size slide

  35. SVCPUZUZQFUBML
    3VCPUZ SVCPUZUZQFUBML
    PBVUIBDDFTT@UPLFO
    BQJWTUSFBNJOH
    BQJWTQBDFT
    BQJWUPQJDT
    BQJWUPQJDTUPQJD@JE
    ೝূτʔΫϯऔಘ
    ιέοτ-JTUFO
    ૊৫*%ղܾ
    τϐοΫ*%ղܾ
    ϝοηʔδ౤ߘ
    ೝূ
    ಡΈऔΓ
    ౤ߘ
    IUUQTEFWFMPQFSOVMBCJODDPNKBEPDTUZQFUBML

    View full-size slide

  36. Ұݴ͚ͩݴΘͤͯ͘Ε
    BQJWUPQJDTϢʔβʔ͕ॴଐ͢Δ૊৫ͷUPQJDҰཡ
    BQJWUPQJDT૊৫ʹॴଐ͠ͳ͍UPQJDҰཡ
    BQJWUPQJDT TQBDF,FZYYYYࢦఆͨ͠૊৫ͷUPQJDҰཡ
    BQJWUPQJDTWͱಉ͘͡ॴଐ͢Δ૊৫ͷશUPQJDҰཡͷ΄͏͕ʜ
    ૊৫ʹॴଐ͠ͳ͍UPQJDҰཡ͸BQJWUPQJDT OP@CFMPOHͱ͔Ͱʜ
    ඞਢతʹ͢ΔͳΒBQJWTQBDFTTQBDF@OBNFUPQJDTͱ͔͔ͳʜ

    View full-size slide

  37. Ϙοτ໊ࣗ෼ͰܾΊΒΕͯศར
    export TYPETALK_CLIENT_ID=xxxxxx
    export TYPETALK_CLIENT_SECRET=xxxxxx
    export TYPETALK_SPACE_NAME=example
    export TYPETALK_BOT_NAME=nulab

    View full-size slide

  38. ·ͱΊͯ
    ͍ͧ͘

    View full-size slide

  39. ελό͸࠷ߴͩ͠
    5XJUUFS௒ָ͍͠

    View full-size slide

  40. ੜ࢈ੑΛߴΊΔʹ͸
    ιϑτ΢ΣΞʹ࢓ࣄΛཔΉɺ
    ܖػΛґଘ͢Δ

    View full-size slide

  41. $IBU0QTͰ
    ৬छΛӽ͑ͯੜ࢈ੑΞήΞή

    View full-size slide

  42. ΠϯλʔϑΣʔεͷ౷ҰͰ
    ίϯςΩετεΠονΛͳ͘͢

    View full-size slide

  43. ͳ͍΋ͷ
    ͸࡞Δ

    View full-size slide

  44. 5IBOLZPVʂ
    ࠷৽ͷ࠾༻৘ใΛνΣοΫˠ !QC@SFDSVJU

    View full-size slide