Most of the effort in building software goes into the maintenance of the code that already exists. Once the software is built, many factors affect its performance over time. We need to fix bugs, address security vulnerabilities, make performance improvements, and decrease technical debt.
Managing a single piece of software is easy but as a developer, we often have to deal with more than one. And this is exactly where maintenance gets hard. The best way to handle Maintenance debt is to upgrade the dependencies on which our project depends regularly.
All these problems can be solved by automation. At RavSam, we use Github for our code handling and Github Apps and Github Actions for CI/CD purposes.
Contents
- Renovate - Automated Dependency Updates
- Imgbot - Automated Image Optimization
- RavSam Bot - A Github Probot App
Renovate - Automated Dependency Updates
Renovate is one of those apps that make our idea of automated maintenance a reality. It is a free, open-source, customizable GitHub app that helps us to automatically update our dependencies in software projects by receiving pull requests and that too for multiple languages.
The best part is that you can write a single config and use it for all of your projects in your GitHub organization. Here is a Renovate bot config that we use at RavSam:
{
"extends": ["config:base", "group:monorepos"],
"dependencyDashboard": false,
"automergeType": "branch",
"major": {
"enabled": false
},
"packageRules": [
{
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
"automerge": true,
"labels": ["dependencies"]
},
{
"depTypeList": ["devDependencies"],
"schedule": ["before 9am on the first day of the month"],
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
"automerge": true,
"labels": ["dev-dependencies"]
}
],
"prCreation": "not-pending",
"schedule": ["before 9am every weekend"],
"stabilityDays": 3,
"timezone": "Asia/Kolkata"
}
We have configured Renovate to run the development dependencies updation process only on the first day of the month to prevent noise and distractions. We have enabled auto-merge when the update type is one of the following: minor, patch, pin, or digest.
Imgbot - Automated Image Optimization
The performance of a Web App is often dependent on the images. Hence it is crucial to optimize images or else lose customers. Another advantage of optimized images is that it reduces the bandwidth costs for us as well as our visitors.
We love Imgbot app. It optimizes the images and creates a pull request against our default branch - master. Imgbot is verified by GitHub which means there is no point worrying about the security.
RavSam Bot - A Github Probot App
We have built our custom serverless GitHub Probot - RavSam Bot, our employee #1. It helps us automate various tasks like managing issues by raising their priority, assigning confirmed issues to developers, assigning reviewers to the pull requests, auto-merging them once the changes have been approved, and many more things.
A fun fact about this bot is that it has made more commits than the actual humans.
Probot apps are easy to write, deploy, and share. We have deployed our probot app on Netlify Functions and it spends the entire day doing mundane tasks for us tirelessly.