DZone
DevOps Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > DevOps Zone > Automate Task Creation With the TODO Bot

Automate Task Creation With the TODO Bot

Do you litter your code with "TODO" keywords so you'll remember to come back to them? With this handy GitHub bot, you'll never have to remember again. Maybe.

Chris Ward user avatar by
Chris Ward
CORE ·
Feb. 20, 20 · DevOps Zone · Tutorial
Like (1)
Save
Tweet
14.34K Views

Join the DZone community and get the full member experience.

Join For Free

Like many of you (I hope), I tend to litter my code and articles with TODOs, while in the flow of coding or writing. I intend to return to and act on them at some point, but like many good intentions, and especially tasks, finding them again is one part of the problem. 

I like to have tasks assigned to me in issue trackers so I can more easily find them, and adding todo's in the middle of code or documents (I’m looking at you Google Docs!) doesn’t surface them enough for my liking.

A few months ago, I came across the wonderful todo GitHub app from Jason Etco, which he built with Probot. The app parses your code for TODOs or other keywords and adds them as GitHub issues with preconfigured assignees, labels, and more.

You might also like: What Is DevOps? The Beginner’s Guide

Install and Configure

Add todo app to GitHub repositories

Install the app in your repo by visiting the app page and clicking the Configure button. Because of GitHub permissions, you may not be able to install the app in all the repositories you want to, or you may need to ask for permission to an organization administrator. If you do have the correct permissions, you can install the app in all your repositories, or particular repositories. 

The todo app has sensible defaults, assigning a todo to the committer, so it works as soon as you install it, but you probably want to dive in to tweak settings for individual repositories, especially those you collaborate on with others.

Before we push any code and create issues, let’s change a few settings.

As with other GitHub apps, you need to create a .github folder at the top level of your repo, and inside that, a config.yml file. Here are the settings you can change, all of which are child keys of the todo key:

todo:
    keyword: ["@todo", "TODO", "TODO:"]
    autoAssign: true
    bodyKeyword: ["@body", "BODY"]
    blobLines: 10
    caseSensitive: false
    label: ["todo", "bot"]
    reopenClosed: true

Most of the settings are reasonably self-explanatory, but you can find a full reference in the project read me.

The settings above configure the todo app to do the following:

  • Look for three keywords in your code
  • Automatically assign the issues to whoever pushed the change; you can add an array of manual user names instead
  • Add any text to the issue body equal to the value(s) of bodyKeyword (found in your code)
  • Includes the ten following lines of code in the issue body
  • Adds two labels
  • Reopens any matching issues already closed

Push Your Productivity

You can see the todos in my code on this search page, and to trigger the bot, you need to push to any branch. If you push to a branch that already has a PR in progress, the app adds it as a comment instead of a new issue. Helpfully, the app also tries it’s best to close issues once the matching text is removed as part of a PR.

And voila! Issues automatically created every time you add them. Now all you have to do next is actually work on the issues, but that’s a whole other story.

Further Reading

9 Features That Make a Great Task Management Tool

Five Tasks IT Should Be Having Automated

Task (computing) app code style

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How to Build Security for Your SaaS User Communications
  • Which JVM Version Is the Fastest?
  • How to Make Git Forget a Tracked File Now in .gitignore
  • RestTemplate vs. WebClient

Comments

DevOps Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo