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
98
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
930
Gemfile.local
pinzolo
0
130
Other Decks in Programming
See All in Programming
PagerDuty を軸にした On-Call 構築と運用課題の解決 / PagerDuty Japan Community Meetup 4
horimislime
1
110
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
430
Outline View in SwiftUI
1024jp
1
160
Googleのテストサイズを活用したテスト環境の構築
toms74209200
0
270
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
550
飲食業界向けマルチプロダクトを実現させる開発体制とリアルな現状
hiroya0601
1
400
Sidekiqで実現する 長時間非同期処理の中断と再開 / Pausing and Resuming Long-Running Asynchronous Jobs with Sidekiq
hypermkt
6
2.7k
offers_20241022_imakiire.pdf
imakurusu
2
360
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
390
僕がつくった48個のWebサービス達
yusukebe
18
17k
プロジェクト新規参入者のリードタイム短縮の観点から見る、品質の高いコードとアーキテクチャを保つメリット
d_endo
1
1k
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
9
1k
Featured
See All Featured
A designer walks into a library…
pauljervisheath
202
24k
Designing the Hi-DPI Web
ddemaree
280
34k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
328
21k
GraphQLの誤解/rethinking-graphql
sonatard
66
9.9k
Designing on Purpose - Digital PM Summit 2013
jponch
115
6.9k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
14
1.9k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
231
17k
We Have a Design System, Now What?
morganepeng
50
7.2k
It's Worth the Effort
3n
183
27k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.2k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
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 ຊՈΛר͖ࠐΉʢΤίγεςϜͷڧԽʣ
େͳͷɺ͍͍ͷΛ ࡞Δ͚ͩͰͳ͘ɺ͍͍ ॥Λ࡞Δ͜ͱ