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 CI
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
vividmuimui
September 05, 2018
Programming
110
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
14
開発組織まわりで最近考えているあれこれ
vividmuimui
0
26
bundle-update.pdf
vividmuimui
0
130
Dependabot vs BundleUpdate+LockDiff
vividmuimui
0
92
あなたの知らないRuboCopの設定
vividmuimui
0
250
最近(2019/02/03)の #Ruby , #Rails , #Bundler 事情
vividmuimui
0
170
Jasperはいいぞ!
vividmuimui
0
54
tigとかaliasなし生活を送ってみて改めてgitを覚えてる話
vividmuimui
0
130
lock_diff の紹介
vividmuimui
0
100
Other Decks in Programming
See All in Programming
Creating Composable Callables in Contemporary C++
rollbear
0
170
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.5k
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
230
Datadog LLM Observabilityで実現する 安全なLLM Usage 管理
3150
0
120
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.8k
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.3k
AI時代のUIはどこへ行く?その2!
yusukebe
22
7.5k
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
14
5.9k
dRuby over BLE
makicamel
2
390
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
280
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
600
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
1
480
Featured
See All Featured
Believing is Seeing
oripsolob
1
150
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
220
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.6k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
The untapped power of vector embeddings
frankvandijk
2
1.8k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.6k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
A designer walks into a library…
pauljervisheath
211
24k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
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