Closed
Description
It's really important to have Reproducible Builds. It will help to check diff between the builds, so you'll be sure that you deploy only needed changes to production.
Preconditions (*)
- Magento 2.2.8 & 2.3.x
- Configured Build system on any CI (Bitbucket Pipelines in my case)
- When build created - create tar.gz or any other archive and upload it somewhere to make it availabe for downloads later (AWS S3 for instance)
Steps to reproduce (*)
- On build system make sure that you're executing
php bin/magento setup:di:compile
- Execute build preparation multiple times for single commit on two different PCs
- Download archives for all builds that you prepared
- Unpack archives and compare it with
diff -rq ./build-1/ ./build-2/
Expected result (*)
- You should have exactly the same results in generated/metadata folders
Actual result (*)
- We have diff:
Files build-1/magento2/generated/metadata/crontab.php and build-2/magento2/generated/metadata/crontab.php differ
Files build-1/magento2/generated/metadata/frontend.php and build-2/magento2/generated/metadata/frontend.php differ
Files build-1/magento2/generated/metadata/global.php and build-2/magento2/generated/metadata/global.php differ
Files build-1/magento2/generated/metadata/webapi_rest.php and build-2/magento2/generated/metadata/webapi_rest.php differ
Files build-1/magento2/generated/metadata/webapi_soap.php and build-2/magento2/generated/metadata/webapi_soap.php differ
Additional info
This issue reproducing all the time on Bitbucket Pipelines, but locally I can't reproduce it. I think it caused by using different servers on each build on CI.
If we'll try to compare these files after sorting - they actually the same. I sorted them using following script:
<?php
// Note this method returns a boolean and not the array
function recur_ksort(&$array) {
foreach ($array as &$value) {
if (is_array($value)) recur_ksort($value);
}
return ksort($array);
}
$result = include 'build-1/magento2/generated/metadata/adminhtml.php';
recur_ksort($result);
echo var_export($result);
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.3 release lineThe issue has been fixed in 2.4-develop branchGate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.3 release