-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Fix magento root package identification for metapackage installation #22116
Fix magento root package identification for metapackage installation #22116
Conversation
Hi @oleksii-lisovyi. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
Hi @ihor-sviziev, thank you for the review. |
@@ -148,7 +148,6 @@ public function getRequiredExtensions() | |||
/** @var CompletePackageInterface $package */ | |||
foreach ($this->getLocker()->getLockedRepository()->getPackages() as $package) { | |||
$requires = array_keys($package->getRequires()); | |||
$requires = array_merge($requires, array_keys($package->getDevRequires())); | |||
$allPlatformReqs = array_merge($allPlatformReqs, $requires); |
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.
Why do change this instead of because isMagentoRoot works incorrectly for installation
?
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.
It collects all packages from composer.lock file and collects all require and require-dev dependencies. But during composer install - require-dev dependencies are getting from composer.json file only. So fix is correct.
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.
@ihor-sviziev your statement does not answer my question.
The root issue: method $this->isMagentoRoot() returns FALSE for current Magento installation, because its regular expression /magento/magento2...?/ doesn't match magento/project-community-edition, that comes from metapackage.
Quote from the issue. Collected package information must be different depending whether it is a dev Magento installation or Composer-based.
@@ -92,7 +92,7 @@ public function testGetRequiredPhpVersion($composerDir) | |||
public function testGetRequiredExtensions($composerDir) | |||
{ | |||
$this->setupDirectory($composerDir); | |||
$expectedExtensions = ['ctype', 'gd', 'spl', 'dom', 'simplexml', 'mcrypt', 'hash', 'curl', 'iconv', 'intl']; | |||
$expectedExtensions = ['ctype', 'gd', 'spl', 'dom', 'simplexml', 'mcrypt', 'hash', 'curl', 'iconv']; |
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.
Does not match https://github.com/magento/magento2/blob/2.3-develop/composer.json#L30. Why do we need this test at all? How it works for outdated PHP versions?
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.
@nmalevanec was fixing this integration test in #21137, then this forward port was created from that PR.
I think he fixed it incorrectly. I'll talk with him
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.
Hi,
As we discussed with @nmalevanec - he'll fix tests in correct way internally. And he already pushed some changes for fixing integration tests. I'm approving this PR.
Hi @ihor-sviziev, thank you for the review. |
684abc8
to
b0a899b
Compare
@@ -148,7 +148,6 @@ public function getRequiredExtensions() | |||
/** @var CompletePackageInterface $package */ | |||
foreach ($this->getLocker()->getLockedRepository()->getPackages() as $package) { | |||
$requires = array_keys($package->getRequires()); | |||
$requires = array_merge($requires, array_keys($package->getDevRequires())); | |||
$allPlatformReqs = array_merge($allPlatformReqs, $requires); |
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.
@ihor-sviziev your statement does not answer my question.
The root issue: method $this->isMagentoRoot() returns FALSE for current Magento installation, because its regular expression /magento/magento2...?/ doesn't match magento/project-community-edition, that comes from metapackage.
Quote from the issue. Collected package information must be different depending whether it is a dev Magento installation or Composer-based.
@ihor-sviziev thanks for sorting this out in Slack. @oleksii-lisovyi please squash changes into a single commit so that we have perfectly clean history 😉 |
b0a899b
to
a2ad630
Compare
All good here, waiting for @oleksii-lisovyi returning back from vacation 🉑 |
Hi @oleksii-lisovyi, |
Hi. I can, but what is the advantage of having single commit comparing to couple? |
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.
@oleksii-lisovyi we always must strive to as few logically separated commits as possible.
Fix integration test
commit does not make sense as separate commit.
Please squash all three commits into one and force push.
1df503d
to
2c91e5a
Compare
@orlangur please review |
Hi @ihor-sviziev, thank you for the review.
|
✔️ QA Passed |
Hi @orlangur, thank you for the review. |
Hi @oleksii-lisovyi, thank you for your contribution! |
…r metapackage installation #22116
Description (*)
Fix issue with failing Magento installing process (
php bin/magento setup:install
) for installation via metapackage, because of issue in root package defining.Fixed Issues (if relevant)
Manual testing scenarios (*)
Steps to reproduce could be takes from issue.
Contribution checklist (*)