Our view on The Magento Quality Patches Tool

Magento Quality Patches

Magento released The Magento Quality Patches package last year and we took it for a quick test to understand it better. Developed by Magento, this is a self-service tool that provides a faster self-service issue resolution process. The package delivers individual patches and allows you to easily apply, revert, and view general information about all individual patches that are available for the installed version of Magento Commerce or Magento Open Source.

Magento Quality Patches works well with both Magento Commerce (Cloud and OnPrem) and Magento Open Source, but there are some slight differences in the way it is installed and applied on Cloud and non-Cloud versions.

Visit our website to find out about our services

Magento Quality Patches and Magento Cloud Patches
If you are familiar with Magento Cloud Patches, then we can fairly say that Magento Quality Patches extends its features. If Magento Cloud Patches delivers only a small amount of the most critical fixes, the difference for Magento Quality Patches is that it delivers optional, low-impact quality fixes as individual patches, which do not contain backward-incompatible changes. Users will have to apply them only on a case by case basis, and only the ones that are needed. In fact, Magento strongly advises against using the Magento Quality Patches package to apply large numbers of patches because it increases the complexity of the code, which makes upgrading to a new version of Magento more difficult. Both Magento Quality Patches and Magento Cloud Patches packages can be used as stand-alone packages for Magento Open Source and Magento Commerce projects.

Installing Magento Quality Patches
For Magento Commerce Cloud, MQP comes installed out of the box, with the latest version of ECE Tools Package, the set of scripts and tools designed to manage and deploy Magento Commerce Cloud projects. Therefore, users with an old version of Magento Commerce Cloud that does not contain the ECE Tools Package will have to upgrade their project.

For the other versions, MQP is delivered as a Composer package. Installing Magento Quality Patches is pretty straightforward. If haven’t already done it, you will need to have Git or Patch installed. Using the command “composer require magento/quality-patches” will update your composer.json file and will place the Magento Quality Patches script in the vendor/bin folder.

At OAK3, we have great expertise in developing eCommerce platforms for B2B and B2C online stores. If you want to know more about our services, please contact us or drop us an email at hello@oak3.agency.

What info will we see in the status table?
The items seen in the status table differ slightly depending again on whether you are using a Cloud or a non-Cloud version. For Magento Commerce Cloud, patches included in the Magento Cloud Patches package will be applied first, and will show as “Required”. Magento Commerce Cloud will also show “Custom” patches, which are all patches from the ‘m2-hotfixes’ directory.

So, excluding the “Required” and “Custom” patches that show only for Magento Commerce Cloud, all patches from the MQP package are shown as “Optional” for Magento Commerce OnPrem and Magento Open Source installations. If Magento has deprecated an individual patch, it will show as “Deprecated” in the list, and in the event that you have applied the patch, we recommend that you revert it. The revert operation also removes the patch from the status table.

The Status section will show you if the patch has been applied or not, and the Details section will explain the list of affected Magento modules, the list of patches that must be applied for an indicated patch to work properly (dependencies), and the patch that is a recommended replacement for a deprecated patch.

Applying Magento Quality Patches
There are some differences between applying Magento Quality Patches depending on whether you are using a Cloud or a non-Cloud environment.

Magento Commerce Cloud
Applying the patches in a Cloud environment is pretty straightforward. When changes are deployed, ECE tools checks for pending patches and applies them automatically in the following order:
– all “Required” patches included in the Magento Cloud Patches package

– selected “Optional” patches included in the Magento Quality Patches package.
To select the “Optional” Magento Quality Patches to be applied, the user will have to Add the ‘QUALITY_PATCHES’ variable to the “magento.env.yaml” file, list the required patches underneath.
1   stage:
2     build:
3         QUALITY_PATCHES:
4           – patch ID 1
5           – patch ID 2
and then commit and push the updated file.

– “Custom” patches in the /m2-hotfixes directory in alphabetical order by patch name.

Magento Commerce OnPrem and Magento Open Source
For non-Cloud environments, the patches can be applied using commands.
“./vendor/bin/magento-patches apply ID1” will apply the specified “ID1” patch, ID1 being the patch ID. By separating each patch ID with space, several patches can be applied. There are several other commands that can be used and users can easily revert a patch or all the patches that have been applied.

Then, to see the changes in the Magento application, the cache needs to be cleared.

There are a few things that Magento strongly recommends. First of all, testing all patches in a Staging environment should be done before deploying to the Production environment. Second, as Magento periodically releases new individual patches, the MQP package has to be constantly updated to get new individual patches.
When you upgrade to a new version of Magento, you must re-apply patches if the patches are not included in the new version.

At OAK3, we have great expertise in developing eCommerce platforms for B2C and B2B online stores. If you want to know more about which platform you should choose for your e-shop, please contact us or drop us an email at hello@oak3.agency. We’re here to help!

Visit our website to find out about our services