I am not a big fan of bots, particularly chatbots. I find most of them obnoxious. It irritates me when Google takes...
me to a page that greets me with the "How can I help you?" popup. And my irritation can quickly turn into frustration and anger when I actually take the bait only to end up in a ridiculous conversation negotiating with a chatbot that has a working vocabulary smaller than my dog's.
It can be a whole lot of no fun.
This doesn't mean that bot development can't provide value. A bot that provides a specific and competent service is useful. An effective bot doesn't have to do a lot, but what it does, it has to do well. It doesn't need to seem human. In fact, I find that the best bots don't interact with humans much at all. Rather, they tend to be lurkers that observe the environment and a take action when things go wrong.
Bots have three jobs
Their job is to do three things. First, they try to correct an issue, if possible. Second, they notify parties of interest that the issue has been corrected or, should correction not be possible, describe the issue at hand. Finally, they provide exact instructions as to how to fix the issue.
For example, imagine a situation in which an external library is used in an application subject to do a CI/CD build. Part of the CI/CD process is to have a source code repository bot that can determine that the external library has been built from source. You'll want to build the external library from source to ensure code safety. If the source code repository bot notices the third-party library is not built from scratch, it stops the build and sends out the usual "Danger Will Robinson" emails. But the bot also provides instructions that describe how to build the external library from scratch. This small piece of instruction is a simple, but valuable addition.
Practical bot development does not only prevent bad things from happening, but also lets interested parties know about the problem and provides instruction about how to make things better. It helps the affected parties help themselves.
These three actions might seem trivial, but they're not. In the DevOps environment, bot development and activity can be more than messages on a Slack channel or emails in an inbox that might or might not get read. A DevOps bot that actually does something more than simple incident reporting adds a good deal of value.
Bot development for Git repositories
One area that I am seeing a lot of opportunity for implementing instructive validation in bot development is around source code management, particularly in the Git ecosystem. Just about all the popular Git-based source control tools such as GitHub, Bitbucket and GitLab support webhooks.
You can think of a webhook as a message emitter. When an event happens in a repository -- a pull request, for example -- intelligence in the repository sends a message, usually in the form of an HTTP POST to a predefined URL. Intelligence on the receiving URL, which is essentially a bot, accepts the message and processes it accordingly. The intelligence can perform some logic and then pass the results onto another destination such as a Slack channel. Or the response can be passed back to the repository via the Git platform's API, if need be.
The important thing to understand is that repository webhooks provide the means by which bots can interact with a source code repository and perform instructive validation as part of their response behavior.
There's already a good deal of work to do with repository bot development. Probot provides a framework that simplifies bot writing by adding a wrapper around the GitHub webhook architecture. The framework makes programming easier. Kore.ai is a bot development tool that allows developers to create fairly powerful bots using a low-code, graphical interface. A Kore.ai bot can be integrated with Bitbucket, GitHub and GitLab.
Tools such as these will make bot development a lot easier. However, just because you can make a bot does not necessarily mean you have a useful bot. Believe me, the world does not need another confusing session with a chatbot. One bot that does one thing really well is better than an army of bots that cause confusion and frustration.
In terms of DevOps in general and source control management in particular, bots that do instructive validation can be a huge boost. Remember, it's a three-step process: validate, report and educate. A bot that helps folks help themselves will go a long way in making your DevOps environment a better, easier place in which to work.
Learn Git fast
Interested in learning more about Git? Check out these Git tutorials and resources:
- Find out about the five basic Git commands every developer needs to know.
- Learn how to configure Git for optimal usage.
- Manipulate your commit history with git reset hard.
- Git cherry-pick what you like from other branches.
- Change the default Git text editor to Notepad++.
- See how well you'd do on these Git quiz questions.