Quality Patches Tool Overview and How to Efficiently Use It

vendor/bin/magento-patches apply MCTEST-1002 MCTEST-1003

Example of a log:

Overview.

The Quality Patches Tool logs all operations in the <Magento_root>/var/log/patch.log file.
Adobe Commerce on cloud infrastructure:
To apply patches to a local environment, run the next in your project root:
To install the latest QPT package, use:
The list of all available quality patches can be found in the Adobe Commercial DevDocs. More detailed information about a specific patch can be found at Adobe Commerce Help Center. 

Installation on a quality patch

We recommend using the post-install-cmd command event in composer.json to install QPT patches on projects with non-cloud infrastructure.
composer update magento/ece-tools –with-dependencies

QPT is delivered as a composer package. So, for Adobe Commerce on cloud infrastructure, the package is included in the ECE-Tools package (available from 2002.1.3 ECE-Tools version).
Example, of post-install-cmd command event in composer.json:
To install a quality patch on Adobe Commerce (on-premise) & Magento Open Source run the following:
vendor/bin/magento-patches revert —-all

Adobe Commerce (on-premise) & Magento Open-Source
vendor/bin/ece-patches apply

composer require magento/quality-patches

Applying quality patches

Before pushing quality patches to cloud instances, you should apply patches manually in a local environment and test them before you deploy.
bin/magento cache:clean

Please note that the Quality Patches Tool is for quality patches only.
QPT provides an ability to check the statuses of all quality patches.

QPT controls quality patch installation1
QPT controls quality patch installation2

Remove a necessary patch from the QUALITY_PATCHES in .magento.env.yaml.
Security patches can be found in the Magento Security Center.
Test the patches, and make any necessary changes to custom patches if needed.
“scripts”: { “post-install-cmd”: [ “bash post-install.sh” ]
}

stage: build: QUALITY_PATCHES: – MCTEST-1002 – MCTEST-1003

#!/bin/bash appliedPatches=’MCTEST-1002 MCTEST-1003′ if [ “$appliedPatches” ]
then ./vendor/bin/magento-patches apply $appliedPatches
fi

Reverting quality patches

vendor/bin/ece-patches status

Most of our readers know that Magento has security, cloud, quality, and custom patches that can be installed to fix particular website issues on Adobe Commerce or Magento Open Source platforms. 
See the example below:
Quality Patch, which was created by the Magento community, is not verified by the Adobe QA team. There is a video guide about quality patch creation by contributors.

QPT won’t allow reverting a patch twice1

Checking the patch status

Quality Patch is a fix provided by Adobe Commerce support or the Magento Open Source community to resolve a particular issue/bug in a core Magento functionality. Quality patch is available for certain Adobe Commerce/Magento Open Source versions and in most cases, it is included in the newest release.
QPT controls quality patch installation and does not allow to install a patch twice. See the example below:
You may use one of the following commands to check the statuses of quality patches for Adobe Commerce and Magento Open-Source in shell:

check the statuses of quality patches in the Site-Wide Analysis Tool (SWAT)

Logging of patching operations

Quality Patches Tool or QPT allows you to apply, revert, and view general information about quality patches available for your installed version of Adobe Commerce (for both on-premise and cloud infrastructure) and Magento Open Source.
vendor/bin/magento-patches revert MCTEST-1002 MCTEST-1003

In this post, we’ll speak about the tool released by Adobe to apply quality patches and work with them – Quality Patches Tool (QPT). In addition, we’ll describe how to use QPT on different Magento platforms and the existing best practices.