Skip to content

Commit

Permalink
Merge branch 'poc-meaningful-semantic-understanding-of-file-changes' of
Browse files Browse the repository at this point in the history
https://github.com/AmpersandHQ/ampersand-magento2-upgrade-patch-helper into poc-meaningful-semantic-understanding-of-file-changes
  • Loading branch information
convenient committed Nov 8, 2023
2 parents 94c99d5 + 09863b8 commit 65f74d0
Show file tree
Hide file tree
Showing 21 changed files with 210 additions and 22 deletions.
14 changes: 10 additions & 4 deletions dev/Docker/setup-magento-with-diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ else
$COMPOSER_TO install --no-interaction --ignore-platform-reqs
fi
# Spoof some changes into our "third party" test module so they appear in the diff
echo "<!-- -->" >> vendor/ampersand/upgrade-patch-helper-test-hyva-fallback-theme/theme/Magento_Customer/templates/account/dashboard/info.phtml
echo "<!-- -->" >> vendor/ampersand/upgrade-patch-helper-test-hyva-theme-stub/theme/Magento_Checkout/templates/cart/form.phtml
echo "<!-- -->" >> vendor/ampersand/upgrade-patch-helper-test-module/src/module/view/frontend/templates/checkout/something.phtml
echo "<!-- -->" >> vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Checkout/templates/cart/form.phtml # ensure that third party theme modifications show as expected
echo "<span/>" >> vendor/ampersand/upgrade-patch-helper-test-hyva-fallback-theme/theme/Magento_Customer/templates/account/dashboard/info.phtml
echo "<span/>" >> vendor/ampersand/upgrade-patch-helper-test-hyva-theme-stub/theme/Magento_Checkout/templates/cart/form.phtml
echo "<span/>" >> vendor/ampersand/upgrade-patch-helper-test-module/src/module/view/frontend/templates/checkout/something.phtml
echo "<span/>" >> vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Checkout/templates/cart/form.phtml # ensure that third party theme modifications show as expected
rm vendor/ampersand/upgrade-patch-helper-test-module/src/module/Model/ToPreferenceAndDelete.php
rm vendor/ampersand/upgrade-patch-helper-test-module/src/module/Model/ToPreferenceAndExtendAndDelete.php
echo '//not-meaningful' >> vendor/ampersand/upgrade-patch-helper-test-module/src/module/Model/ToPreferenceAndIgnore.php
Expand All @@ -115,6 +115,10 @@ echo '$b=1;' >> vendor/ampersand/upgrade-patch-helper-test-module/src/module/Se
cp vendor/ampersand/upgrade-patch-helper-test-module/src/module/etc/db_schema.after.xml vendor/ampersand/upgrade-patch-helper-test-module/src/module/etc/db_schema.xml
rm vendor/ampersand/upgrade-patch-helper-test-module-to-be-removed/src/module/etc/db_schema.xml

if [[ "$MAGE_TO" == 2.3* ]]; then
echo "<span/>" >> vendor/magento/module-bundle/view/frontend/templates/js/components.phtml
fi

# Ensure all test cases that were in the 2.2 series tests are represented in others
echo "//some change" >> vendor/magento/module-sales/Block/Adminhtml/Order/Create/Form.php
echo "<!-- --><p>some change</p>" >> vendor/magento/module-ui/view/base/web/templates/block-loader.html
Expand All @@ -123,11 +127,13 @@ echo "<!-- --><p>some change</p>" >> vendor/magento/module-ui/view/base/web/tem
echo " " >> vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Ui/web/templates/redundant.html
echo " " >> vendor/ampersand/upgrade-patch-helper-test-module/src/module/view/frontend/email/redundant.html
echo " " >> vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Checkout/web/js/redundant.js
echo " " >> vendor/ampersand/upgrade-patch-helper-test-hyva-theme-stub/theme/Magento_Checkout/templates/cart/redundant.phtml

# Ignored change
echo "<!-- -->" >> vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Ui/web/templates/ignore.html
echo "<!-- -->" >> vendor/ampersand/upgrade-patch-helper-test-module/src/module/view/frontend/email/ignore.html
echo "/* some comment */" >> vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Checkout/web/js/ignore.js
echo "<!-- -->" >> vendor/ampersand/upgrade-patch-helper-test-hyva-theme-stub/theme/Magento_Checkout/templates/cart/ignored.phtml

echo "#" >> vendor/magento/module-customer/view/frontend/web/js/model/authentication-popup.js

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>ignored - some customisation</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>redundant</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>ignored - base</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>redundant</p>
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
*/
?>
<?= $block->getChildHtml() ?>
<!-- We have overridden this file -->
<p>We have overridden this file</p>
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
?>
<!-- Upgrade file changes get patched here!-->
<?= $block->getChildHtml() ?>
<!-- We have overridden this file -->
<p>We have overridden this file</p>
5 changes: 3 additions & 2 deletions dev/phpunit/functional/expected_output/magentom23.out.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@
| WARN | Preference | vendor/magento/module-authorizenet/Model/Directpost.php | Ampersand\Test\Model\WebApiSoap\Directpost |
| WARN | Preference Removed | vendor/ampersand/upgrade-patch-helper-test-module/src/module/Model/ToPreferenceAndDelete.php | Ampersand\Test\Model\ToPreferenceAndDelete |
| WARN | Preference Removed | vendor/ampersand/upgrade-patch-helper-test-module/src/module/Model/ToPreferenceAndExtendAndDelete.php | Ampersand\Test\Model\ToPreferenceAndExtendAndDelete |
| WARN | Redundant Override | vendor/ampersand/upgrade-patch-helper-test-hyva-theme-stub/theme/Magento_Checkout/templates/cart/redundant.phtml | vendor/ampersand/upgrade-patch-helper-test-hyva-theme-extended/theme/Magento_Checkout/templates/cart/redundant.phtml |
| WARN | Redundant Override | vendor/ampersand/upgrade-patch-helper-test-module/src/module/view/frontend/email/redundant.html | app/design/frontend/Ampersand/theme/Ampersand_TestVendor/email/redundant.html |
| WARN | Redundant Override | vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Checkout/web/js/redundant.js | app/design/frontend/Ampersand/theme/Magento_Checkout/web/js/redundant.js |
| WARN | Redundant Override | vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Ui/web/templates/redundant.html | app/design/frontend/Ampersand/theme/Magento_Ui/web/templates/redundant.html |
+-------+--------------------------+------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
WARN count: 65
WARN count: 66
INFO count: 309 (to view re-run this tool with --show-info)
IGNORE count: 5 (to view re-run this tool with --show-ignore)
IGNORE count: 6 (to view re-run this tool with --show-ignore)
For docs on each check see https://github.com/AmpersandHQ/ampersand-magento2-upgrade-patch-helper/blob/master/docs/CHECKS_AVAILABLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@
| WARN | Preference | vendor/magento/module-authorizenet/Model/Directpost.php | Ampersand\Test\Model\WebApiSoap\Directpost |
| WARN | Preference Removed | vendor/ampersand/upgrade-patch-helper-test-module/src/module/Model/ToPreferenceAndDelete.php | Ampersand\Test\Model\ToPreferenceAndDelete |
| WARN | Preference Removed | vendor/ampersand/upgrade-patch-helper-test-module/src/module/Model/ToPreferenceAndExtendAndDelete.php | Ampersand\Test\Model\ToPreferenceAndExtendAndDelete |
| WARN | Redundant Override | vendor/ampersand/upgrade-patch-helper-test-hyva-theme-stub/theme/Magento_Checkout/templates/cart/redundant.phtml | vendor/ampersand/upgrade-patch-helper-test-hyva-theme-extended/theme/Magento_Checkout/templates/cart/redundant.phtml |
| WARN | Redundant Override | vendor/ampersand/upgrade-patch-helper-test-module/src/module/view/frontend/email/redundant.html | app/design/frontend/Ampersand/theme/Ampersand_TestVendor/email/redundant.html |
| WARN | Redundant Override | vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Checkout/web/js/redundant.js | app/design/frontend/Ampersand/theme/Magento_Checkout/web/js/redundant.js |
| WARN | Redundant Override | vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Ui/web/templates/redundant.html | app/design/frontend/Ampersand/theme/Magento_Ui/web/templates/redundant.html |
+-------+--------------------------+------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
WARN count: 66
WARN count: 67
INFO count: 309 (to view re-run this tool with --show-info)
IGNORE count: 5 (to view re-run this tool with --show-ignore)
IGNORE count: 6 (to view re-run this tool with --show-ignore)
For docs on each check see https://github.com/AmpersandHQ/ampersand-magento2-upgrade-patch-helper/blob/master/docs/CHECKS_AVAILABLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@
| WARN | Preference | vendor/magento/module-weee/Model/Total/Quote/Weee.php | Ampersand\Test\Model\WebApiSoap\Total\Quote\Weee |
| WARN | Preference Removed | vendor/ampersand/upgrade-patch-helper-test-module/src/module/Model/ToPreferenceAndDelete.php | Ampersand\Test\Model\ToPreferenceAndDelete |
| WARN | Preference Removed | vendor/ampersand/upgrade-patch-helper-test-module/src/module/Model/ToPreferenceAndExtendAndDelete.php | Ampersand\Test\Model\ToPreferenceAndExtendAndDelete |
| WARN | Redundant Override | vendor/ampersand/upgrade-patch-helper-test-hyva-theme-stub/theme/Magento_Checkout/templates/cart/redundant.phtml | vendor/ampersand/upgrade-patch-helper-test-hyva-theme-extended/theme/Magento_Checkout/templates/cart/redundant.phtml |
| WARN | Redundant Override | vendor/ampersand/upgrade-patch-helper-test-module/src/module/view/frontend/email/redundant.html | app/design/frontend/Ampersand/theme/Ampersand_TestVendor/email/redundant.html |
| WARN | Redundant Override | vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Checkout/web/js/redundant.js | app/design/frontend/Ampersand/theme/Magento_Checkout/web/js/redundant.js |
| WARN | Redundant Override | vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Ui/web/templates/redundant.html | app/design/frontend/Ampersand/theme/Magento_Ui/web/templates/redundant.html |
| WARN | Redundant Override | vendor/magento/theme-frontend-blank/etc/view.xml | vendor/ampersand/upgrade-patch-helper-test-hyva-fallback-theme/theme/etc/view.xml |
| WARN | Redundant Override | vendor/paypal/module-braintree-core/view/base/web/js/form-builder.js | vendor/paypal/module-braintree-core/view/frontend/web/js/form-builder.js |
+-------+--------------------------+------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
WARN count: 60
WARN count: 61
INFO count: 395 (to view re-run this tool with --show-info)
IGNORE count: 6 (to view re-run this tool with --show-ignore)
IGNORE count: 7 (to view re-run this tool with --show-ignore)
For docs on each check see https://github.com/AmpersandHQ/ampersand-magento2-upgrade-patch-helper/blob/master/docs/CHECKS_AVAILABLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
| WARN | Preference | vendor/magento/module-weee/Model/Total/Quote/Weee.php | Ampersand\Test\Model\WebApiSoap\Total\Quote\Weee |
| WARN | Preference Removed | vendor/ampersand/upgrade-patch-helper-test-module/src/module/Model/ToPreferenceAndDelete.php | Ampersand\Test\Model\ToPreferenceAndDelete |
| WARN | Preference Removed | vendor/ampersand/upgrade-patch-helper-test-module/src/module/Model/ToPreferenceAndExtendAndDelete.php | Ampersand\Test\Model\ToPreferenceAndExtendAndDelete |
| WARN | Redundant Override | vendor/ampersand/upgrade-patch-helper-test-hyva-theme-stub/theme/Magento_Checkout/templates/cart/redundant.phtml | vendor/ampersand/upgrade-patch-helper-test-hyva-theme-extended/theme/Magento_Checkout/templates/cart/redundant.phtml |
| WARN | Redundant Override | vendor/ampersand/upgrade-patch-helper-test-module/src/module/view/frontend/email/redundant.html | app/design/frontend/Ampersand/theme/Ampersand_TestVendor/email/redundant.html |
| WARN | Redundant Override | vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Checkout/web/js/redundant.js | app/design/frontend/Ampersand/theme/Magento_Checkout/web/js/redundant.js |
| WARN | Redundant Override | vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Ui/web/templates/redundant.html | app/design/frontend/Ampersand/theme/Magento_Ui/web/templates/redundant.html |
Expand Down Expand Up @@ -456,14 +457,15 @@
| INFO | Setup Patch Data | vendor/ampersand/upgrade-patch-helper-test-module/src/module/Setup/Patch/Data/SomeDataChanges.php | Ampersand\TestVendor\Setup\Patch\Data\SomeDataChanges |
| INFO | Setup Patch Schema | vendor/ampersand/upgrade-patch-helper-test-module/src/module/Setup/Patch/Schema/SomeSchemaChanges.php | Ampersand\TestVendor\Setup\Patch\Schema\SomeSchemaChanges |
| INFO | Setup Script | vendor/ampersand/upgrade-patch-helper-test-module/src/module/Setup/InstallSchema.php | Ampersand\TestVendor\Setup\InstallSchema |
| IGNR | Override (phtml/js/html) | vendor/ampersand/upgrade-patch-helper-test-hyva-theme-stub/theme/Magento_Checkout/templates/cart/ignored.phtml | vendor/ampersand/upgrade-patch-helper-test-hyva-theme-extended/theme/Magento_Checkout/templates/cart/ignored.phtml |
| IGNR | Override (phtml/js/html) | vendor/ampersand/upgrade-patch-helper-test-module/src/module/view/frontend/email/ignore.html | app/design/frontend/Ampersand/theme/Ampersand_TestVendor/email/ignore.html |
| IGNR | Override (phtml/js/html) | vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Checkout/web/js/ignore.js | app/design/frontend/Ampersand/theme/Magento_Checkout/web/js/ignore.js |
| IGNR | Override (phtml/js/html) | vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Ui/web/templates/ignore.html | app/design/frontend/Ampersand/theme/Magento_Ui/web/templates/ignore.html |
| IGNR | Override (phtml/js/html) | vendor/magento/module-catalog/view/frontend/layout/catalog_category_view_type_default.xml | app/design/frontend/Ampersand/theme/Magento_Catalog/layout/catalog_category_view_type_default.xml |
| IGNR | Override (phtml/js/html) | vendor/magento/module-vault/view/frontend/web/js/view/payment/method-renderer/vault.js | app/design/frontend/Ampersand/theme/Magento_Vault/web/js/view/payment/method-renderer/vault.js |
| IGNR | Preference | vendor/ampersand/upgrade-patch-helper-test-module/src/module/Model/ToPreferenceAndIgnore.php | Ampersand\Test\Model\ToPreferenceAndIgnore |
+-------+--------------------------+------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
WARN count: 60
WARN count: 61
INFO count: 395
IGNORE count: 6
IGNORE count: 7
For docs on each check see https://github.com/AmpersandHQ/ampersand-magento2-upgrade-patch-helper/blob/master/docs/CHECKS_AVAILABLE.md
Loading

0 comments on commit 65f74d0

Please sign in to comment.