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
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
770
CoreNFCファーストインプレッション(仮)
kz56cd
0
70
Other Decks in Technology
See All in Technology
ハッカソンから社内プロダクトへ AIエージェント「ko☆shi」開発で学んだ4つの重要要素
sonoda_mj
6
1.8k
Snowflake Industry Days 2025 Nowcast
takumimukaiyama
0
130
2025-12-27 Claude CodeでPRレビュー対応を効率化する@機械学習社会実装勉強会第54回
nakamasato
4
1.2k
Agentic AIが変革するAWSの開発・運用・セキュリティ ~Frontier Agentsを試してみた~ / Agentic AI transforms AWS development, operations, and security I tried Frontier Agents
yuj1osm
0
100
アラフォーおじさん、はじめてre:Inventに行く / A 40-Something Guy’s First re:Invent Adventure
kaminashi
0
170
202512_AIoT.pdf
iotcomjpadmin
0
150
20251203_AIxIoTビジネス共創ラボ_第4回勉強会_BP山崎.pdf
iotcomjpadmin
0
140
Connection-based OAuthから学ぶOAuth for AI Agents
flatt_security
0
400
ペアーズにおけるAIエージェント 基盤とText to SQLツールの紹介
hisamouna
2
1.8k
Snowflake導入から1年、LayerXのデータ活用の現在 / One Year into Snowflake: How LayerX Uses Data Today
civitaspo
0
2.5k
意外と知らない状態遷移テストの世界
nihonbuson
PRO
1
290
Knowledge Work の AI Backend
kworkdev
PRO
0
290
Featured
See All Featured
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
37
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
57
41k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
What's in a price? How to price your products and services
michaelherold
246
13k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
29
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Color Theory Basics | Prateek | Gurzu
gurzu
0
150
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Designing for humans not robots
tammielis
254
26k
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