Upgrade to Pro — share decks privately, control downloads, hide ads and more …

<%= link_to "bundle", "update" %> - Make "bundle update" more fun to review

Kensuke Nagae
September 19, 2014

<%= link_to "bundle", "update" %> - Make "bundle update" more fun to review

RubyKaigi 2014, 18th-20th September 2014
Presented by Kensuke Nagae (@kyanny)
http://rubykaigi.org/2014/presentation/S-KensukeNagae

Kensuke Nagae

September 19, 2014
Tweet

More Decks by Kensuke Nagae

Other Decks in Programming

Transcript

  1. <%= link_to "bundle", "update" %> Make "bundle update" more fun

    to review RubyKaigi 2014 19th September 2014 =begin
  2. Kensuke Nagae @kyanny http://www.quipperschool.com/

  3. https://medium.com/the-year-of-the-looking-glass/junior-designers-vs-senior-designers-fbe483d3b51e What I learnt

  4. Solution Motivation Implementation

  5. Solution Motivation Implementation What I made

  6. Solution Motivation Implementation Why I needed it

  7. Solution Motivation Implementation How I solved problem

  8. Solution Motivation Implementation Retrospective

  9. Solution Motivation Implementation What I made

  10. Compare Linker https://github.com/kyanny/compare_linker

  11. Make links from diff

  12. Compare View URL https://github.com/blog/612-introducing-github-compare-view

  13. Compare View URL github.com/markevans/dragonfly/compare/v1.0.6…v1.0.7

  14. Compare View URL github.com/markevans/dragonfly/compare/v1.0.6…v1.0.7 username/reponame versions (old…new)

  15. Compare View URL github.com/quipper/schema/compare/d6ba752…714ec45

  16. Compare View URL github.com/quipper/schema/compare/d6ba752…714ec45 username/reponame Git commit object name (old…new)

  17. Solution Motivation Implementation Why I needed it

  18. 1 year ago…

  19. "bundle update" is neglected Too lazy to do it regularly

    No sense of duty from "bundle outdated"
  20. "bundle update" is neglected Too lazy to do it regularly

    No sense of duty from "bundle outdated"
  21. "bundle update" is neglected Too lazy to do it regularly

    No sense of duty from "bundle outdated"
  22. "bundle update" is neglected Too lazy to do it regularly

    No sense of duty from "bundle outdated"
  23. "bundle update" is neglected Too lazy to do it regularly

    No sense of duty from "bundle outdated" Automation!!
  24. Feedbacks Heroku ver. Tachikoma.io http://qiita.com/camelmasa/items/afe2a69a0ed97d5e9dc6 http://tachikoma.io/

  25. But Not the case…

  26. quipper/schema

  27. schema api qlink qsupport qcreate

  28. api qlink qsupport qcreate schema def api_rocks do_something end

  29. schema qlink qsupport qcreate api def api_rocks do_something end $

    bundle update
  30. schema api qlink qcreate qsupport def api_rocks do_something end def

    api_rocks do_something end def api_rocks do_something end $ bundle update $ bundle update $ bundle update
  31. schema qlink qsupport qcreate def api_rocks do_something end def api_rocks

    do_something end def api_rocks do_something end $ bundle update $ bundle update $ bundle update Necessary??
  32. https://www.flickr.com/photos/marcobellucci/3534516458

  33. Not very useful

  34. I did it very often…

  35. I did it very often… github.com/

  36. I did it very often… github.com/ dragonfly ruby github

  37. I did it very often… github.com/ dragonfly ruby github

  38. I did it very often… github.com/markevans/dragonfly dragonfly ruby github

  39. I did it very often… github.com/markevans/dragonfly/compare/ dragonfly ruby github

  40. I did it very often… github.com/markevans/dragonfly/compare/v1.0.6… dragonfly ruby github

  41. I did it very often… github.com/markevans/dragonfly/compare/v1.0.6…v1.0.7 dragonfly ruby github

  42. I did it very often… github.com/markevans/dragonfly/compare/v1.0.6…v1.0.7 dragonfly ruby github IUUQTXXXqJDLSDPNQIPUPTUIJSUFFOPGDMVCT

  43. "bundle update" should/can be more fun to review

  44. https://www.flickr.com/photos/derpoly/8288583655

  45. I did it very often… github.com/markevans/dragonfly/compare/v1.0.6…v1.0.7 dragonfly ruby github Automation!!

  46. Make links from diff

  47. Compare Linker

  48. Solution Motivation Implementation How I solved problem

  49. Compare Gemfile.lock(s) Receive webhook Build URL Post comment

  50. Compare Gemfile.lock(s) Receive webhook Build URL Post comment

  51. Webhook Payload (JSON)

  52. pull request Compare Linker Receive webhook JSON { "action": "opened",

    "number": 48, "pull_request": { "id": 18905849, "state": "open", "title": "……", /* JSON data */ }
  53. Compare Gemfile.lock(s) Receive webhook Build URL Post comment

  54. Compare Linker GitHub API Get Gemfile.lock(s)

  55. Compare Linker GitHub API Get Gemfile.lock(s) master feature

  56. Compare Linker GitHub API Get Gemfile.lock(s) master feature file =

    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 ) )
  57. Compare Linker GitHub API Get Gemfile.lock(s) master feature file =

    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.name if old_spec.version != new_spec.version updated_gems << gem end end end end
  58. Compare Linker GitHub API Get homepage_uri Rubygems API

  59. http://github.com/markevans/dragonfly

  60. Compare Gemfile.lock(s) Receive webhook Build URL Post comment

  61. Compare View URL github.com/markevans/dragonfly/compare/v1.0.6…v1.0.7 username/reponame versions (old…new)

  62. Compare View URL github.com/quipper/schema/compare/d6ba752…714ec45 username/reponame Git commit object name (old…new)

  63. Compare Gemfile.lock(s) Receive webhook Build URL Post comment

  64. Comment to pull request

  65. Solution Motivation Implementation What I made How I solved problem

    Why I needed it
  66. Solution Motivation Implementation What I made How I solved problem

    Why I needed it Retrospective
  67. Issues…

  68. Weak in Rails :(

  69. Weak in Rails :( http://www.rubyonrails.org/

  70. { "action": "opened", "number": 48, "pull_request": { "id": 18905849, "state":

    "open", "title": "……", /* JSON data */ } pull request Compare Linker git push --force
  71. Compare Linker git push --force pull request { "ref": "refs/head/xyz",

    "after": "4d2ab4e", "before": "993b46b", "created": false, "deleted": false, "forced": true, /* JSON data */ }
  72. In short: It’s "So-so" (-_-) Not very successful project

  73. https://medium.com/the-year-of-the-looking-glass/junior-designers-vs-senior-designers-fbe483d3b51e What I learnt

  74. https://medium.com/the-year-of-the-looking-glass/junior-designers-vs-senior-designers-fbe483d3b51e I was thinking… idea other

  75. https://medium.com/the-year-of-the-looking-glass/junior-designers-vs-senior-designers-fbe483d3b51e I was thinking… idea other F

  76. https://medium.com/the-year-of-the-looking-glass/junior-designers-vs-senior-designers-fbe483d3b51e Actually… idea action improvement

  77. https://www.flickr.com/photos/derpoly/8288583655 Idea is worth but…

  78. https://medium.com/the-year-of-the-looking-glass/junior-designers-vs-senior-designers-fbe483d3b51e idea < action < improvement

  79. Recap

  80. Solution Motivation Implementation I made Compare Linker I wanted to

    make "bundle update" more fun to review I implemented it upon useful APIs
  81. https://medium.com/the-year-of-the-looking-glass/junior-designers-vs-senior-designers-fbe483d3b51e Keep improvement!! idea action improvement

  82. Thank you for listening :) =end