-
Notifications
You must be signed in to change notification settings - Fork 9.4k
[Fixed: #31396] Data/Schema Patches getAliases() not working as expected #37682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…date patch aliases in db regardless of patch application
Hi @MatthijsBreed. Thank you for your contribution! Add the comment under your pull request to deploy test or vanilla Magento instance:
❗ Automated tests can be triggered manually with an appropriate comment:
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@@ -24,6 +24,7 @@ | |||
use Magento\Framework\Setup\SchemaSetupInterface; | |||
use Magento\Framework\Setup\SetupInterface; | |||
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; | |||
use phpDocumentor\Reflection\Types\True_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be removed, or not?
use phpDocumentor\Reflection\Types\True_; |
@@ -296,4 +292,38 @@ public function revertDataPatches($moduleName = null) | |||
} | |||
} | |||
} | |||
|
|||
/** | |||
* Checks if patch should be applied by already applied patch alias names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Checks if patch should be applied by already applied patch alias names | |
* Check if patch should be applied by already applied patch alias names |
if ($patch = $patch->getAliases()) { | ||
foreach ($patch as $patchAlias) { | ||
if ($this->patchHistory->isApplied($patchAlias)) { | ||
$shouldApply = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variable assigning is not necessary, you can use return
directly
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run Unit Tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@sippsolutions , thank you for your feedback. I have checked all failing tests, but after the last commit, the only tests that are failing are urelated functionalities, are these blocking for this PR or is there another way to resolve them? Unit Tests fail on 'Magento\CatalogGraphQl\Test\Unit\DataProvider\Product\SearchCriteriaBuilderTest::testBuild' Functional tests fail on "Magento\AcceptanceTest_InventorySingleModeSuite_0_G\Backend\StorefrontValidateVisualSwatchAbsenceOfAttributeWhenProductStocksOutTestCest::StorefrontValidateVisualSwatchAbsenceOfAttributeWhenProductStocksOutTest" and "Magento\AcceptanceTest_default\Backend\AdminApplyChangePriceForConfigurableProductWithAssignedSimpleProductsTestCest::AdminApplyChangePriceForConfigurableProductWithAssignedSimpleProductsTest" Webapi tests fail on 'Magento\GraphQl\Catalog\ProductSearchTest::testFilterProductsBySingleCategoryId' |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run Functional Tests B2B, Functional Tests EE, Functional Tests CE, Integration Tests, Unit Tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @MatthijsBreed,
Thanks for the contribution!
Code changes look good to me and failed tests seem flaky.
Hence approving this PR.
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
We are not able to reproduce the issue. To Reproduce the issue we have followed below steps.
Also please refer to this abc8e696. Lets us know if you are still facing the issue on 2.4-develop with detailed steps. Moving it to |
The reproduction steps you described you described are the problem this PR aims to solve. Current (incorrect) situation:
Desired situation:
Please see the PR description and the issues linked therein |
I have followed the step mentioned here Before PR
![]() After PR Changes
![]() Let us know if we have missed anything here. |
@MatthijsBreed can you please have a look at comment and suggest if we are missing anything here? |
@MatthijsBreed did you get time to have a look at comment ? |
Hi @MatthijsBreed, Thank you for your contribution! As mentioned here, please have a look and let us know if we are missing anything. Till then closing this PR. Please feel free to reopen it as you want to update further. Thank you! |
Description (*)
This PR fixed next issues #31396 #23031
This PR is a continuation of work in PR 31635 (#31635) to account for every patch alias that might be already applied and to persist any new patch aliases
Fixed Issues (if relevant)
#31396 #23031
Testing Scenario
1. Create new Data Patch and apply via
bin/magento setup:upgrade
2. See that patch is added to
patch_list
in the database3. Rename Data Patch file and add old name to aliases
4. Re-run
bin/magento setup:upgrade
5. See that the new patch name is added to
path_list
but the apply() function has not been called