The recipe (and dependency ingredients) for code migration


Modern is a code automation company that works at Accelerate software development by automating code migration and fixes across an organization’s application stack and code base.

The OpenRewrite team also worked with Micronaut to develop and make the OpenRewrite recipe a recommended upgrade process for the latest version 3.x of Micronaut, the full-stack JVM-based framework for building microservices and serverless applications.

Here is the problem …

As we know, the development of software applications has undergone significant changes over the past ten years, spurred on by the adoption of cloud native agile development, DevOps and the growth of the API economy.

This means (obviously) that it is no longer entirely built in-house, but is integrated from open source and third-party components.

Maintaining this type of software (again, obviously) requires keeping up with the constant changes of all of these components, following common Vulnerability and Exposure (CVE) fixes, and managing thousands of APIs.

It is estimated that this takes up to 30% of the development team’s time, hampering software innovation and quality. The growth in volume, variety, and velocity of code has only exacerbated the problem.

OpenRewrite Foundation

Modern was founded to tackle this problem by Jonathan schneider and Olga Kundzich, who previously worked together at Pivotal with a number of corporate clients on unrelated technology. Moderne’s technology is based on Open Rewrite, a large-scale automated refactoring tool for code (initially Java) that Schneider developed at Netflix.

Technology was born at Netflix because of its culture of freedom and responsibility.

Targeting different parts of the software delivery lifecycle to force engineers to change code was anti-cultural, so Netflix engineers who focused on developer productivity had to think about ways to deliver service. help instead. Code automation was the only scalable solution, so OpenRewrite was born.

Moderne took over OpenRewrite and extended its scope to allow full migrations of frameworks like Spring Boot 1 to 2 and JUnit 4 to 5, security vulnerability fixes, and created many other high-level building blocks that make it easier than ever before creating custom transformations.

Modern has also started to expand into languages ​​other than Java, starting with infrastructure as code with Kubernetes, YAML, and XML refactoring.

“With the switch to the software supply chain, software development has become industrialized. We are creating more and more custom software, but producing it faster by integrating building blocks such as open source software and vendor APIs, ”said Schneider, who is now co-founder and CEO of Moderne.

“We need an open ecosystem to develop and distribute the automation of these tedious code maintenance tasks such as upgrades, common vulnerability and exposure (CVE) fixes, and internal API maintenance. It can only be solved by a community by composing increasingly complex refactoring operations and validating them on more and more code.

Schneider: Always open ecosystems.

The Modern SaaS solution applies OpenRewrite recipes on a large scale code base to find and transform millions of lines of code in minutes. This organization-wide transformational capability includes visibility of code from source to production to prioritize remediation over source code that is clearly in use in critical production systems.

The secret recipe for the sauce

OpenRewrite calls a single find or transform code into a recipe. It provides a number of building block recipes such as find method, change method, transitive dependency find, upgrade or exclude dependency. These recipes can in turn be compounded into more complex recipes by grouping them into a composite recipe.

When building blocks aren’t enough, a recipe can be written as a program in the same language as the code being transformed, which encapsulates complex logic with all the expressiveness of the language already familiar to developers. These building blocks remove a lot of detail to ensure that any changes we make to the source code obey the original style of the project.


Margie D. Carlisle