Store Composer patches locally rather than referencing them directly from drupal.org
Introduction
The use of remote patches applied by composer results in risk to the project due to the possibility of the remote file changing or ceasing to exist. The use of local patches speeds project build because the patch already exists locally, and eliminates the possibility of the patch changing or ceasing to exist unexpectedly. Contents of remote patches can potentially change leading to unexpected build issues. Detailed guidance can be found on our wiki page on composer patches.
Decision
All patches to be applied by composer should be downloaded and placed in the /patches directory in the project root to be referenced by composer. Drupal patch files for contributed modules should be named according to the following convention
{{module_name}}-{{issue_number}}-{{comment_number}}.patch
Context
Drupal is one of our most common use cases for composer patches. As drupal.org moves to handling code collaboration in gitlab, remote patches become more complicated.
Consequences
- Decreased install speed and risk from downloading remote patches.
- Increased repo size.
Exceptions
- None
Additional Resources
None