ぺろぺろ - Github pull request bot framework -

501e65e32870561d73b1158370766664?s=47 mzp
February 11, 2017
2.1k

ぺろぺろ - Github pull request bot framework -

名古屋Ruby会議 03

501e65e32870561d73b1158370766664?s=128

mzp

February 11, 2017
Tweet

Transcript

  1. ΃Ζ΃Ζ N[Q (JUIVCQVMMSFRVFTUCPUGSBNFXPSL

  2. None
  3. None
  4. w ίϯϑϦΫτʹؾ෇͍ͨΒڭ͑ͯ͋͛Α͏ w ίϝϯτͨ͠Β4MBDLͰ΋఻͑Α͏ w ϨϏϡʔΛґཔ͢Δͱ͖͸4MBDLͰ΋఻͑Α͏ w 

  5. ӡ༻ϧʔϧͷCPUԽ " ➡ ࠓ೔ͷςʔϚ

  6. ࢖͍ํ

  7. %FQMPZUPIFSPLV

  8. 8FCIPPLͷઃఆ

  9. ΧελϚΠζ source 'https://rubygems.org' gem 'prpr' gem 'prpr-slack' gem 'prpr-mention_comment' gem

    'prpr-checklist' gem 'prpr-conflict_label' # <= ௥ه
  10. طଘϓϥάΠϯͷ঺հ

  11. QSQSDIFDLMJTU

  12. None
  13. QSQSNFOUJPO@DPNNFOU

  14. None
  15. QSQSHFNpMF

  16. QSQSDPOqJDU@MBCFM

  17. ·ͱΊ طଘϓϥάΠϯͷ঺հ w QSQSDIFDLMJTUνΣοΫϦετͷ౤ߘ w QSQSNFOUJPO@DPNNFOU4MBDL΁ͷίϝϯτసૹ w QSQSHFNpMF(FNpMFMPDLͷEJ⒎දࣔ w QSQSDPOqJDU@MBCFMDPOqJDUͷՄࢹԽ

  18. .JTPDB։ൃϑϩʔͱͷ ౷߹

  19. 8*1 ϨϏϡʔ Ϛʔδ σϓϩΠ

  20. w ૬ޓʹϨϏϡʔ͢Δ w جຊతʹ͸4MBDLͰ΍ΓͱΓΛ͢Δ IUUQTSFDSVJUNJTPDBKQ ৄࡉ͸ͪ͜Β

  21. QSQSSFWJFX@MBCFM

  22. QSQSMHUN

  23. None
  24. QSQSNFSHFE

  25. σϓϩΠ CPUʹσϓϩΠΛґཔ͢Δ σϓϩΠ༻ͷϓϧϦΫΤετ͕࡞੒͞ΕΔ Ϛʔδ͢ΔͱɺσϓϩΠ͞ΕΔ

  26. QSQSDPEF@EFQMPZ DPNNJUJE

  27. ·ͱΊ .JTPDB։ൃϑϩʔͱͷ౷߹ w QSQSSFWJFX@MBCFMϨϏϡʔґཔ w QSQSMHUN-(5.਺ͷՄࢹԽ w QSQSNFSHFEϚʔδ௨஌ w QSQSDPEF@EFQMPZσϓϩΠ

  28. ઌߦࣄྫ

  29. None
  30. None
  31. ϓϥάΠϯͰ֦ுͰ͖ΔCPU w IVCPU w 3VCPUZ w 

  32. ઃܭ

  33. ໨ඪ w HFNʹΑΔ֦ு w ؅ཧऀҎ֎΋ઃఆมߋͰ͖ΔΑ͏ʹ͢Δ w IFSPLVͰಈ࡞͢Δ w ͬ͞͞ͱಈ͔͢

  34. ߏ੒ http CLI Handler Action Publisher GithubAPI ઃఆ ϓϥάΠϯ ίΞ

  35. ྫ)BOEMFS class Prpr::Handler::Merged < Prpr::Handler::Base handle Event::PullRequest, action: /closed/ do

    Prpr::Action::Merged::Merged.new(event).call end end
  36. ྫ"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 .....
  37. ྫ"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
  38. ΍Βͳ͔ͬͨ͜ͱ w 8FC6*Λ࡞Βͳ͍ w #JUCVDLFU(JU-BCͷ͜ͱ͸๨ΕΔ

  39. ໋໊

  40. Α͔ͬͨͱ͜Ζ w HFNԽͨ͠ͷͰɺϓϥάΠϯͱͷڥ໨͕໌֬ʹͳͬ ͨ w $-*Ͱಈ࡞͢ΔΑ͏ʹͨ͠ͷͰςετָ͕ w ֎෦"1*Λୟ͘෦෼͕ϓϥάΠϯͳͷͰɺຊମͷς ετָ͕

  41. ۤ࿑ͨ͠఺ w (JUIVCͷ৽ػೳ͕ͳ͔ͳ͔"1*ʹͳΒͳ͍ w PDUPLJUʹ΋͸͍Βͳ͍ w େྔͷHFNTQFDΛॻ͘ͷ͕μϧ͍

  42. ·ͱΊ w ϓϧϦΫΤετ༻CPUϑϨʔϜϫʔΫΛ࡞ͬͨ w .JTPDBͷ։ൃϑϩʔʹ૊ࠐ·Ε͍ͯΔ w ֦ு͠΍͍͢Α͏ʹίϯϙʔωϯτ෼ׂ͞Ε͍ͯΔ