This blog was contributed by Drupal Association Supporting Partner, Palantir.net.

Every major new release of Drupal brings new features and functionality that enable the creation of cutting-edge digital experiences. Drupal’s core software is just part of the story, however. Much of Drupal’s power and flexibility comes from contributed modules created by its developer community, which are updated with every major release of the software. 

In the past, adoption of new Drupal releases has often been slowed by the fact that many key contributed modules have not been updated until several weeks or months after the release of the core software. Beginning with Drupal 8, upgrading a module for compatibility with a new major release requires removing code that has been deprecated in a previous release. While much easier than past versions of Drupal, upgrading modules was still a manual process requiring a lot of repetitive work. 

Working Smarter, Not Harder

In late 2019, with the release of Drupal 9 around the corner, members of the team at Palantir.net began to think about ways to streamline the process of making Drupal 8 modules fully compatible with Drupal 9. By reducing the amount of time required to make the modules that our clients use compatible with the latest version of Drupal, we hoped to make it faster and easier for more people to take advantage of the benefits of Drupal 9.

As part of our initial research, we came across a proof of concept that leveraged an open source tool named Rector. In coordination with the original developer, our team took this proof of concept, pared it down to its essentials, greatly expanded coverage, and published it under a new name, Drupal Rector. This tool was designed to automatically identify and fix code deprecations needed to make Drupal 8 modules compatible with Drupal 9. 

A Community Effort

One of the advantages of Rector is that the tool gets better the more data it has, so by working in the open, we could leverage the shared knowledge and expertise of the Drupal community in order to accelerate development. In addition to the Palantir team members allocated to this effort (Dan Montgomery, Ofer Shaal, Kelsey Bentham, Ju Vanderwater, Ken Rickard, and Daniel Serna), we also invited others in the community to participate, leading contribution sprints at several Drupal events in the winter and spring of 2020, including Florida DrupalCamp and MidCamp.

The next step was to make Rector available to as many other Drupal developers as possible so that they could more easily update their own modules. Gábor Hojtsy of Acquia’s Drupal Acceleration Team developed a Drupal interface for the project and also reported Rector coverage in Acquia’s Drupal 9 Deprecation Status dashboard. Drupal project lead Dries Buytaert also helped promote the project and even contributed to it at one point!

In May of 2020, the Drupal Association announced a partnership with Acquia and Palantir to automatically provide patches generated by Drupal Rector for all contributed modules possible. These patches were posted to issues created by the new Project Update Bot, which was developed by Acquia’s Ted Bowman for the Drupal Association.

Making a Measurable Impact

In the four months leading up to the launch of Drupal 9, Rector rules had been created for the top 50 Drupal core deprecations, covering over 72% of core deprecations that are used by contrib modules. As Dries observed, “Drupal Rector is getting *good* coverage *fast*.” Drupal Association CTO Tim Lehnen added, “This is an incredible milestone! Imagine how much labor from our open source contributors we can save.”

By Drupal 9’s release date on June 3, 2020, 95 of the top 100 contributed projects and 166 of the top 200 were Drupal 9 ready. As Gábor Hojtsy noted, “This is unprecedented in Drupal's recent history.”

Planning for the Future

Only one year after Drupal 9’s launch, we are already starting to prepare for the release of Drupal 10, which is currently anticipated for release in June 2022. While Palantir team members have continued to work on the Drupal 9 version of Drupal Rector, we are also sponsoring Matt Glaman’s work to make sure that the tool is ready for Drupal 10. You can even follow Matt’s progress live on his Twitch stream!

In the meantime, companies and organizations looking to upgrade their sites from Drupal 8 to Drupal 9 can continue to take advantage of Drupal Rector and help futureproof their sites for years to come. 

An Open Source Success Story 

The story of Drupal Rector is that of open source at its best. By building on existing knowledge and experience, working in the open, and inviting others to participate and share in the results, a relatively small team of people doing the right work at the right time can create measurable impact for an entire community and ecosystem.