Skip to content

Conversation

@danielrenaud
Copy link

@danielrenaud danielrenaud commented Dec 21, 2017

Issue

https://jira.corp.magento.com/browse/MAGETWO-52209

CE base package overwrites EE base package.

build    21-Apr-2016 11:49:29	     [exec] start magento deploy for magento/magento2-ee-base
build    21-Apr-2016 11:49:30	     [exec] start magento deploy for magento/magento2-base

Any duplicate files in ee-base are overwritten by ce-base. By design ee-base should overwrite ce-base.

To Reproduce

This issue is difficult to reproduce since it is random and occurs seldom.
Run the following command and check the last few lines to verify the order of deployment:

composer create-project magento/project-enterprise-edition=2.2.0 /path/to/somedir --stability=dev --repository-url='https://repo.magento.com/ -vvv

Expected result

ce-base is deployed before ee-base

build    21-Apr-2016 11:49:30	     [exec] start magento deploy for magento/magento2-base
build    21-Apr-2016 11:49:29	     [exec] start magento deploy for magento/magento2-ee-base

@magento-cicd2
Copy link

magento-cicd2 commented Dec 21, 2017

CLA assistant check
All committers have signed the CLA.


if (isset($this->sortPriority[$package->getPackageName()])) {
$result = $this->sortPriority[$package->getPackageName()];
} elseif (isset($this->highPriority[$package->getPackageName()])) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The highPriority check should be first so it's used even if the package appears in both highPriority and sortPriority.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Change made.

$packagePriority = $this->highPriority[$package->getPackageName()];
$result = intval($maxPriority) + intval($packagePriority);
} elseif ($package->getDeployStrategy() instanceof Copy) {
$result = 101;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this specific value? Are Copy packages supposed to be before/after packages that have a specific priority? As written they could be in the middle of packages in the sortPriority array if that array has entries on both sides of 101. If they're supposed to be last, instead of specifically 101, use min - 1 similar to how you're using max + highPriority.

Copy link
Author

@danielrenaud danielrenaud Dec 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy packages should have a higher default priority than the default priority for other packages. So keeping the default priority as 100 and the default for Copy packages as 101 maintains this behavior. A package can define whatever priority they wish so they could have always had it higher priority than Copy packages. So this is different than highPriority and keeping these values maintains the current behavior.

@slavvka slavvka changed the title MAGETWO-52209: Inconsistent composer behaviour [Borg] MAGETWO-52209: Inconsistent composer behaviour Dec 29, 2017
@slavvka slavvka merged commit 8b6c32f into magento:master Dec 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants