Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
DangerでスムーズなPRレビューを
Search
masakazu sano
September 12, 2017
Technology
1
370
DangerでスムーズなPRレビューを
2017/09/12 iOS社内勉強会 @OHAKO.inc にて公開したスライドです
masakazu sano
September 12, 2017
Tweet
Share
More Decks by masakazu sano
See All by masakazu sano
Manual DI with ReactorKit
kz56cd
1
760
CoreNFCファーストインプレッション(仮)
kz56cd
0
70
Other Decks in Technology
See All in Technology
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
980
MAP-7thplaceSolution
yukichi0403
2
240
その設計、 本当に価値を生んでますか?
shimomura
2
160
AIにおける自由の追求
shujisado
2
470
GitLab Duo Agent Platformで実現する“AI駆動・継続的サービス開発”と最新情報のアップデート
jeffi7
0
120
Active Directory 勉強会 第 6 回目 Active Directory セキュリティについて学ぶ回
eurekaberry
16
5.9k
タグ付きユニオン型を便利に使うテクニックとその注意点
uhyo
2
530
Databricksによるエージェント構築
taka_aki
1
110
シンプルを極める。アンチパターンなDB設計の本質
facilo_inc
1
1k
Multimodal AI Driving Solutions to Societal Challenges
keio_smilab
PRO
1
110
Uncertainty in the LLM era - Science, more than scale
gaelvaroquaux
0
170
著者と読み解くAIエージェント現場導入の勘所 Lancers TechBook#2
smiyawaki0820
6
2.5k
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Designing for humans not robots
tammielis
254
26k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Documentation Writing (for coders)
carmenintech
76
5.2k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Why You Should Never Use an ORM
jnunemaker
PRO
60
9.6k
Typedesign – Prime Four
hannesfritz
42
2.9k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.3k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
Transcript
DangerͰ εϜʔζͳPRϨϏϡʔΛ 2017/09/12 iOSࣾษڧձ @OHAKO.inc Masakazu Sano (@kz56cd)
Dangerʁ
None
You can use Danger to codify your teams norms, leaving
humans to think about harder problems.
Dangerͱ νʔϜ։ൃͰࡉ͔ͳϧʔϧ͕ଘࡏ͢Δ
Dangerͱ νʔϜ։ൃͰࡉ͔ͳϧʔϧ͕ଘࡏ͢Δ • WIP͕͍ͭͨ··ϨϏϡʔʹճ͞ͳ͍Ͱʂ • ίʔυมߋͨ͠ΒCHANGELOGsߋ৽ͯ͠ʂ • PRͷ࡞ۀऀΛઃఆͯ͠ʂ • ಛघͳϑΝΠϧ͕ߋ৽͞Ε͍ͯΔͳΒࣄલʹڭ͑ͯ΄͍͠...
etc...
͜ΕΒΛʢਓؒͷΘΓʹʣ ࣄલνΣοΫͯ͘͠ΕΔͷ͕ Danger
Danger ͷछྨ
None
Danger ͷछྨ • ݱࡏ js൛ͱruby൛͕͋Δ • ࠷ۙ swift൛ʢ·ͩβͬΆ͍ʣ͕Ճ͞Εͨ! • iOS
11 / swift 4 ʹͯಈ࡞ • https://github.com/danger/danger-swift ※ ࠓճruby൛ͰΛਐΊ·͢
ಋೖํ๏
ಋೖํ๏ ༻ҙ͢Δͷ • Bundler • ԿΒ͔ͷCI (CircleCI , Bitrize ...)
• Danger௨༻ͷ bot • organization / private repoͷࡍඞཁʹͳΔ
ಋೖํ๏ ͓͓·͔ͳྲྀΕ 1. ϩʔΧϧڥʹDangerΛೖΕΔ 2. GithubʹbotΛઃఆ͢Δ 3. CI্ͰDangerFileΛධՁͰ͖ΔΑ͏ʹηοτ͢Δ
ಋೖํ๏ 1. ϩʔΧϧڥʹDangerΛೖΕΔ
ಋೖํ๏ 1. ϩʔΧϧڥʹDangerΛೖΕΔ • ϓϩδΣΫτԼʹ࣮ͯߦ $ bundle init
ಋೖํ๏ 1. ϩʔΧϧڥʹDangerΛೖΕΔ • ੜ͞ΕͨGemFileʹ gem "danger" Λه $ bundle
install ʢ࣮ߦ࣌ɺରܗࣜʹͯηοτΞοϓΛߦ͑Δ͕ɺͱΓ͋͑ͣ Enter࿈ଧͯ͠Α͍ʣ ➡ Πϯετʔϧޭ͢ΔͱDangerFile͕ੜ͞ΕΔ
ಋೖํ๏ 1. ϩʔΧϧڥʹDangerΛೖΕΔ • ϓϩδΣΫτ্ෆཁͳϑΝΠϧ.gitignoreʹه͓ͯ͘͠ ## danger(use bundler) .bundle/ vendor/
ಋೖํ๏ 2. GithubʹbotΛઃఆ͢Δ
ಋೖํ๏ 2. GithubʹbotΛઃఆ͢Δ
ಋೖํ๏ 2. GithubʹbotΛઃఆ͢Δ ʢOSSͷ߹͜ͷखॱল͍ͯΑ͍Ͱ͢!ʣ • Githubͷ߹machine userΛ༻ҙ͢Δ
ಋೖํ๏ 2. GithubʹbotΛઃఆ͢Δ • ن্ɺmachine user 1ͭͷ organization ʹ͖ͭ1ମͷΈ ͱͳ͍ͬͯΔͷͰҙ
• https://developer.github.com/v3/guides/managing- deploy-keys/#machine-users • machine userͷՃํ๏ • http://www.wikihow.com/Use-Deploy-Keys-on- Github#CreatingaMachineUsersub
ಋೖํ๏ 2. GithubʹbotΛઃఆ͢Δ ʢOSSͷ߹͜ͷखॱল͍ͯΑ͍Ͱ͢!ʣ • Ճ͍ͨ͠private repoʹcollaboratorͱͯ͠ɺbotΛՃ͢ Δ
ಋೖํ๏ 2. GithubʹbotΛઃఆ͢Δ ʢOSSͷ߹ࣗͷΞΧϯτͷtokenΛ࡞Γ·͠ΐ͏!ʣ • botʹDanger༻ͷprivate access tokenΛՃ͢Δ • botͰϩάΠϯ
• Setting -> Personal access tokens -> ʮGenerate new tokenʯԡԼ • ͦͷࡍɺtokenͷݖݶ repos શͯʹνΣοΫ͢Δ͜ͱ
ಋೖํ๏ 3. CI্ͰDangerFileΛධՁͰ͖ΔΑ ͏ʹηοτ͢Δ
ಋೖํ๏ 3. CI্ͰDangerFileΛධՁ Ͱ͖ΔΑ͏ʹηοτ͢Δ • bitriseͷ߹ • ֘ϓϩδΣΫτͷworkflow editorΛ։͘ •
ҙͷҐஔʹʮScriptʯstepΛ৽ نՃ • Script content ʹهड़ɿ
ಋೖํ๏ 3. CI্ͰDangerFileΛධՁ Ͱ͖ΔΑ͏ʹηοτ͢Δ • ઌʹ༻ҙͨ͠bot (OSSͷ߹ࣗ ͷ) ͷ private
access token Λη οτ͢Δ • workflow editorͷʮEnv Varsʯ λϒԡԼ • ʮAdd newʯԡԼ͠ɺ ʮDANGERGITHUBAPI_TOKENʯ ͱ͍͏໊শͰtokenొ
͋ͱɺpull requestΛ࡞ͯ͠ Dangerͷ௨͕ग़ΕOKͰ͢ʂ
None
DangerFileΛΧελϚ Πζ͢Δ
None
DangerFileΛΧελϚΠζ͢Δ • message / warn / fail ͷࡾछͰϢʔβʔʹνΣοΫ༰Λप Ͱ͖Δ •
markdownͰͷهड़Մɿ • markdown("## ࡞ۀதͰ͢") • ಛఆͷίʔυͷdiffΛදࣔ͢Δ͜ͱͰ͖Δ
DangerFileΛΧελϚΠζ͢Δ ڞ௨Ͱ͑ͦ͏ͳνΣοΫɿ # ϚΠϧετʔϯͷνΣοΫ message("ϚΠϧετʔϯ͕ະઃఆͰ͢") unless has_milestone # ࡞ۀऀͷνΣοΫ warn("࡞ۀऀΛΞαΠϯ͠·͠ΐ͏",
sticky: false) unless has_assignee # ϚʔδઌͷνΣοΫ warn("ϚʔδઌΛdevelopʹઃఆ͠·͠ΐ͏") if !github.branch_for_base == "develop" # ߦνΣοΫ warn("500ߦ͑ͯ·͢ɻׂͰ͖ΔͱϕλʔͰ͢Ͷ") if git.lines_of_code > 500
DangerFileΛΧελϚΠζ͢Δ iOS։ൃ༻్ͷνΣοΫɿ # App.xcodeproj/project.pbxproj ͷมߋνΣοΫ message ("`App.xcodeproj/project.pbxproj` ͕มߋ͞Ε͍ͯ·͢") if git.modified_files.include?
"App.xcodeproj/project.pbxproj" # Cartfile ͷมߋνΣοΫ message ("`Cartfile` ͕มߋ͞Ε͍ͯ·͢") if git.modified_files.include? "Cartfile" message ("`Cartfile.resolved` ͕มߋ͞Ε͍ͯ·͢") if git.modified_files.include? "Cartfile.resolved" # Podfile ͷมߋνΣοΫ message ("`Podfile` ͕มߋ͞Ε͍ͯ·͢") if git.modified_files.include? "Podfile" message ("`Podfile.lock` ͕มߋ͞Ε͍ͯ·͢") if git.modified_files.include? "Podfile.lock"
DangerFileΛΧελϚΠζ͢Δ LGTMɿ # add lgtm pic lgtm.check_lgtm • ʮwarn /
failͰͻ͔͔ͬΒͳ͍࣌ͷΈʯLGTM͞ΕΔ • ͻͱͰϨϏϡʔՄೳ͔Δʂ! • GemFileʹه͕ඞཁɿ gem "danger-lgtm"
DangerFileΛΧελϚΠζ͢Δ ʴα • ެࣜυΩϡϝϯτɺʮSHOW ME SOME DANGERFILESʯʹ ෳྫ͋Γɿ • http://danger.systems/ruby/
Danger Pluginͷಋೖ
Danger Pluginͷಋೖ • ઌͷʮdanger-lgtmʯϓϥάΠϯ • Gemfileʹهड़ͯ͠Πϯετʔϧ͢ΕOK • ެࣜαΠτͰଟհ͞ΕͯΔ • ʮPLUGINSʯͷ߲Λࢀরɿ
• http://danger.systems/ruby/
ྑͦ͞͏ͳDanger Plugin clorox • file header(ॺ໊)ͷܗࣜνΣοΫ • https://github.com/barbosa/danger-clorox todoist •
TODO/FIXMEͷهड़ʹର͠ࡉ͔ͳ௨͕Ͱ͖Δ • https://github.com/hanneskaeufler/danger-todoist
slather • ίʔυΧόϨοδͷՄࢹԽ • https://github.com/BrunoMazzo/Danger-Slather Rubocop • rubocopʹ४ڌͨ͠lintνΣοΫ • https://github.com/ashfurrow/danger-rubocop
DUPLICATELOCALIZABLESTRINGS • Localizable.strings ͷkeyॏෳνΣοΫ • https://github.com/AirHelp/danger- duplicatelocalizablestrings LGTM • https://github.com/leonhartX/danger-lgtm
! Ҏ্ !
ref • http://danger.systems/ • http://sssslide.com/speakerdeck.com/jp_pancake/ dangerwoshi-tuteprwozi-dong-de-nitietukusuru • https://www.slideshare.net/ShunsukeMaeda/dangerpull- request •
http://qiita.com/toshiya/items/589834d9b09c0dbe4c56