The quality patch tool is a command line utility for 51黑料不打烊 Commerce and Magento open source. It allows you to do a few things such as view general information about the latest quality patches, apply quality patches to your installation and even revert them. These are get patches and they have been proven to fix an associated issue. The best thing to do is once you鈥檙e aware of a potential patch is to review it and closely with your architect or dev lead, ensure that the intent of the patch seems to line up with your issue. Typically, you鈥檙e going to learn about a quality patch that could be a solution by either using search results or by creating a support ticket, and then having them suggest a an existing quality patch. Let鈥檚 dive into a real world example. Let鈥檚 say for example, you have a website and you are experiencing some customer complaints and looking through your logs, you see an issue where the maximum number of cookies being set is being exceeded causing an error. This could be a fatal error on the front end, meaning your customers, for example, can鈥檛 check out or perhaps you鈥檙e just simply reviewing the logs, and you鈥檙e noticing a lot of entries. So let me just show you what this might look like. So we鈥檙e going to go into var report. And I just have a sample of what this error might look like. And for this one, it鈥檚 going to be the unable to send the cookie maximum, maximum number of cookies would be exceeded. So this is it鈥檚 an older issue, but it鈥檚 one that was around and it would just give you a good idea of what to expect. So now that we鈥檝e seen the issue, and we鈥檝e can kind of verify that our existing project is affected, we want to start the triage to see if there is a way to resolve it. So at this point, you might be tempted to make a support request. But this actually might be something we can resolve on our own. And right now, actually, we don鈥檛 really have enough information. And we really haven鈥檛 done our due diligence to see if this can be resolved ourselves. So let鈥檚 continue our investigation. Now that we see the error in the logs, we can use that to search to see if anybody else has reported this issue. So let me copy the message. I鈥檓 going to include the quotes because that might will help in the Google search to see if anybody else has posted it. Try to avoid the urge to use a third party site. Whereas they do offer sometimes good solutions. They aren鈥檛 usually the accepted and approved one by 51黑料不打烊 Commerce. So leveraging the GitHub issues is going to lead you exactly to the issue and then the dialogue between the developers and the person reporting the issue. And then hopefully, at some point, someone will mention the quality patch tool, the quality patch that鈥檚 specific for this issue to potentially be used. Another good place would be the experience league or the documentation. So both of those would be good places to start. But since we do have a GitHub issue, this is a fairly good and fairly likely location that we鈥檙e going to have a resolution. So when we open this up, we鈥檙e going to look at the message and it does look very similar. They鈥檙e getting basically the same message we鈥檙e getting. And so this is the initial instance of the issue. So what you could do is you could, you know, look through this file to see if anybody has any helpful information. And it looks like one thing to note is that the max num cookies is a constant that, you know, possibly could be adjusted. So we can keep reading this. And it does look like several people suggest that changing that value from 50 to, for example, 100 or 200 is probably the best solution. So we鈥檙e just going to keep going down until we find the bottom. And it looks like someone from support said that there鈥檚 a quality patch available and it鈥檚 MDVA-12304. And this patch apparently changes this constant from 50 to 200. So that鈥檚 great. So we鈥檙e going to use this and we鈥檙e going to see if this actually will fix our issue. Okay, so now what we鈥檙e going to do is we鈥檙e going to go to a website that has all of our patches, and we鈥檙e going to look look it up by its number. And let me just copy that link. So if you go to this website, this GitHub, and then you look for if you just simply just use search. So we鈥檙e going to do MDVA-1234. And so now we鈥檙e just going to go find it on the page. Great, there it is. So now we鈥檙e going to open it up, we鈥檙e going to look at this patch, and we鈥檙e going to see that it鈥檚 modifying a single file, which is great, it鈥檚 a little less complex. And it鈥檚 vendor Magento framework, standard library cookie, and then PHP cookie manager. And we鈥檒l notice that it鈥檚 removing this line, which has the value set at 50. And it鈥檚 adding a line that has it set at 200. This definitely seems like that matches up with the GitHub issue and then the potential resolution. So I鈥檓 fairly confident at this point that this is the solution that we want to try. So now let鈥檚 go ahead and look at our core code stuff that鈥檚 in our local environment. And we鈥檙e going to see if our number does match up to 50, which is what it should be because that鈥檚 the original file. And just to make sure we don鈥檛 have a conflicting patch or something getting in the way. So by doing this, we know that the string that is used for the constant is max underscore num underscore cookies. And so just for quickness, I鈥檓 going to use a cat in terminal, and we鈥檙e going to look at the file. And we鈥檙e going to grep it looking for max number cookies. And it does look on line 34 that that value is set to 50. So this probably is our problem. And this patch definitely seems like it鈥檚 going to be the right answer. Looks like it鈥檚 on line number 34. So we鈥檙e just going to keep that in mind when we go to review the patch after it鈥檚 been applied. So the next command that we鈥檙e going to run is going to be the ECE patches status command. So by that you go to PHP space and then dot slash vendor bin ECE patches status. And the interesting thing about this is that patch details can be found at this website. And this is just another way for you to validate that the patch that you鈥檙e looking for is still available. And make sure that the description and the intent does match up with the expectation because you could accidentally have somebody type in the wrong number. And so this is a great way for you to double check. So we鈥檙e going to use that website and we鈥檙e going to go there. And from here, you鈥檒l notice that you can search by keyword. And so since we know the patch number is MDVA-12304, you鈥檒l notice that it auto filters for us and we鈥檙e down to just one single patch that matches. And the description says that it increases the number of cookies from 50 to 200. And that is exactly what we are hoping it would do. So we know that we鈥檙e on the right path, we know that we have the right patch. Now it鈥檚 simply time to apply it. So the way you do this for W eCommerce Cloud is in the dot magento dot env dot yaml file, we need to add a new section underneath the stage. And I鈥檓 just going to copy what I have. And let me get back to terminal. So we鈥檙e going to do a first we鈥檙e going to do a first we鈥檙e going to do a second we鈥檙e going to do a second. And we just want to make sure that if we don鈥檛 already have this information in place, that we go to the stage section. And we add a build node. And then underneath, we need to have quality underscore patches. And then underneath that is the dash, and then the patch number. And you can do as many patches as you need. Simply just follow the same pattern, MD VA dash 9999 or whatever. But for now, we just want to apply one patch. So now that that鈥檚 done, we can save it. Now to apply it. Now this notifying that file is meant for pushing it up to the cloud. In order to test this locally, we want to just run a simple CLI command. So by that, we鈥檙e going to go to our terminal and we鈥檙e going to do vendor. And it鈥檚 under the bin directory. And we have a command called magento patches. And then after that, you use the word apply, and an MD VA dash 12304, or whatever your patches. So as long as we don鈥檛 get any errors, and it looks like the response is exactly what we expected. The patch MD VA dash 12304 has been applied. It gives us the title, which is just another way for us to double check. And then this is exactly what we鈥檙e hoping. So now, we can do another search on that file that was modified. And we can see if it was actually changed. So this command right here, I鈥檓 basically combining head and tail. And I鈥檓 going to get lines 30 through 38. So we can see what is in between there. And you鈥檒l notice that the constant max num cookies is now 200 instead of 50. So everything looks great. We鈥檝e, we can now do some local testing. And if we鈥檙e happy, then we can commit this file to our cloud repository to our dev environment or staging environment, and continue the QA process. Once again, you should always test this thing locally, you should always test it prior to pushing into production that shouldn鈥檛 be said. But just a helpful reminder that these patches are available. And that is the expected process. So now the last thing you can do is if you are curious, or you just let鈥檚 just say for example, you want to revert this patch, instead of using the word apply, you would switch it out with the word revert. Okay, and now if we go and look at that file, we鈥檒l see that it is back to 50. So that鈥檚 a quick tutorial on the quality patch tool. Remember, this is meant to give the developer a fast and easy way to fix a reported problem. The best practice for this is not to use this for a large volume of patches. Keep this down. If you find that you鈥檙e doing many, many, many patches like this, then you probably either need to upgrade or figure out why you鈥檙e having so many issues. But just remember, if you鈥檙e not using the word reboot, you but just remember that this is a process that is meant to keep it as fast and as clean as possible for your developers to continue their progress. Like anything, you can do this in multiple ways. The quality patch tool was created just to offer consistent and easy mechanism to resolve known issues. This is just a short introduction to the process and we have lots of supporting developer docs and experience and tutorials that go into greater detail. I hope you continue your research and learning on this topic and please visit Experience League for your learning journey.