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

Automate workflow with Ruby

Automate workflow with Ruby

a talk at Jakarta.rb
lightning talk at Geekcamp.id 2017

Didik Wicaksono

December 02, 2016
Tweet

More Decks by Didik Wicaksono

Other Decks in Programming

Transcript

  1. Automate Workflow
    with Ruby .
    Didik Wicaksono

    View full-size slide

  2. •github: @firewalker06
    •twitter: @did1k

    View full-size slide

  3. We inspire people through Cooking

    View full-size slide

  4. I’m with
    ID-Ruby Community
    •We will have our first Ruby
    Conference in Indonesia on Oct
    6th-7th (ruby.id/cfp)
    •Please support our association:
    PERKODI (ruby.id/perkumpulan)

    View full-size slide

  5. !" > 50 engineers, serving 66
    countries with 17 languages

    View full-size slide

  6. ⛏ Workflow in a glance
    •Starts with a Hypothesis
    •Organize Task
    •Development & Code Review
    •Deploy & Announce Release

    View full-size slide

  7. https://sourcediving.com/hypothesis-driven-
    development-6b3c7a4a53fc

    View full-size slide

  8. I’m sure you already
    familiar with these services

    View full-size slide

  9. Workflow breakdown
    •discuss hypothesis
    •create a card
    •assign card
    •create a branch
    •do magic
    •push a branch
    •create a pull request
    •code review
    •merge pull request
    •deploy code
    •announce release in
    Slack
    •mark card /
    checklist as
    completed

    View full-size slide

  10. Looks repetitive
    •On Slack
    •discuss hypothesis
    •On Trello
    •create a card
    •assign card
    •On local
    •create a branch
    •do magic
    •push a branch
    •On Github
    • create a pull request
    • code review
    • merge pull request
    • Back to local again
    • deploy code
    • Back to Slack again
    • announce release in
    Slack
    • Finally on Trello
    • mark card / checklist as
    completed

    View full-size slide

  11. If its repetitive, we
    can automate!

    View full-size slide

  12. Looks good?
    •On Slack
    •discuss hypothesis
    •On local
    •create a card
    •assign card
    •create a branch
    •do magic
    •push a branch
    •create a pull request
    •code review
    •merge pull request
    •mark card / checklist
    as completed
    •On Slack
    • deploy code
    •announce release in
    Slack

    View full-size slide

  13. trello-flow

    View full-size slide

  14. trello-flow
    We uses a lot of Trello boards

    View full-size slide

  15. trello-flow
    •github.com/balvig/trello_flow
    •available commands:
    ‣ git open 

    # Open relevant card/all users card in browser
    ‣ git start

    git start 

    # choose card, assigns self & creates branch
    ‣ git finish 

    # checks off task, opens PR
    ‣ git cleanup 

    # cleans up merged card branches

    View full-size slide

  16. Some element of code
    reviews can be
    automated

    View full-size slide

  17. •github.com/bbatsov/rubocop
    •Ruby static code analyzer
    •enforce styleguide
    •run in development

    View full-size slide

  18. •houndci.com
    •uses rubocop to review Ruby
    •supports various languages
    including js, coffeescript and
    scss
    •integrated with Github

    View full-size slide

  19. CP-8 Cookpad Bot

    View full-size slide

  20. CP-8 Cookpad Bot
    • github.com/balvig/cp-8
    • This little fella helps simplify
    your frequent labelling in Github
    • Deployable to Heroku

    View full-size slide

  21. CP-8 Cookpad Bot
    Opening a PR with "[WIP]" in the title adds WIP label

    View full-size slide

  22. CP-8 Cookpad Bot
    Approving changes adds Reviewed label

    View full-size slide

  23. CP-8 Cookpad Bot
    Tells you when a PR has no updates

    View full-size slide

  24. CP-8 Cookpad Bot
    Attach and moves Trello cards around

    View full-size slide

  25. capistrano-fiesta

    View full-size slide

  26. capistrano-fiesta
    •github.com/balvig/capistrano-
    fiesta
    •integrates Github pull requests
    and Slack
    •compiles list of github PR since
    last release

    View full-size slide

  27. capistrano-fiesta
    reads “Release note” in PR description

    View full-size slide

  28. capistrano-fiesta
    Sends slack
    announcement

    View full-size slide

  29. capistrano-fiesta
    compiles list of PR in github.com/[repo]/releases

    View full-size slide

  30. Ruby + Bot = Ruboty

    View full-size slide

  31. ruboty
    •github.com/r7kamura/ruboty
    •its a bot, built in Ruby
    •deployable to Heroku
    •supports various chat services
    and some DBs

    View full-size slide

  32. Everyday on Cookpad
    •Trello-flow
    •Rubocop and Hound
    •CP-8 Bot
    •Capistrano-fiesta
    •Ruboty

    View full-size slide

  33. Everyday on Cookpad
    •Trello-flow
    •Rubocop and Hound
    •CP-8 Bot
    •Capistrano-fiesta
    •Ruboty

    View full-size slide