Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Danger CI
Search
vividmuimui
September 05, 2018
Programming
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Danger CI
original
https://vividmuimui.github.io/slides/danger-systems/slides/
vividmuimui
September 05, 2018
More Decks by vividmuimui
See All by vividmuimui
あるチームでの技術選定で考えてること(外部向けに修正版)
vividmuimui
0
20
開発組織まわりで最近考えているあれこれ
vividmuimui
0
49
bundle-update.pdf
vividmuimui
0
130
Dependabot vs BundleUpdate+LockDiff
vividmuimui
0
110
あなたの知らないRuboCopの設定
vividmuimui
0
260
最近(2019/02/03)の #Ruby , #Rails , #Bundler 事情
vividmuimui
0
170
Jasperはいいぞ!
vividmuimui
0
61
tigとかaliasなし生活を送ってみて改めてgitを覚えてる話
vividmuimui
0
140
lock_diff の紹介
vividmuimui
0
110
Other Decks in Programming
See All in Programming
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
210
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
310
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.1k
sbt 2.0: takeoff
eed3si9n
0
160
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
1k
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
750
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
500
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
120
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.7k
Domain-Driven Transformation
hschwentner
2
2.3k
Featured
See All Featured
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Music & Morning Musume
bryan
48
7.4k
BBQ
matthewcrist
90
10k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
Speed Design
sergeychernyshev
33
2.2k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
890
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Discover your Explorer Soul
emna__ayadi
2
1.3k
RailsConf 2023
tenderlove
30
1.6k
Transcript
Danger Danger 2018/09/05 社内LT @vividmuimui 1
https://danger.systems/ruby/ 2
Danger とは Danger とは
https://github.com/vividmuimui/danger-sample/pull/7 3
Danger とは Danger とは レビューbot 用のツール js とruby で提供されている 4
サンプル サンプル # PR WIP warn("PR is classed as Work
in Progress") if github.pr_title.include? "[WIP]" # PR 変更行数 500以上 warn("Big PR") if git.lines_of_code > 500 # 普通 ruby 放題 fail("fdescribe left in tests") if `grep -r fdescribe specs/ `.length > 1 fail("fit left in tests") if `grep -r fit specs/ `.length > 1 # rubocop 使 plugin rubocop.lint inline_comment: true 5
メリット メリット 各種CI やgit のホスティングサービスをサポートしている rubocop などのよく使うどころはプラグインがある プラグインの中見てもだいぶシンプルなので、カスタマイズや自作 も簡単 チーム独自のルールや簡単にかける
ruby(js) を書けばいいだけなので簡単&やりたい放題 たとえば を編集したけど を編集して なければ警告など 6
使い方 使い方 注意: ruby, Github, CircleCI での話です。雰囲気で読み取ってください。 7
コメント コメント # PR message "foo bar" # markdown markdown
":alert:" # CI 落 fail "This build didn't pass tests" # :alert: warn "Big PR" # file changed warn("xxxxxx", file: "Dangerfile", line: 10) 8
Git, Github Git, Github git.added_files git.modified_files git.deleted_files git.lines_of_code # warn("")
if git.commits.any? { |c| c.message =~ /^Merge branch 'master'/ } # diff diff = git.diff_for_file("Gemfile.lock") message("") if diff && diff.patch =~ "nokogiri" github.pr_title github.pr_body github.pr_labels github.branch_for_base # review github.review.start github.review.fail(message) github.review.warn(message) github.review.submit 9
コードの共有 コードの共有 gem としてplugin を追加する以外にも色んな方法で追加できる # github 直指定 device_grid =
"https://raw.githubusercontent.com/fastlane/fastlane/master/danger-device_grid/ danger.import_plugin(device_grid) # local file danger.import_plugin("danger/plugins/watch_plugin.rb") danger.import_plugin("danger/plugins/*.rb") danger.import_dangerfile(path: "path/to/Dangerfile") # gem danger.import_dangerfile(gem: "ruby-grape-danger") # github, gitlab danger.import_dangerfile(gitlab: "ruby-grape/danger") danger.import_dangerfile( github: "ruby-grape/danger", branch: "custom", path: "path/to/Dangerfile" ) 10
導入の仕方 導入の仕方 を用意 danger gem をinstall を設定 とかでdanger を実行 だけ!
11
ローカルでも動かせる ローカルでも動かせる ただ、対象にするPR が、そのブランチで一番最近マージされたPR を対象に しているっぽい( たぶん) Github でオープンになっているPR を対象に実行したりはできなそう(
未確認) danger pr --verbose 12
参考 参考 公式 試して動かしたやつ 参考プラグイン Github 検索 https://danger.systems https://github.com/vividmuimui/danger-sample https://github.com/vividmuimui/danger-sample/pull/7
https://github.com/ashfurrow/danger- rubocop/blob/master/lib/danger_plugin.rb https://github.com/search?q=warn+ lename%3ADanger le 13