Tenderness driven development for Redmine plugin
by
pinzolo
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
༏͍͠ϓϥάΠϯ։ൃ
Slide 2
Slide 2 text
ࣗݾհ 4 ా ਓ 4 גࣜձࣾ ۭ 4 Engineer 4 @pinzolo 4 https://github.com/pinzolo
Slide 3
Slide 3 text
Rubygems 4 detox 4 formup 4 logdup 4 mastar 4 rails-flog 4 rails-render_hooks 4 tekido
Slide 4
Slide 4 text
Redmine plugins 4 redmine_bx 4 Redmine ্ͰςʔϒϧఆٛϦιʔεఆٛΛཧ͢Δ ʢ࡞Γͳ͓͢༧ఆʣ 4 redmine_persist_wfmt 4 Wiki ͷϑΥʔϚοτอଘͱબ 4 redmine_reminderz 4 Reminder λεΫΛͪΐͬͱ͚֦ͩுͨ͠ͷ
Slide 5
Slide 5 text
How use Redmine ओʹใཧ λεΫཧͱͯ͋͠Μ·Γ
Slide 6
Slide 6 text
ϓϥάΠϯͱ 4 Զͷཉ͍͠ػೳ͕ͳ͍ 4 ͜ͷॲཧ͜͏ͨ͠΄͏͕͍͍ 4 λεΫཧҎ֎ཧͰ͖ͨΒ͍͍ͷʹ
Slide 7
Slide 7 text
ϓϥάΠϯͱ 4 Զͷཉ͍͠ػೳ͕ͳ͍ 4 ͜ͷॲཧ͜͏ͨ͠΄͏͕͍͍ 4 λεΫཧҎ֎ཧͰ͖ͨΒ͍͍ͷʹ →ཁ͢ΔʹΤΰͷմ
Slide 8
Slide 8 text
͔͠͠ɻɻɻ 4 ͔ͤͬ͘࡞ͬͨϓϥάΠϯɺͬͯཉ͍͠ 4 ಉ͜͡ͱͰΜͰ͍Δਓ͍Δʂ 4 ΑΓྑ͘͢ΔͨΊʹଞͷਓͷҙݟ͕΄͍͠ ͔ͩΒɺਓʹ༏͘͠ϓϥάΠϯΛ։ൃ͠Α͏ʂʂ
Slide 9
Slide 9 text
։ൃऀʹ༏͘͠
Slide 10
Slide 10 text
։ൃऀʹ༏͘͠(1) ༻͢ΔϥΠϒϥϦͷόʔδϣϯ࠷৽Λ༻͢Δ ಛʹ ~> Λ༻͢ΔͱϓϥάΠϯಉ࢜Ͱͷিಥ͕͍͔ͭඞͣى ͖Δ
Slide 11
Slide 11 text
։ൃऀʹ༏͘͠(2) ରʹ Ruby Ͱ͖Δ͚ͩ 1.9.3 Λϕʔεʹ͢Δ Redmine ͷಈ࡞ڥΛϓϥάΠϯ͕ࠨӈͯ͠͠·͏ͷ· ͍͜͠ͱͰͳ͍
Slide 12
Slide 12 text
։ൃऀʹ༏͘͠(3) Redmine ͷόʔδϣϯΞοϓʹඞͣਵ͢Δ ʮRedmine ͷόʔδϣϯΞοϓΛ͍͚ͨ͠Ͳɺ͜ͷϓϥάΠ ϯ͕ະରԠ͔ͩΒରԠͪʯͳΜͯࣄଶΠΧϯ
Slide 13
Slide 13 text
։ൃऀʹ༏͘͠(4) γϯϘϧΛܾΊ͓ͯ͘ ςʔϒϧΫϥεͷॏෳ͕ආ͚͓͖ͯ·͠ΐ͏
Slide 14
Slide 14 text
։ൃऀʹ༏͘͠(5) ࣗͷϓϥάΠϯͷػೳɺӨڹΛ໌ࣔԽ͓͖͍ͯͨ͠ gem Redmine ͷόʔδϣϯΞοϓʹૉૣ͘ਵ͢ΔʹͲ ͏ͨ͠Βʁ
Slide 15
Slide 15 text
։ൃऀʹ༏͘͠(5) ࣗͷϓϥάΠϯͷػೳɺӨڹΛ໌ࣔԽ͓͖͍ͯͨ͠ gem Redmine ͷόʔδϣϯΞοϓʹૉૣ͘ਵ͢ΔʹͲ ͏ͨ͠Βʁ → ςετΛॻ͜͏
Slide 16
Slide 16 text
ςετΛॻ͜͏ Redmine ʹ͢Ͱʹ૬ྔͷςετίʔυ͕͋ΔͷͰɺ Fixture ϔϧύʔϝιουΛྲྀ༻Ͱ͖Δ RSpec FactoryGirl ͳͲ͕͍͍ͨਓͦͪΒΛ͍͑ ͍ɻڞଘͰ͖Δ CI ͲΜͲΜ͍ͬͯ͜͏
Slide 17
Slide 17 text
ཧऀʹ༏͘͠
Slide 18
Slide 18 text
ཧऀʹ༏͘͠(1) ΤϯδχΞ͕໌ه͢Δ͜ͱ 4 Πϯετʔϧํ๏ 4 Πϯετʔϧ͢ΔͱԿΛղܾ͢Δͷ͔ʁԿ͕Ͱ͖Δͷ͔ʁ 4 όʔδϣϯ্͕ͬͨΒԿ͕มΘͬͨʁ
Slide 19
Slide 19 text
ཧऀʹ༏͘͠(2) ؾͷར͍ͨΤϯδχΞ͕໌ه͢Δ͜ͱ 4 ΞϯΠϯετʔϧํ๏ 4 αϙʔτ͍ͯ͠Δόʔδϣϯ 4 ຊମͷػೳʹӨڹΛ༩͑Δ߹ͷ before -> after
Slide 20
Slide 20 text
ཧऀʹ༏͘͠(3) ཧऀ͕ؾʹ͢ΔͰ͋Ζ͏͜ͱ 4 Redmine ͷػೳΛյ͞ͳ͍͔Ͳ͏͔ 4 Redmine ͕͘ͳΒͳ͍͔ 4 ଞͷϓϥάΠϯͱ૬ੑ͕ѱ͘ແ͍͔
Slide 21
Slide 21 text
ཧऀʹ༏͘͠(4) ຊମͷػೳʹӨڹΛ༩͑ͳ͍ͱΛɺग़དྷΔݶΓͦΕΛূ໌͠ ͍ͨ ຊਓͷؾʹ͍ͯ͠ͳ͍ͱ͜ΖͰোى͖Δ ϓϥάΠϯͷςετ͚ͩͰϨΞέʔεͰͷຊମτϥϒϧ͕ൃ ݟͰ͖ͳ͍
Slide 22
Slide 22 text
ཧऀʹ༏͘͠(4) ຊମͷػೳʹӨڹΛ༩͑ͳ͍ͱΛɺग़དྷΔݶΓͦΕΛূ໌͠ ͍ͨ ຊਓͷؾʹ͍ͯ͠ͳ͍ͱ͜ΖͰোى͖Δ ϓϥάΠϯͷςετ͚ͩͰϨΞέʔεͰͷຊମτϥϒϧ͕ൃ ݟͰ͖ͳ͍ → rake ci Λར༻͠Α͏
Slide 23
Slide 23 text
rake ci Redmine ʹ͋Δ΄ͱΜͲશͯͷςετΛ࣮ߦ͠·͢ ϓϥάΠϯͷࢥΘ͵όάΛݟ͚ͭͨΓɺશ෦௨ͬͨΒ҆৺ͨ͠ Γग़དྷ·͢ จࣈ௨Γ CI ͠·͠ΐ͏
Slide 24
Slide 24 text
How CI σϑΝΫτͷ Jenkins ͍͍͚ͲɺCI αʔϏε͕खܰͰศར 4 Travis CI 4 Drone.io 4 Wercker 4 Circle CI etc.
Slide 25
Slide 25 text
How CI σϑΝΫτͷ Jenkins ͍͍͚ͲɺCI αʔϏε͕खܰͰศར 4 Travis CI ← ͓͢͢Ί 4 Drone.io 4 Wercker 4 Circle CI etc.
Slide 26
Slide 26 text
Travis CI ͷϝϦοτ (1) ϏϧυϚτϦΫε Ruby: 1.9.3, 2.0.0, 2.1.2 Redmine: 2.3.x, 2.4.x, 2.5.x ςετର: Redmineຊମ, ϓϥάΠϯ ͜ΕΒΛΈ߹Θͤͨڥͷςετ͕؆୯ʹͰ͖Δ
Slide 27
Slide 27 text
Travis CI ͷϝϦοτ (2) apt ͕༻Մೳ apt ͕͑ΔͷͰ CVS, Subversion, Mercurial ͳͲΛ༻͠ ͨςετ͕Մೳ ͨͩ͠ɺDarcs ඍົ ※ͪͳΈʹ Travis CI ͷ OS Ubuntu Server 12.04 LTS
Slide 28
Slide 28 text
Travis CI ͷϝϦοτ (3) firefox ͕ಈ͘ JavaScript Λ༻͍ͨ UI ܦ༝ͷςετՄೳ poltergeist ͪΖΜಈ͘
Slide 29
Slide 29 text
Travis CI ͷϝϦοτ (4) push Ҏ֎ͰͷϏϧυ Travis-CI Ͱ Pull Request Release(λά)ʹରͯ͠Ϗ ϧυΛͯ͘͠ΕΔ
Slide 30
Slide 30 text
Travis CI ͷҙ Gemfile ͕ϦϙδτϦʹଘࡏ͞ΕΔͱϩοΫΦϯ͞Εͯ͠·͏ ςετΛ࣮ߦ͢Δ·Ͱʹগʑ͕ඞཁ → ࢲͷϦϙδτϦͷ .travis.yml Λࢀর
Slide 31
Slide 31 text
ϓϥάΠϯ։ൃ֎Ͱͷ CI (1) ࣮ࡍʹӡ༻͍ͯ͠Δ Redmine ͷڥΛ CI ͱͯ͠༻ҙ͓ͯ͠ ͘ͱศར
Slide 32
Slide 32 text
ϓϥάΠϯ։ൃ֎Ͱͷ CI (2) ͜Μͳ࣌ͷૣظൃݟʹཱͭ 4 Ruby ͷόʔδϣϯ্͕͕ͬͨ࣌ 4 Redmine ͷόʔδϣϯ্͕͕ͬͨ࣌ 4 ϓϥάΠϯͷόʔδϣϯ্͕͕ͬͨ࣌ 4 ৽ͨͳϓϥάΠϯΛಋೖ͢Δ࣌
Slide 33
Slide 33 text
ϓϥάΠϯ։ൃ֎Ͱͷ CI (3) ͜ͷ߹ Jenkins ͷΑ͏ʹࣗ༝ʹϏϧυڥΛ࡞Ͱ͖Δ ͷ͕ྑ͍ vagrant, docker ͱ͍ͬͨԾԽٕज़ซ༻͢Δͱߋʹྑ͍
Slide 34
Slide 34 text
ϓϥάΠϯ։ൃ֎Ͱͷ CI (4) ͦͷͨΊʹ ςετΛॻ͜͏
Slide 35
Slide 35 text
TEST, CI ͕ਁಁ͢Ε 4 ϓϥάΠϯͷ্࣭ 4 ίϯϑϦΫτ͠ͳ͍ϓϥάΠϯ։ൃͷϊϋͷੵ 4 ҆৺ײʹΑΔϓϥάΠϯར༻ͷଅਐ 4 ͔ͬ͠Γϝϯς͞Εɺਓؾͱ࣮ͷ͋ΔϓϥάΠϯຊՈ ʹऔΓࠐ·ΕΔ͔ʁ
Slide 36
Slide 36 text
TEST, CI ͕ਁಁ͢Ε 4 ϓϥάΠϯͷ্࣭ 4 ίϯϑϦΫτ͠ͳ͍ϓϥάΠϯ։ൃͷϊϋͷੵ 4 ҆৺ײʹΑΔϓϥάΠϯར༻ͷଅਐ 4 ͔ͬ͠Γϝϯς͞Εɺਓؾͱ࣮ͷ͋ΔϓϥάΠϯຊՈ ʹऔΓࠐ·ΕΔ͔ʁ → ͍͍͜ͱͩΒ͚
Slide 37
Slide 37 text
͜͜·Ͱཧͷ
Slide 38
Slide 38 text
ݱ࣮ (1) ςετͷͳ͍ϓϥάΠϯ ଟ͍ɻςετͷ͋ΔϓϥάΠϯͷ΄͏͕গͳ͍Μ͡Όͳ͍͔ʁ ʢݸਓత؍ଌʣ
Slide 39
Slide 39 text
ݱ࣮ (2) ϥΠϒϥϦͷόʔδϣϯ 4 ϓϥάΠϯಉ࢜ͷόʔδϣϯিಥ 4 ຊମͱͷόʔδϣϯিಥ 4 ྫ͑ RSpec3 ΛϓϥάΠϯͷςετʹར༻͢Δ͜ͱ Ͱ͖·ͤΜ ʢࢀߟ: tail -f pinzo.log: Redmine ͷϓϥάΠϯΛ RSpec3 Ͱςετग़དྷͳ͍ʣ
Slide 40
Slide 40 text
ݱ࣮ (3) Redmine ຊମͷςετ 4 ࠷ۙͷ Darcs Ͱόʔδϣϯ͕৽ͯ͘͠ rake ci ͕ίέΔ 4 ൺֱతݹ͍όʔδϣϯΛϗετ͍ͯ͠Δ apt Ͱμϝ 4 ༻͢Δ SCM Λࢦఆͯ͠ςετΛΒͤΔ͜ͱ͕Ͱ͖ ΔΑ͏ʹͳͬͨͷ Redmine 2.5 Ҏ߱
Slide 41
Slide 41 text
ݱ࣮ (3) Redmine ຊମͷςετ 4 UI ͷςετ issues_test.rb ͷ 10 ςετέʔεͷΈ 4 Ϣχοτςετ2000݅ 4 ϑΝϯΫγϣφϧςετ͕1300݅ 4 ΠϯςάϨʔγϣϯςετ͕1000݅ 4 ci λεΫͰ࣮ߦ͞Εͳ͍
Slide 42
Slide 42 text
ݱ࣮ (3) ͭ·Γ JavaScript Λ༻͍ͨςετظͰ͖ͳ͍ JavaScript Λଟ༻͢ΔϓϥάΠϯͷ߹ɺຊମͷςετΛ௨ ͨ͢Ίͷ༨ܭͳ࣮Λڧ͍ΒΕΔ͜ͱ͋Δ ςϯγϣϯԼ͕Δ
Slide 43
Slide 43 text
ݱ࣮ (4) ܾͯ͠खް͍ͱݴ͑ͳ͍ Redmine ͷϓϥάΠϯαϙʔτ 4 View hook গͳ͍ & ภ͍ͬͯΔ 4 ը໘্͔ΒΠϯετʔϧ͢Δखஈ͕ͳ͍ 4 Α͏͘࠷৽͔Ͳ͏͔ΛνΣοΫ͢Δػೳ͕Ճ͞Εͨ (2.5.2ʙ) 4 Github ͳͲͷ SCM αʔϏεͱͷ࿈ܞ͕ແ͍ͨΊɺྑϓ ϥάΠϯ͕ଟ͍
Slide 44
Slide 44 text
݁ہ Redmine ϓϥάΠϯ࡞Γ͘͢ɺRedmine ࣗମ֦ு͠қ ͍ ͔͠͠ɺݟͷڞ༗ΤίγεςϜ͕ॆͰͳ͍ͨΊ Redmine ͷҐɾೳྗΛఈ্͛͢Δྗͱ࣮ͯ͠ྗ͕Γ͍ͯ ͳ͍ ͍ͬͨͳ͍ # ͳΜ͔ͷํੑ͕มΘ͍ͬͯΔ͕ؾʹ͠ͳ͍
Slide 45
Slide 45 text
Redmine ͷݱঢ় ։ൃऀ͚πʔϧͱͯ͠ଞͷΞδϟΠϧܥ։ൃπʔϧͷํ͕ ਓؾ λεΫཧϝΠϯͰͳ͘ɺλεΫཧΛओͱͨ͠ใཧπ ʔϧͷଆ໘͕େ͖͍ ·ͨɺϓϥάΠϯ Redmine ͷཁɾ࣭ཧऀͷཱͷ ऀ͕ଟ͍ؾ͕͢Δ → ITʹૄ͍ਓͨͪʹ༏͍͠πʔϧ͕ٻΊΒΕ͍ͯΔ
Slide 46
Slide 46 text
Ϣʔβʹ༏͍͠ Redmine ͷͨΊʹ 4 ͲΜͲΜ࡞ΔɺͲΜͲΜศརʹ͢Δ
Slide 47
Slide 47 text
Ϣʔβʹ༏͍͠ Redmine ͷͨΊʹ 4 ͲΜͲΜ࡞ΔɺͲΜͲΜศརʹ͢Δ 4 ΠϚυΩͷ։ൃख๏Λ Redmine ϓϥάΠϯʹద༻͢Δ ʢ҆৺ײʣ
Slide 48
Slide 48 text
Ϣʔβʹ༏͍͠ Redmine ͷͨΊʹ 4 ͲΜͲΜ࡞ΔɺͲΜͲΜศརʹ͢Δ 4 ΠϚυΩͷ։ൃख๏Λ Redmine ϓϥάΠϯʹద༻͢Δ ʢ҆৺ײʣ 4 ͲΜͲΜใΛൃ৴͢Δʢଟྗʣ
Slide 49
Slide 49 text
Ϣʔβʹ༏͍͠ Redmine ͷͨΊʹ 4 ͲΜͲΜ࡞ΔɺͲΜͲΜศརʹ͢Δ 4 ΠϚυΩͷ։ൃख๏Λ Redmine ϓϥάΠϯʹద༻͢Δ ʢ҆৺ײʣ 4 ͲΜͲΜใΛൃ৴͢Δʢଟྗʣ 4 ຊՈΛר͖ࠐΉʢΤίγεςϜͷڧԽʣ
Slide 50
Slide 50 text
େͳͷɺ͍͍ͷΛ ࡞Δ͚ͩͰͳ͘ɺ͍͍ ॥Λ࡞Δ͜ͱ