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
Tenderness driven development for Redmine plugin
Search
pinzolo
July 12, 2014
Programming
1
4.8k
Tenderness driven development for Redmine plugin
This slide has been published in RxTstudy 11th on 2014-07-12 at Osaka, Japan
pinzolo
July 12, 2014
Tweet
Share
More Decks by pinzolo
See All by pinzolo
rubygems-mfa.pdf
pinzolo
0
100
github.com/pinzolo/sqlt
pinzolo
1
270
encoding/csv
pinzolo
0
710
Redmine 3.x
pinzolo
0
3.8k
Travis CI API LT
pinzolo
1
950
Gemfile.local
pinzolo
0
130
Other Decks in Programming
See All in Programming
AppRouterを用いた大規模サービス開発におけるディレクトリ構成の変遷と問題点
eiganken
1
200
Kaigi on Railsに初参加したら、その日にLT登壇が決定した件について
tama50505
0
120
Androidアプリのモジュール分割における:x:commonを考える
okuzawats
1
240
ある日突然あなたが管理しているサーバーにDDoSが来たらどうなるでしょう?知ってるようで何も知らなかったDDoS攻撃と対策 #phpcon.2024
akase244
2
7.3k
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
310
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
990
Fibonacci Function Gallery - Part 2
philipschwarz
PRO
0
170
React 19でお手軽にCSS-in-JSを自作する
yukukotani
5
470
return文におけるstd::moveについて
onihusube
1
1.3k
Recoilを剥がしている話
kirik
5
7.7k
Spatial Rendering for Apple Vision Pro
warrenm
0
270
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
130
Featured
See All Featured
Being A Developer After 40
akosma
89
590k
Automating Front-end Workflow
addyosmani
1366
200k
KATA
mclloyd
29
14k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Done Done
chrislema
182
16k
Adopting Sorbet at Scale
ufuk
74
9.1k
YesSQL, Process and Tooling at Scale
rocio
170
14k
Unsuck your backbone
ammeep
669
57k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
Thoughts on Productivity
jonyablonski
68
4.4k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Transcript
༏͍͠ϓϥάΠϯ։ൃ
ࣗݾհ 4 ా ਓ 4 גࣜձࣾ ۭ 4 Engineer 4
@pinzolo 4 https://github.com/pinzolo
Rubygems 4 detox 4 formup 4 logdup 4 mastar 4
rails-flog 4 rails-render_hooks 4 tekido
Redmine plugins 4 redmine_bx 4 Redmine ্ͰςʔϒϧఆٛϦιʔεఆٛΛཧ͢Δ ʢ࡞Γͳ͓͢༧ఆʣ 4 redmine_persist_wfmt
4 Wiki ͷϑΥʔϚοτอଘͱબ 4 redmine_reminderz 4 Reminder λεΫΛͪΐͬͱ͚֦ͩுͨ͠ͷ
How use Redmine ओʹใཧ λεΫཧͱͯ͋͠Μ·Γ
ϓϥάΠϯͱ 4 Զͷཉ͍͠ػೳ͕ͳ͍ 4 ͜ͷॲཧ͜͏ͨ͠΄͏͕͍͍ 4 λεΫཧҎ֎ཧͰ͖ͨΒ͍͍ͷʹ
ϓϥάΠϯͱ 4 Զͷཉ͍͠ػೳ͕ͳ͍ 4 ͜ͷॲཧ͜͏ͨ͠΄͏͕͍͍ 4 λεΫཧҎ֎ཧͰ͖ͨΒ͍͍ͷʹ →ཁ͢ΔʹΤΰͷմ
͔͠͠ɻɻɻ 4 ͔ͤͬ͘࡞ͬͨϓϥάΠϯɺͬͯཉ͍͠ 4 ಉ͜͡ͱͰΜͰ͍Δਓ͍Δʂ 4 ΑΓྑ͘͢ΔͨΊʹଞͷਓͷҙݟ͕΄͍͠ ͔ͩΒɺਓʹ༏͘͠ϓϥάΠϯΛ։ൃ͠Α͏ʂʂ
։ൃऀʹ༏͘͠
։ൃऀʹ༏͘͠(1) ༻͢ΔϥΠϒϥϦͷόʔδϣϯ࠷৽Λ༻͢Δ ಛʹ ~> Λ༻͢ΔͱϓϥάΠϯಉ࢜Ͱͷিಥ͕͍͔ͭඞͣى ͖Δ
։ൃऀʹ༏͘͠(2) ରʹ Ruby Ͱ͖Δ͚ͩ 1.9.3 Λϕʔεʹ͢Δ Redmine ͷಈ࡞ڥΛϓϥάΠϯ͕ࠨӈͯ͠͠·͏ͷ· ͍͜͠ͱͰͳ͍
։ൃऀʹ༏͘͠(3) Redmine ͷόʔδϣϯΞοϓʹඞͣਵ͢Δ ʮRedmine ͷόʔδϣϯΞοϓΛ͍͚ͨ͠Ͳɺ͜ͷϓϥάΠ ϯ͕ະରԠ͔ͩΒରԠͪʯͳΜͯࣄଶΠΧϯ
։ൃऀʹ༏͘͠(4) γϯϘϧΛܾΊ͓ͯ͘ ςʔϒϧΫϥεͷॏෳ͕ආ͚͓͖ͯ·͠ΐ͏
։ൃऀʹ༏͘͠(5) ࣗͷϓϥάΠϯͷػೳɺӨڹΛ໌ࣔԽ͓͖͍ͯͨ͠ gem Redmine ͷόʔδϣϯΞοϓʹૉૣ͘ਵ͢ΔʹͲ ͏ͨ͠Βʁ
։ൃऀʹ༏͘͠(5) ࣗͷϓϥάΠϯͷػೳɺӨڹΛ໌ࣔԽ͓͖͍ͯͨ͠ gem Redmine ͷόʔδϣϯΞοϓʹૉૣ͘ਵ͢ΔʹͲ ͏ͨ͠Βʁ → ςετΛॻ͜͏
ςετΛॻ͜͏ Redmine ʹ͢Ͱʹ૬ྔͷςετίʔυ͕͋ΔͷͰɺ Fixture ϔϧύʔϝιουΛྲྀ༻Ͱ͖Δ RSpec FactoryGirl ͳͲ͕͍͍ͨਓͦͪΒΛ͍͑ ͍ɻڞଘͰ͖Δ
CI ͲΜͲΜ͍ͬͯ͜͏
ཧऀʹ༏͘͠
ཧऀʹ༏͘͠(1) ΤϯδχΞ͕໌ه͢Δ͜ͱ 4 Πϯετʔϧํ๏ 4 Πϯετʔϧ͢ΔͱԿΛղܾ͢Δͷ͔ʁԿ͕Ͱ͖Δͷ͔ʁ 4 όʔδϣϯ্͕ͬͨΒԿ͕มΘͬͨʁ
ཧऀʹ༏͘͠(2) ؾͷར͍ͨΤϯδχΞ͕໌ه͢Δ͜ͱ 4 ΞϯΠϯετʔϧํ๏ 4 αϙʔτ͍ͯ͠Δόʔδϣϯ 4 ຊମͷػೳʹӨڹΛ༩͑Δ߹ͷ before ->
after
ཧऀʹ༏͘͠(3) ཧऀ͕ؾʹ͢ΔͰ͋Ζ͏͜ͱ 4 Redmine ͷػೳΛյ͞ͳ͍͔Ͳ͏͔ 4 Redmine ͕͘ͳΒͳ͍͔ 4 ଞͷϓϥάΠϯͱ૬ੑ͕ѱ͘ແ͍͔
ཧऀʹ༏͘͠(4) ຊମͷػೳʹӨڹΛ༩͑ͳ͍ͱΛɺग़དྷΔݶΓͦΕΛূ໌͠ ͍ͨ ຊਓͷؾʹ͍ͯ͠ͳ͍ͱ͜ΖͰোى͖Δ ϓϥάΠϯͷςετ͚ͩͰϨΞέʔεͰͷຊମτϥϒϧ͕ൃ ݟͰ͖ͳ͍
ཧऀʹ༏͘͠(4) ຊମͷػೳʹӨڹΛ༩͑ͳ͍ͱΛɺग़དྷΔݶΓͦΕΛূ໌͠ ͍ͨ ຊਓͷؾʹ͍ͯ͠ͳ͍ͱ͜ΖͰোى͖Δ ϓϥάΠϯͷςετ͚ͩͰϨΞέʔεͰͷຊମτϥϒϧ͕ൃ ݟͰ͖ͳ͍ → rake ci Λར༻͠Α͏
rake ci Redmine ʹ͋Δ΄ͱΜͲશͯͷςετΛ࣮ߦ͠·͢ ϓϥάΠϯͷࢥΘ͵όάΛݟ͚ͭͨΓɺશ෦௨ͬͨΒ҆৺ͨ͠ Γग़དྷ·͢ จࣈ௨Γ CI ͠·͠ΐ͏
How CI σϑΝΫτͷ Jenkins ͍͍͚ͲɺCI αʔϏε͕खܰͰศར 4 Travis CI 4
Drone.io 4 Wercker 4 Circle CI etc.
How CI σϑΝΫτͷ Jenkins ͍͍͚ͲɺCI αʔϏε͕खܰͰศར 4 Travis CI ←
͓͢͢Ί 4 Drone.io 4 Wercker 4 Circle CI etc.
Travis CI ͷϝϦοτ (1) ϏϧυϚτϦΫε Ruby: 1.9.3, 2.0.0, 2.1.2 Redmine:
2.3.x, 2.4.x, 2.5.x ςετର: Redmineຊମ, ϓϥάΠϯ ͜ΕΒΛΈ߹Θͤͨڥͷςετ͕؆୯ʹͰ͖Δ
Travis CI ͷϝϦοτ (2) apt ͕༻Մೳ apt ͕͑ΔͷͰ CVS, Subversion,
Mercurial ͳͲΛ༻͠ ͨςετ͕Մೳ ͨͩ͠ɺDarcs ඍົ ※ͪͳΈʹ Travis CI ͷ OS Ubuntu Server 12.04 LTS
Travis CI ͷϝϦοτ (3) firefox ͕ಈ͘ JavaScript Λ༻͍ͨ UI ܦ༝ͷςετՄೳ
poltergeist ͪΖΜಈ͘
Travis CI ͷϝϦοτ (4) push Ҏ֎ͰͷϏϧυ Travis-CI Ͱ Pull Request
Release(λά)ʹରͯ͠Ϗ ϧυΛͯ͘͠ΕΔ
Travis CI ͷҙ Gemfile ͕ϦϙδτϦʹଘࡏ͞ΕΔͱϩοΫΦϯ͞Εͯ͠·͏ ςετΛ࣮ߦ͢Δ·Ͱʹগʑ͕ඞཁ → ࢲͷϦϙδτϦͷ .travis.yml Λࢀর
ϓϥάΠϯ։ൃ֎Ͱͷ CI (1) ࣮ࡍʹӡ༻͍ͯ͠Δ Redmine ͷڥΛ CI ͱͯ͠༻ҙ͓ͯ͠ ͘ͱศར
ϓϥάΠϯ։ൃ֎Ͱͷ CI (2) ͜Μͳ࣌ͷૣظൃݟʹཱͭ 4 Ruby ͷόʔδϣϯ্͕͕ͬͨ࣌ 4 Redmine ͷόʔδϣϯ্͕͕ͬͨ࣌
4 ϓϥάΠϯͷόʔδϣϯ্͕͕ͬͨ࣌ 4 ৽ͨͳϓϥάΠϯΛಋೖ͢Δ࣌
ϓϥάΠϯ։ൃ֎Ͱͷ CI (3) ͜ͷ߹ Jenkins ͷΑ͏ʹࣗ༝ʹϏϧυڥΛ࡞Ͱ͖Δ ͷ͕ྑ͍ vagrant, docker ͱ͍ͬͨԾԽٕज़ซ༻͢Δͱߋʹྑ͍
ϓϥάΠϯ։ൃ֎Ͱͷ CI (4) ͦͷͨΊʹ ςετΛॻ͜͏
TEST, CI ͕ਁಁ͢Ε 4 ϓϥάΠϯͷ্࣭ 4 ίϯϑϦΫτ͠ͳ͍ϓϥάΠϯ։ൃͷϊϋͷੵ 4 ҆৺ײʹΑΔϓϥάΠϯར༻ͷଅਐ 4
͔ͬ͠Γϝϯς͞Εɺਓؾͱ࣮ͷ͋ΔϓϥάΠϯຊՈ ʹऔΓࠐ·ΕΔ͔ʁ
TEST, CI ͕ਁಁ͢Ε 4 ϓϥάΠϯͷ্࣭ 4 ίϯϑϦΫτ͠ͳ͍ϓϥάΠϯ։ൃͷϊϋͷੵ 4 ҆৺ײʹΑΔϓϥάΠϯར༻ͷଅਐ 4
͔ͬ͠Γϝϯς͞Εɺਓؾͱ࣮ͷ͋ΔϓϥάΠϯຊՈ ʹऔΓࠐ·ΕΔ͔ʁ → ͍͍͜ͱͩΒ͚
͜͜·Ͱཧͷ
ݱ࣮ (1) ςετͷͳ͍ϓϥάΠϯ ଟ͍ɻςετͷ͋ΔϓϥάΠϯͷ΄͏͕গͳ͍Μ͡Όͳ͍͔ʁ ʢݸਓత؍ଌʣ
ݱ࣮ (2) ϥΠϒϥϦͷόʔδϣϯ 4 ϓϥάΠϯಉ࢜ͷόʔδϣϯিಥ 4 ຊମͱͷόʔδϣϯিಥ 4 ྫ͑ RSpec3
ΛϓϥάΠϯͷςετʹར༻͢Δ͜ͱ Ͱ͖·ͤΜ ʢࢀߟ: tail -f pinzo.log: Redmine ͷϓϥάΠϯΛ RSpec3 Ͱςετग़དྷͳ͍ʣ
ݱ࣮ (3) Redmine ຊମͷςετ 4 ࠷ۙͷ Darcs Ͱόʔδϣϯ͕৽ͯ͘͠ rake ci
͕ίέΔ 4 ൺֱతݹ͍όʔδϣϯΛϗετ͍ͯ͠Δ apt Ͱμϝ 4 ༻͢Δ SCM Λࢦఆͯ͠ςετΛΒͤΔ͜ͱ͕Ͱ͖ ΔΑ͏ʹͳͬͨͷ Redmine 2.5 Ҏ߱
ݱ࣮ (3) Redmine ຊମͷςετ 4 UI ͷςετ issues_test.rb ͷ 10
ςετέʔεͷΈ 4 Ϣχοτςετ2000݅ 4 ϑΝϯΫγϣφϧςετ͕1300݅ 4 ΠϯςάϨʔγϣϯςετ͕1000݅ 4 ci λεΫͰ࣮ߦ͞Εͳ͍
ݱ࣮ (3) ͭ·Γ JavaScript Λ༻͍ͨςετظͰ͖ͳ͍ JavaScript Λଟ༻͢ΔϓϥάΠϯͷ߹ɺຊମͷςετΛ௨ ͨ͢Ίͷ༨ܭͳ࣮Λڧ͍ΒΕΔ͜ͱ͋Δ ςϯγϣϯԼ͕Δ
ݱ࣮ (4) ܾͯ͠खް͍ͱݴ͑ͳ͍ Redmine ͷϓϥάΠϯαϙʔτ 4 View hook গͳ͍ &
ภ͍ͬͯΔ 4 ը໘্͔ΒΠϯετʔϧ͢Δखஈ͕ͳ͍ 4 Α͏͘࠷৽͔Ͳ͏͔ΛνΣοΫ͢Δػೳ͕Ճ͞Εͨ (2.5.2ʙ) 4 Github ͳͲͷ SCM αʔϏεͱͷ࿈ܞ͕ແ͍ͨΊɺྑϓ ϥάΠϯ͕ଟ͍
݁ہ Redmine ϓϥάΠϯ࡞Γ͘͢ɺRedmine ࣗମ֦ு͠қ ͍ ͔͠͠ɺݟͷڞ༗ΤίγεςϜ͕ॆͰͳ͍ͨΊ Redmine ͷҐɾೳྗΛఈ্͛͢Δྗͱ࣮ͯ͠ྗ͕Γ͍ͯ ͳ͍ ͍ͬͨͳ͍
# ͳΜ͔ͷํੑ͕มΘ͍ͬͯΔ͕ؾʹ͠ͳ͍
Redmine ͷݱঢ় ։ൃऀ͚πʔϧͱͯ͠ଞͷΞδϟΠϧܥ։ൃπʔϧͷํ͕ ਓؾ λεΫཧϝΠϯͰͳ͘ɺλεΫཧΛओͱͨ͠ใཧπ ʔϧͷଆ໘͕େ͖͍ ·ͨɺϓϥάΠϯ Redmine ͷཁɾ࣭ཧऀͷཱͷ ऀ͕ଟ͍ؾ͕͢Δ
→ ITʹૄ͍ਓͨͪʹ༏͍͠πʔϧ͕ٻΊΒΕ͍ͯΔ
Ϣʔβʹ༏͍͠ Redmine ͷͨΊʹ 4 ͲΜͲΜ࡞ΔɺͲΜͲΜศརʹ͢Δ
Ϣʔβʹ༏͍͠ Redmine ͷͨΊʹ 4 ͲΜͲΜ࡞ΔɺͲΜͲΜศརʹ͢Δ 4 ΠϚυΩͷ։ൃख๏Λ Redmine ϓϥάΠϯʹద༻͢Δ ʢ҆৺ײʣ
Ϣʔβʹ༏͍͠ Redmine ͷͨΊʹ 4 ͲΜͲΜ࡞ΔɺͲΜͲΜศརʹ͢Δ 4 ΠϚυΩͷ։ൃख๏Λ Redmine ϓϥάΠϯʹద༻͢Δ ʢ҆৺ײʣ
4 ͲΜͲΜใΛൃ৴͢Δʢଟྗʣ
Ϣʔβʹ༏͍͠ Redmine ͷͨΊʹ 4 ͲΜͲΜ࡞ΔɺͲΜͲΜศརʹ͢Δ 4 ΠϚυΩͷ։ൃख๏Λ Redmine ϓϥάΠϯʹద༻͢Δ ʢ҆৺ײʣ
4 ͲΜͲΜใΛൃ৴͢Δʢଟྗʣ 4 ຊՈΛר͖ࠐΉʢΤίγεςϜͷڧԽʣ
େͳͷɺ͍͍ͷΛ ࡞Δ͚ͩͰͳ͘ɺ͍͍ ॥Λ࡞Δ͜ͱ