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
99
github.com/pinzolo/sqlt
pinzolo
1
260
encoding/csv
pinzolo
0
700
Redmine 3.x
pinzolo
0
3.8k
Travis CI API LT
pinzolo
1
940
Gemfile.local
pinzolo
0
130
Other Decks in Programming
See All in Programming
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
220
受け取る人から提供する人になるということ
little_rubyist
0
230
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
100
詳細解説! ArrayListの仕組みと実装
yujisoftware
0
580
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.1k
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
Better Code Design in PHP
afilina
PRO
0
120
Featured
See All Featured
Building an army of robots
kneath
302
43k
The Invisible Side of Design
smashingmag
298
50k
Speed Design
sergeychernyshev
24
610
Navigating Team Friction
lara
183
14k
Done Done
chrislema
181
16k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Embracing the Ebb and Flow
colly
84
4.5k
Visualization
eitanlees
145
15k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Designing for Performance
lara
604
68k
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 ຊՈΛר͖ࠐΉʢΤίγεςϜͷڧԽʣ
େͳͷɺ͍͍ͷΛ ࡞Δ͚ͩͰͳ͘ɺ͍͍ ॥Λ࡞Δ͜ͱ