RubyKaigi 2014, 18th-20th September 2014 Presented by Kensuke Nagae (@kyanny) http://rubykaigi.org/2014/presentation/S-KensukeNagae
<%= link_to "bundle", "update" %>Make "bundle update"more fun to reviewRubyKaigi 201419th September 2014=begin
View Slide
Kensuke Nagae@kyannyhttp://www.quipperschool.com/
https://medium.com/the-year-of-the-looking-glass/junior-designers-vs-senior-designers-fbe483d3b51eWhat I learnt
SolutionMotivationImplementation
SolutionMotivationImplementationWhat I made
SolutionMotivationImplementationWhy I needed it
SolutionMotivationImplementationHow I solved problem
SolutionMotivationImplementationRetrospective
Compare Linkerhttps://github.com/kyanny/compare_linker
Make linksfrom diff
Compare View URLhttps://github.com/blog/612-introducing-github-compare-view
Compare View URLgithub.com/markevans/dragonfly/compare/v1.0.6…v1.0.7
Compare View URLgithub.com/markevans/dragonfly/compare/v1.0.6…v1.0.7username/reponameversions (old…new)
Compare View URLgithub.com/quipper/schema/compare/d6ba752…714ec45
Compare View URLgithub.com/quipper/schema/compare/d6ba752…714ec45username/reponameGit commit object name (old…new)
1 year ago…
"bundle update" is neglectedToo lazy to do it regularlyNo sense of duty from "bundle outdated"
"bundle update" is neglectedToo lazy to do it regularlyNo sense of duty from "bundle outdated"Automation!!
FeedbacksHeroku ver.Tachikoma.iohttp://qiita.com/camelmasa/items/afe2a69a0ed97d5e9dc6http://tachikoma.io/
ButNot the case…
quipper/schema
schemaapiqlink qsupportqcreate
apiqlink qsupportqcreateschemadef api_rocksdo_somethingend
schemaqlink qsupportqcreateapidef api_rocksdo_somethingend$ bundle update
schemaapiqlinkqcreateqsupportdef api_rocksdo_somethingenddef api_rocksdo_somethingenddef api_rocksdo_somethingend$ bundle update$ bundle update$ bundle update
schemaqlink qsupportqcreatedef api_rocksdo_somethingenddef api_rocksdo_somethingenddef api_rocksdo_somethingend$ bundle update$ bundle update$ bundle updateNecessary??
https://www.flickr.com/photos/marcobellucci/3534516458
Not very useful
I did it very often…
I did it very often…github.com/
I did it very often…github.com/dragonfly ruby github
I did it very often…github.com/markevans/dragonflydragonfly ruby github
I did it very often…github.com/markevans/dragonfly/compare/dragonfly ruby github
I did it very often…github.com/markevans/dragonfly/compare/v1.0.6…dragonfly ruby github
I did it very often…github.com/markevans/dragonfly/compare/v1.0.6…v1.0.7dragonfly ruby github
I did it very often…github.com/markevans/dragonfly/compare/v1.0.6…v1.0.7dragonfly ruby githubIUUQTXXXqJDLSDPNQIPUPTUIJSUFFOPGDMVCT
"bundle update"should/can bemore fun to review
https://www.flickr.com/photos/derpoly/8288583655
I did it very often…github.com/markevans/dragonfly/compare/v1.0.6…v1.0.7dragonfly ruby githubAutomation!!
Compare Linker
Compare Gemfile.lock(s)Receive webhookBuild URLPost comment
Webhook Payload (JSON)
pull requestCompareLinkerReceive webhook JSON{"action": "opened","number": 48,"pull_request": {"id": 18905849,"state": "open","title": "……",/* JSON data */}
CompareLinkerGitHub APIGet Gemfile.lock(s)
CompareLinkerGitHub APIGet Gemfile.lock(s)masterfeature
CompareLinkerGitHub APIGet Gemfile.lock(s)masterfeaturefile = octokit.contents(repo_full_name, { ref: 'master' }).find { |content|content.name == "Gemfile.lock"}lockfile = Bundler::LockfileParser.new(Base64.decode64(octokit.blob(repo_full_name, file.sha1).content))
CompareLinkerGitHub APIGet Gemfile.lock(s)masterfeaturefile = octokit.contents(repo_full_name, { ref: 'master' }).find { |content|content.name == "Gemfile.lock"}lockfile = Bundler::LockfileParser.new(Base64.decode64(octokit.blob(repo_full_name, file.sha1).content))old_lockfile.specs.each do |old_spec|new_lockfile.specs.each do |new_spec|if old_spec.name == new_spec.nameif old_spec.version != new_spec.versionupdated_gems << gemendendendend
CompareLinkerGitHub APIGet homepage_uriRubygemsAPI
http://github.com/markevans/dragonfly
Comment to pull request
SolutionMotivationImplementationWhat I madeHow I solved problemWhy I needed it
SolutionMotivationImplementationWhat I madeHow I solved problemWhy I needed itRetrospective
Issues…
Weak in Rails :(
Weak in Rails :(http://www.rubyonrails.org/
{"action": "opened","number": 48,"pull_request": {"id": 18905849,"state": "open","title": "……",/* JSON data */}pull requestCompareLinkergit push --force
CompareLinkergit push --forcepull request{"ref": "refs/head/xyz","after": "4d2ab4e","before": "993b46b","created": false,"deleted": false,"forced": true,/* JSON data */}
In short:It’s "So-so" (-_-)Not very successful project
https://medium.com/the-year-of-the-looking-glass/junior-designers-vs-senior-designers-fbe483d3b51eI was thinking…ideaother
https://medium.com/the-year-of-the-looking-glass/junior-designers-vs-senior-designers-fbe483d3b51eI was thinking…ideaotherF
https://medium.com/the-year-of-the-looking-glass/junior-designers-vs-senior-designers-fbe483d3b51eActually…ideaactionimprovement
https://www.flickr.com/photos/derpoly/8288583655Idea is worth but…
https://medium.com/the-year-of-the-looking-glass/junior-designers-vs-senior-designers-fbe483d3b51eidea < action < improvement
Recap
SolutionMotivationImplementationI made Compare LinkerI wanted to make "bundle update"more fun to reviewI implemented it upon useful APIs
https://medium.com/the-year-of-the-looking-glass/junior-designers-vs-senior-designers-fbe483d3b51eKeep improvement!!ideaactionimprovement
Thank you for listening :)=end