AD0-E717 practice question 3 of 15

What folder would a developer place a custom patch on an Adobe Commerce Cloud project to have it automatically applied during the build phase?

Full set: 77 questions
Answer options
A: Add the patch file to the m2-hotfixes/ directory Correct answer
B: Add the patch file to the patches/ directory
C: Add the patch file to the m2-patches/ directory
Correct Answer:
A. Add the patch file to the m2-hotfixes/ directory
Explanation

The Adobe Commerce on Cloud Infrastructure build process is specifically configured to automatically apply patches during the build phase. To enable this functionality, developers must place custom patch files (with a .patch extension) into the m2-hotfixes/ directory at the root of the project. The build script automatically detects and applies any patches found in this directory before the composer install command is executed, ensuring the fixes are in place before dependencies are resolved and the application is assembled.

Why Incorrect

B. Add the patch file to the patches/ directory: This directory is not automatically scanned by the Adobe Commerce Cloud build process for applying patches. While some projects use a patches/ directory with tools like cweagans/composer-patches, it is not the standard for automatic application on Cloud infrastructure.
C. Add the patch file to the m2-patches/ directory: This is an incorrect directory name. The officially designated directory for custom patches that are automatically applied during the build phase is m2-hotfixes/.

References

1. Adobe Commerce on Cloud Infrastructure Guide, "Apply patches": "To apply a custom patch that is not available from Adobe, you can add the patch file to the /m2-hotfixes directory in your project. The patch is applied automatically during the next build and deployment." (Found in the section "Apply a custom patch").

2. Adobe Commerce on Cloud Infrastructure Guide, "Build process": The documentation on the build process details the sequence of events, confirming that patches from the m2-hotfixes directory are applied early in the process. "Patches in the /m2-hotfixes directory are applied before the composer install command during the build phase." (Found in the section "Build phase").

Scroll to Top