A Guide to Keeping Dependencies Up-to-Date for Enhanced Security and Efficiency in Development

Learn the importance of keeping dependencies up-to-date for a secure and efficient development process...

Maintaining your project's dependencies felt time-consuming? Having more than ten backend services and a few front-end applications can easily give me something you want to avoid. I think you are already familiar with automated tools like Dependabot and Renovate, as it is a crucial part of a healthy project.

Our context

At CommIT Smart we provide our clients with ready-to-market application services. To keep our partners' infrastructure, backend services, and frontend applications current, we provide this automated solution.

Which tools and coding languages do we use?

  • GitLab, GitLab CI

  • GoLang, Java, React, Angular, React-native, Terraform, Docker, Kubernetes, Helm

  • Renovate

How did we configure Renovate?

The automation of everything we do is done by GitLab Continuous Integration. It was extremely convenient to set up our pipeline with Renovate.

You must first create your own repository. Add the following content to gitlab-ci.yml:

include:

- project: 'renovate-bot/renovate-runner'

file: '/templates/renovate.gitlab-ci.yml'

It will take a predefined renovate.gitlab-ci.yml from the renovate-bot/renovate-runner GitLab project. The renovate.gitlab-ci.yml file contains the stages that seek new versions of your projects.

In order to include your projects you need to define a CI/CD Variable called RENOVATE_EXTRA_FLAGS. Navigate to your Gitlab repository, and Open Settings > CI/CD > Variables. Add a new variable.

We added the flag like this: RENOVATE_EXTRA_FLAGS=--autodiscover=true --autodiscover-filter=/commitsmart/.*/

Github.com token for release notes (optional) As renovate’s documentation describes:

If you are running on any platform except github.com, it’s important to also configure the environment variable GITHUB_COM_TOKEN containing a Personal Access Token for github.com. This account can actually be any account on GitHub and needs only read-only access. It's used when fetching release notes for repositories in order to increase the hourly API limit. It's also OK to configure the same as a host rule instead if you prefer that.

We created the personal access token and added a new GITHUB_COM_TOKEN variable inside our newly created renovate runner repository.

GitLab CI Scheduler

The only thing left we need to configure is the CI Scheduler. Navigate to your Gitlab repository, Open CI/CD > Schedules. Create a new scheduler with your preferences. We created the scheduler with a pattern: 0 * * * * . It runs every hour, which is frequently enough to keep our projects fresh.

Finally, the runner has been configured successfully. In order to tell renovate what would be the purpose of a given project, we will need to create the project-level configuration.

Add renovate configuration to your application repository

I picked a GoLang-based repository. Go projects have go.mod & go.sum. go.mod contains the dependencies and their versions, go. sum contains the expected cryptographic checksums of the content of specific module versions. If you update a version, you also want to run go mod tidy. It will update your go.sum file. Renovate won’t run it automatically, but it provides a solution for doing that.

Create a new file in your project root called renovate.json. We have the following configuration for one of our simplest Go project:

{

"extends": ["config:base"],

"labels": ["renovate", "dependencies"],

"postUpdateOptions": ["gomodTidy", "gomodUpdateImportPaths"],

"assigneesFromCodeOwners": true,

"packageRules": [

{

"matchUpdateTypes": ["minor", "patch", "pin", "digest"],

"automerge": true

}

]

}

First of all, it will take config:base to extend the default configuration from. labels tells renovate to add renovate & dependencies tags to the MRs created by the runner. The postUpdateOptions gives endless functions for every kind of projects, here we are able to add gomodTidy & gomodUpdateImportPaths. These will update the dependencies as we want. After creating the MRs, Renovate will assign the MRs to the code owners. It will read the CODEOWNERS file to do so (It means you need to add codeowners file first).

The tricky part is packageRules. The initial purpose was that, we would reduce the time we spend on seeking for new versions, updating, reviewing & merging the MRs. This block of code helps us too. Because of this, Renovate will automatically merge MRs which are about minor, patch, pin, digest version updates. The steps are the following:

  • Renovate first run is executing

  • Renovate checks new versions & creates MRs

  • Assign it one of our code-owners

  • Renovate first run is finished

  • Meanwhile the MR pipelines are successful

  • Renovate second run is executing

  • Renovate checks the previously opened MRs

  • If auto-merge enabled, it merges the MR

  • Renovate checks new versions & creates MRs

What does the MR look like?

We have the Release Notes for the updated package. How does the new version differ from the old one? The file is there. Is auto-merge enabled? You can also find it there. Isn't it awesome?

Summary

  • Create a new repository

  • Add gitlab-ci.yml with including the renovate-bot template

  • Add CI/CD Variables

  • Add CI/CD Scheduler

  • Add renovate configuration to application projects

Author: Csaba Ujvári

Other articles

Sep 20, 2024

Emotional Intelligence in IT Project Management

Emotional intelligence is key in IT project management. It helps leaders manage teams, resolve conflicts, and build stronger relationships, leading to more successful projects

Oct 20, 2024

Great Leaders Anticipate, Not Just React

Ready to elevate your leadership? Discover how anticipating challenges, not just reacting, can unlock success. Don't miss out on this game-changing mindset shift!...

Aug 30, 2024

How Our StemX Editors Are Revolutionizing Ticket Sales

Discover how StemX Editors are revolutionizing ticket sales with innovative design tools! See how InterTicket's new suite boosts efficiency and transforms user experiences....

AI Estimation

Let Us Provide the Perfect Solution for Your Project

Looking for accurate project estimates? Our AI-powered app helps you plan smarter. Contact us today, and we’ll provide a customized quote for your business needs — quick, reliable, and aligned with your goals.

Other articles

Sep 20, 2024

Emotional Intelligence in IT Project Management

Emotional intelligence is key in IT project management. It helps leaders manage teams, resolve conflicts, and build stronger relationships, leading to more successful projects

Oct 20, 2024

Great Leaders Anticipate, Not Just React

Ready to elevate your leadership? Discover how anticipating challenges, not just reacting, can unlock success. Don't miss out on this game-changing mindset shift!...

Aug 30, 2024

How Our StemX Editors Are Revolutionizing Ticket Sales

Discover how StemX Editors are revolutionizing ticket sales with innovative design tools! See how InterTicket's new suite boosts efficiency and transforms user experiences....

AI Estimation

Let Us Provide the Perfect Solution for Your Project

Looking for accurate project estimates? Our AI-powered app helps you plan smarter. Contact us today, and we’ll provide a customized quote for your business needs — quick, reliable, and aligned with your goals.

Other articles

Sep 20, 2024

Emotional Intelligence in IT Project Management

Emotional intelligence is key in IT project management. It helps leaders manage teams, resolve conflicts, and build stronger relationships, leading to more successful projects

Oct 20, 2024

Great Leaders Anticipate, Not Just React

Ready to elevate your leadership? Discover how anticipating challenges, not just reacting, can unlock success. Don't miss out on this game-changing mindset shift!...

Aug 30, 2024

How Our StemX Editors Are Revolutionizing Ticket Sales

Discover how StemX Editors are revolutionizing ticket sales with innovative design tools! See how InterTicket's new suite boosts efficiency and transforms user experiences....

Jun 20, 2024

Search Query Validation with React Router 6 and Yup and Typescript

Do you validate search queries in your frontend app? The answer is “sometimes”, but if you think of the search query as input for the application, you will change your mind.

Jan 28, 2024

How to Choose Between Monolithic Code and Microservices

Decipher Microservices vs. Monolithic Code: Choose wisely for a seamless development journey. Plan, embrace flexibility and avoid pitfalls. Insights from a DevOps developer.

Jan 28, 2024

Website vs Web Application: Which One Do You Need?

Decipher Microservices vs. Monolithic Code: Choose wisely for a seamless development journey. Plan, embrace flexibility and avoid pitfalls. Insights from a DevOps developer.

Sep 14, 2022

No Code Pro / Contra

No-code has caused an unusual, disruptive revelation and changes in the tech space – especially coding. Are programmers and coding still relevant or not?

Aug 14, 2022

Here are Some Reasons Why You Should Become a Software Engineer

Yes, software engineering is a good job based on virtually any criteria, including salary, the number of job openings, as well as overall job satisfaction...

Jul 14, 2022

A Guide to Working Remotely at Sea: Best Practices

Putting some effort into planning will make your entire trip more enjoyable. If you’re independently setting sail, plot a course that takes your availability into account.

Jun 14, 2022

11 Essential Skills to Become a Software Developer in 2022

Key skills for programmers and software developers to learn in 2022. If you have been doing software development for some time and thinking about what makes a good programmer?

Aug 16, 2023

How to Implement Request Validation with OAPI-Codegen and Go for Robust Development

Several of our projects require back-end as well as front-end work. If a client wants us to create RESTful APIs, we start by using the OpenAPI 3 specification.

Aug 31, 2023

The Best Way to Optimize Serverless Computing

Explore the latest features of Cloud Run for seamless deployment and scaling...

Nov 16, 2023

Discover How reCAPTCHA v3 and Cloud Armor Can Protect your Website

Discover advanced bot prevention strategies using reCAPTCHA v3 and Cloud Armor. Safeguard your website with CommIT Smart's insightful guide...

Oct 12, 2023

How to Effortlessly Automate SSL Deployment with Lego and Kubernetes

Automate SSL certificate management seamlessly with Lego and Kubernetes. Learn efficient deployment practices for a secure web environment at CommIT Smart...

AI Estimation

Let Us Provide the Perfect Solution for Your Project

Looking for accurate project estimates? Our AI-powered app helps you plan smarter. Contact us today, and we’ll provide a customized quote for your business needs — quick, reliable, and aligned with your goals.

Other articles

Sep 20, 2024

Emotional Intelligence in IT Project Management

Emotional intelligence is key in IT project management. It helps leaders manage teams, resolve conflicts, and build stronger relationships, leading to more successful projects

Oct 20, 2024

Great Leaders Anticipate, Not Just React

Ready to elevate your leadership? Discover how anticipating challenges, not just reacting, can unlock success. Don't miss out on this game-changing mindset shift!...

Aug 30, 2024

How Our StemX Editors Are Revolutionizing Ticket Sales

Discover how StemX Editors are revolutionizing ticket sales with innovative design tools! See how InterTicket's new suite boosts efficiency and transforms user experiences....

AI Estimation

Let Us Provide the Perfect Solution for Your Project

Looking for accurate project estimates? Our AI-powered app helps you plan smarter. Contact us today, and we’ll provide a customized quote for your business needs — quick, reliable, and aligned with your goals.

Other articles

Sep 20, 2024

Emotional Intelligence in IT Project Management

Emotional intelligence is key in IT project management. It helps leaders manage teams, resolve conflicts, and build stronger relationships, leading to more successful projects

Oct 20, 2024

Great Leaders Anticipate, Not Just React

Ready to elevate your leadership? Discover how anticipating challenges, not just reacting, can unlock success. Don't miss out on this game-changing mindset shift!...

Aug 30, 2024

How Our StemX Editors Are Revolutionizing Ticket Sales

Discover how StemX Editors are revolutionizing ticket sales with innovative design tools! See how InterTicket's new suite boosts efficiency and transforms user experiences....

AI Estimation

Let Us Provide the Perfect Solution for Your Project

Looking for accurate project estimates? Our AI-powered app helps you plan smarter. Contact us today, and we’ll provide a customized quote for your business needs — quick, reliable, and aligned with your goals.

Get in touch

Reach Out to Us!

Have questions or want to learn more about what we do at CommIT Smart? We’d love to hear from you! Whether you’re curious about our work or just want to start a conversation, don’t hesitate to reach out. Our team is here and ready to connect — let’s talk!

Get in touch

Reach Out to Us!

Have questions or want to learn more about what we do at CommIT Smart? We’d love to hear from you! Whether you’re curious about our work or just want to start a conversation, don’t hesitate to reach out. Our team is here and ready to connect — let’s talk!

Get in touch

Reach Out to Us!

Have questions or want to learn more about what we do at CommIT Smart? We’d love to hear from you! Whether you’re curious about our work or just want to start a conversation, don’t hesitate to reach out. Our team is here and ready to connect — let’s talk!

Get in touch

Reach Out to Us!

Have questions or want to learn more about what we do at CommIT Smart? We’d love to hear from you! Whether you’re curious about our work or just want to start a conversation, don’t hesitate to reach out. Our team is here and ready to connect — let’s talk!

Get in touch

Reach Out to Us!

Have questions or want to learn more about what we do at CommIT Smart? We’d love to hear from you! Whether you’re curious about our work or just want to start a conversation, don’t hesitate to reach out. Our team is here and ready to connect — let’s talk!

We are innovators in developing most recent web technologies, blockchain, digital technologies and apps in ingenious ways.

The D&B certificate is awarded exclusively to businesses with excellent creditworthiness. Possession of the certificate guarantees that establishing a business relationship with our company carries a low financial risk.

© 2024 Commitsmart Kft. All rights reserved.

We are innovators in developing most recent web technologies, blockchain, digital technologies and apps in ingenious ways.

The D&B certificate is awarded exclusively to businesses with excellent creditworthiness. Possession of the certificate guarantees that establishing a business relationship with our company carries a low financial risk.

© 2024 Commitsmart Kft. All rights reserved.

We are innovators in developing most recent web technologies, blockchain, digital technologies and apps in ingenious ways.

The D&B certificate is awarded exclusively to businesses with excellent creditworthiness. Possession of the certificate guarantees that establishing a business relationship with our company carries a low financial risk.

© 2024 Commitsmart Kft. All rights reserved.

We are innovators in developing most recent web technologies, blockchain, digital technologies and apps in ingenious ways.

The D&B certificate is awarded exclusively to businesses with excellent creditworthiness. Possession of the certificate guarantees that establishing a business relationship with our company carries a low financial risk.

© 2024 Commitsmart Kft. All rights reserved.

We are innovators in developing most recent web technologies, blockchain, digital technologies and apps in ingenious ways.

The D&B certificate is awarded exclusively to businesses with excellent creditworthiness. Possession of the certificate guarantees that establishing a business relationship with our company carries a low financial risk.

© 2024 Commitsmart Kft. All rights reserved.