Patcher Use Cases

Patcher Use Cases

Some examples of scenarios where Patcher can be useful

Use case 1: Update to Terraform 1.0 automatically

  • Use Patcher to update your Terraform code from an older version (e.g. 0.11) all the way up to the latest version (e.g. 1.0) automatically.
  • Patcher does this using Patch Files, which transform code automatically (e.g. switching from HCL1 to HCL2 syntax or updating source URLs to compatible module versions) and open pull requests with the results.
  • You can use off-the-shelf Patch Files created by Gruntwork (e.g. we offer Terraform upgrade patches such as tf-13-to-14.patch, tf-14-to-15.patch, etc) or create your own Patch Files!

Use case 2: Automatically patch a severe security vulnerability in Ruby on Rails

  • In CVE-2013-0333, a severe security vulnerability was found in Ruby on Rails that allowed remote attackers to execute arbitrary code, conduct SQL injection attacks, or bypass authentication.
  • You can use Patcher to automatically update your Rails app to fix this vulnerability.
  • Patcher can not only update you to the new version of Ruby on Rails, but also make the necessary changes to your app code to ensure the vulnerability is fully fixed.

Use case 3: Update to a new version of an internal utility

  1. Let's say you are the maintainer of a security.jar library that is used by 300 microservices (300 other teams) within your company.
  2. When you open a pull request with some changes to security.jar, Patcher automatically finds all the services that depends on security.jar, runs their tests with your updates, and shows you the results, so you know if you made breaking changes.
  3. If you did make breaking changes, you can create a Patch File to patch those services, and Patcher will show you the results of both applying your Patch File and executing the tests of each service.
  4. Once all tests are passing, you merge, release a new version of security.jar, and Patcher opens pull requests against all those services to update them to the new version.

Use case 4: Update to React 17.0 automatically

  • React 17.0 is a major release that had a number of breaking changes. As an example, one of the breaking changes in this release is that returning undefined from forwardRef and memo components is an error and you should return null instead.
  • Use Patcher to update your code to React 17.0, by applying a Patch File that, among other things, ensures that forwardRef and memo components never return undefined.