Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ぺろぺろ - Github pull request bot framework -
Search
mzp
February 11, 2017
2
3.1k
ぺろぺろ - Github pull request bot framework -
名古屋Ruby会議 03
mzp
February 11, 2017
Tweet
Share
More Decks by mzp
See All by mzp
アイドルとして勤務する -理論と実践- / Work as cute idol. - theory & practice - #imas_hack
mzp
2
18k
日本語入力の落とし穴
mzp
4
14k
アイマスハッカソン 2017-ライブの感動を再現する
mzp
1
2.3k
The reason for using reason
mzp
2
2.9k
Love💕LivePhotos
mzp
0
1.4k
日本語入力とLisp
mzp
1
3.2k
Amazon EC2 スポットインスタンスを開発環境にする話
mzp
0
1.5k
クラウドサービスを活用した開発環境
mzp
1
3.2k
Rubyistのための型入門
mzp
20
5.9k
Featured
See All Featured
Faster Mobile Websites
deanohume
305
30k
The Invisible Side of Design
smashingmag
297
50k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Statistics for Hackers
jakevdp
796
220k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Designing for humans not robots
tammielis
250
25k
A Modern Web Designer's Workflow
chriscoyier
693
190k
KATA
mclloyd
29
14k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Transcript
ΖΖ N[Q (JUIVCQVMMSFRVFTUCPUGSBNFXPSL
None
None
w ίϯϑϦΫτʹؾ͍ͨΒڭ͑ͯ͋͛Α͏ w ίϝϯτͨ͠Β4MBDLͰ͑Α͏ w ϨϏϡʔΛґཔ͢Δͱ͖4MBDLͰ͑Α͏ w
ӡ༻ϧʔϧͷCPUԽ " ➡ ࠓͷςʔϚ
͍ํ
%FQMPZUPIFSPLV
8FCIPPLͷઃఆ
ΧελϚΠζ source 'https://rubygems.org' gem 'prpr' gem 'prpr-slack' gem 'prpr-mention_comment' gem
'prpr-checklist' gem 'prpr-conflict_label' # <= ه
طଘϓϥάΠϯͷհ
QSQSDIFDLMJTU
None
QSQSNFOUJPO@DPNNFOU
None
QSQSHFNpMF
QSQSDPOqJDU@MBCFM
·ͱΊ طଘϓϥάΠϯͷհ w QSQSDIFDLMJTUνΣοΫϦετͷߘ w QSQSNFOUJPO@DPNNFOU4MBDLͷίϝϯτసૹ w QSQSHFNpMF(FNpMFMPDLͷEJ⒎දࣔ w QSQSDPOqJDU@MBCFMDPOqJDUͷՄࢹԽ
.JTPDB։ൃϑϩʔͱͷ ౷߹
8*1 ϨϏϡʔ Ϛʔδ σϓϩΠ
w ૬ޓʹϨϏϡʔ͢Δ w جຊతʹ4MBDLͰΓͱΓΛ͢Δ IUUQTSFDSVJUNJTPDBKQ ৄࡉͪ͜Β
QSQSSFWJFX@MBCFM
QSQSMHUN
None
QSQSNFSHFE
σϓϩΠ CPUʹσϓϩΠΛґཔ͢Δ σϓϩΠ༻ͷϓϧϦΫΤετ͕࡞͞ΕΔ Ϛʔδ͢ΔͱɺσϓϩΠ͞ΕΔ
QSQSDPEF@EFQMPZ DPNNJUJE
·ͱΊ .JTPDB։ൃϑϩʔͱͷ౷߹ w QSQSSFWJFX@MBCFMϨϏϡʔґཔ w QSQSMHUN-(5.ͷՄࢹԽ w QSQSNFSHFEϚʔδ௨ w QSQSDPEF@EFQMPZσϓϩΠ
ઌߦࣄྫ
None
None
ϓϥάΠϯͰ֦ுͰ͖ΔCPU w IVCPU w 3VCPUZ w
ઃܭ
ඪ w HFNʹΑΔ֦ு w ཧऀҎ֎ઃఆมߋͰ͖ΔΑ͏ʹ͢Δ w IFSPLVͰಈ࡞͢Δ w ͬ͞͞ͱಈ͔͢
ߏ http CLI Handler Action Publisher GithubAPI ઃఆ ϓϥάΠϯ ίΞ
ྫ)BOEMFS class Prpr::Handler::Merged < Prpr::Handler::Base handle Event::PullRequest, action: /closed/ do
Prpr::Action::Merged::Merged.new(event).call end end
ྫ"DUJPO class Prpr::Action::Merged < Prpr::Action::Base def call if merged?
Publisher::Adapter::Base.broadcast message end end private def merged? !!event.pull_request.merged_at end .....
ྫ"DUJPO def message Prpr::Publisher::Message.new(body: body, from: from, room: room)
end def body env.format(:merged_body, event.pull_request) end def from event.sender end def room env[:merged_room] end
Βͳ͔ͬͨ͜ͱ w 8FC6*Λ࡞Βͳ͍ w #JUCVDLFU(JU-BCͷ͜ͱΕΔ
໋໊
Α͔ͬͨͱ͜Ζ w HFNԽͨ͠ͷͰɺϓϥάΠϯͱͷڥ͕໌֬ʹͳͬ ͨ w $-*Ͱಈ࡞͢ΔΑ͏ʹͨ͠ͷͰςετָ͕ w ֎෦"1*Λୟ͘෦͕ϓϥάΠϯͳͷͰɺຊମͷς ετָ͕
ۤ࿑ͨ͠ w (JUIVCͷ৽ػೳ͕ͳ͔ͳ͔"1*ʹͳΒͳ͍ w PDUPLJUʹ͍Βͳ͍ w େྔͷHFNTQFDΛॻ͘ͷ͕μϧ͍
·ͱΊ w ϓϧϦΫΤετ༻CPUϑϨʔϜϫʔΫΛ࡞ͬͨ w .JTPDBͷ։ൃϑϩʔʹࠐ·Ε͍ͯΔ w ֦ு͍͢͠Α͏ʹίϯϙʔωϯτׂ͞Ε͍ͯΔ