Drupal Patch Check Helps Audit and Repair Patches Before Upgrades
Designed to reduce manual patch review during Drupal upgrades, Drupal Patch Check is a Composer plugin that reports whether patches still apply, conflict with a release, have already been incorporated upstream or cannot yet be judged. Drupal core committer Théodore Biadala documented the tool after using it on a heavily patched Drupal project.
The plugin addresses a recurring upgrade problem: a patch that was once necessary may still be required, may no longer apply cleanly, or may no longer be needed because its fix has shipped in a newer release. Drupal Patch Check compares the site's declared patches with the Drupal.org releases Composer selects and can also evaluate them against a target Drupal core version.
Biadala's September 7 walkthrough demonstrates that process on a project carrying 51 patches. The initial scan reported 35 that still applied and 16 conflicts. Further rerolling identified one patch whose fix was already present upstream and automatically repaired two others, leaving the remaining cases for developer review.
The current command set separates checking from project changes. composer drupatch:check evaluates patches without writing anything, while composer drupatch:reroll can rewrite patches that merge cleanly and expose unresolved regions when they do not. composer drupatch:pin copies remote patches into the site so future installs do not depend on mutable merge-request URLs.
Forward-looking checks are available through --target. In Biadala's example, patches from a Drupal 10.2.4 site were evaluated against Drupal 11.4.6, allowing the tool to distinguish patch conflicts from cases where a contributed-project release or the site's own Composer constraints blocked the upgrade.
The project has continued to evolve beyond the original walkthrough. Current documentation includes drupatch:add for bringing in Drupal.org issue or merge-request patches and drupatch:upgrade-patch-manager for moving sites from version 1 to version 2 of cweagans/composer-patches.
Drupal Patch Check relies on a remote service operated by Très Bien Tech. The plugin sends patch data and selected Composer information for public Drupal.org packages to api.tresbien.tech, where it performs the release comparison. It skips packages not identified as Drupal.org projects, including private and custom packages.
Developers can inspect the exact outbound request before contacting the service by running composer drupatch:check --dry-run. The current documentation also supports using the tool after Composer updates and in continuous integration.
The plugin does not remove the need for developer judgement. Ambiguous conflicts still need resolution, malformed patches may remain unusable, and a site still needs testing after its patch set changes. Its value is in reducing a large patch inventory to the subset that actually needs human attention.
Biadala's Très Bien Tech walkthrough provides the detailed real-world example, while the project documentation covers the current command set and supported workflows.
References
-
-
Drupal Patch Check, Très Bien Tech


