Keeping Your Codebase up to Date Has Never Been Easier

Oren Shahar
AppsFlyer Engineering
4 min readMar 20, 2022

“We want to keep our codebase up to date, but the migrations are so frustrating, exhausting, and time-consuming.”

You know how it goes. You start a new project, write some code, import your company’s internal libraries, and perhaps use some third-party libraries. Everything works like a charm.

But as time goes by, your company and product demands grow. More teams contribute to your codebase, the third parties you continually use release new versions, and all of a sudden you find yourself with an unmaintained code, slow performance UI, and all kinds of tech debt. 😱

The AppsFlyer codebase has grown quite a bit in the past few years, and a lot of code upgrades and maintenance actions have been made. In this article, I will walk you through the process of finding a solution for this problem through our Hackathon project, which won my team second place.
I’ll also talk about why this problem is so painful, and ultimately, the solution we provided.

Why Do We Need To Maintain Our Codebase?

Handling and maintaining our codebase is not a simple task; it takes a lot of effort. Let’s specify the reasons for taking on this mission in the first place.

Maintain Consistent UI and Infrastructure Across All of Our Services

Our product consists of microservices. Each team is responsible for parts of them, and some microservices have a frontend app. We of course would like for all of them to look alike and behave the same way.

Improve UI/UX (Accessibility, Loading Speed)

Today, performance is crucial. Accessibility has become standard in all web applications, and we want to keep loading all of our services quickly, and provide a seamless user experience. This ultimately forces us to continuously update our in-house and third-party libraries.

Eliminate Vulnerabilities

We often need to upgrade third-party libraries to fix security issues.

Migrations are Hard to Follow

So why is it so hard to follow up on cross-team migration?
The first thing we need to remember is that we are dealing here with human beings. Each person has their own tasks, and it’s a challenge to get everyone’s cooperation. In addition, getting overall status in chat or email is not always accurate. This is due to the fact that we have the habit of reporting what we think will happen, and not what has happened already.

Because we don’t have an accurate status of migrated services, it is hard for managers to follow this process and estimate each migration deadline.

The AppsFlyer Solution

When we decided to tackle this problem, we considered several solutions.

  • One option was to create an npm module that prints a scoring report for each service (the scoring reflects the service migrations/alignment status), and a suggested solution per gap that we found.
  • Another option was to use Gitlab API to search our codebase and look for the package.json file (which usually holds dependencies versions for frontend and Node.js services).
  • The third option was to use renovate (https://github.com/renovatebot/renovate), which automates dependency updates and is multi-platform and multi-language.
  • The last option (and the chosen one) was to scan the GitLab codebase through an external SaaS solution, and run an analysis on it.

We didn’t have time to implement this “in-house”, especially for the Hackathon. Using another SaaS solution gave us extra capabilities and relevant features such as advanced filtering and projects classification.

The Solution in Depth

Ok, so it’s Hackathon day and we are good to go with our solution. We’ve established our initial goal — to analyze only the frontend services as an MVP, and later on, to expand to other project types.

We’ve created several migration entities, each consisting of several required versions of dependencies. And after scanning our GitLab codebase, running the data, and analyzing each package.json and webpack.config.js file, we gave each service a “score” that reflects its current alignment status.

sunlight dashboard demo screenshot

In addition, for motivational purposes, we gave each team a score according to the number of dependencies that required an update in order to be aligned with the company’s standard.

sunlight ranking screen demo screensh

We easily created the API, and then the magic happened!
We now have live data, driven from our codebase that reflects that service’s status. Amazing!!!

We added some basic (and appealing) UI, showed the status in a nice pie chart, and eventually gave kudos to the teams that got the highest score (did someone mention public shaming?! 😜)

After pitching this idea with live data, we made it to second place.

So What’s In It for AppsFlyer?

AppsFlyer has already taken this Hackathon project and leveraged it, and we now support Go and Clojure services as well.

With this solution, we get live and accurate data instead of relying on verbal reporting. In addition, the solution is scalable; expanding it to other codebases is very easy.

We get real-time overall status of our company codebase, and team leaders can now easily see their team’s tech depth status and generate action items (aka Jira tickets) accordingly. We also attached tutorials links to each of the migration list items.

--

--