Agenda • Gem basis: rubygems and Bundler • Issues related to continuous gem dependency updating • How I solved it • Compare my solution with other ways
Gem is package format for Ruby’s library. RubyGems is package manager. Gem has gemspec for metadata, including dependency information. When we install gem, RubyGems solves gem’s dependencies, so required gem(s) will be installed automatically.
RubyGems is wise and powerful, but it’s not enough from application’s viewpoint. Application uses many gems. Where is the place to write these dependencies? We want to manage it with application itself. Bundler!
Gems will be updated every day. Your application might depends on many gems, therefore your application should be updated every day. Developer must update gems continuously.
Three reasons why it’s hard 1. Motivation-driven operation is not sustainable 2. The work does not incorporate with daily workflow would be forgotten 3. Email notification lacks sense of duty
1st reason Everyone once decided to check update everyday. If you have enough motivation, it works. Unfortunately, your motivation will be lost eventually. Motivation-driven operation is not sustainable.
2nd reason I mentioned bundle update. Simple. However, developers are so busy that unusual work would be forgotten. You might check mailbox without thinking, but you might not run bundle update just like it.
3rd reason I know bundle outdated, of course. $ bundle outdated | mail Easy to automate notification. But it has less pressure, so it’s easy to ignore.
Three reasons why it’s hard (again) 1. Motivation-driven operation is not sustainable 2. The work does not incorporate with daily workflow would be forgotten 3. Email notification lacks sense of duty
How to solve it? • Automation. Build system that work without motivation. • Visualization. Publicize whole process of system. Take it into your daily work. It makes a sense of mission.
(Work in Progress) Automation is good, but developer still have to make decision apply the update or not. How to tell him? Email? NO! Send Pull Request!
Daily workflow (1) • Jenkins runs job every morning • If opened Pull Request... • Check whether tests passed or failed • If tests failed... • Fix tests as soon as possible
I like to fix broken tests, even though it gives a load. It’s the sign that application could not follow library update. version fixed! / stop improvement It’s trade-off.
bundler-auto-update is similar way. It updates all gems to the most recent version that does not break tests. My solution has more aggressive strategy. Tests are safety net. Earlier break, earlier fix.
“Open source contirbution” sounds tough. “Social coding” seems more easy, but... Daily Pull Request gave me the chance. And also, I could know more about various gems.
My case is a trivial thing. But there are so many trivial things to be solved. Continuous improvement makes our environment more better. “Kaizen” was not built in a day. Next is your turn!