-
Notifications
You must be signed in to change notification settings - Fork 33
Magento Quality Patches - improvement of dev experience #61
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
…agento - Added support of magento/magento2ce and magento/magento2ee installed from git tag
…ch is causing a conflict
95a0cbb
to
d2e0b3a
Compare
d4140df
to
6f52a82
Compare
InputOption::VALUE_OPTIONAL, | ||
'Is git installation', | ||
false | ||
self::ARG_LIST_OF_PATCHES, |
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 is BC change, it should not go into patch version release
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's a new command - ./magento-patches apply,
./ece-patches apply remains without changes
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.
@shiftedreality or you mean removing of --git-installation option?
Previously we discussed this with Bohdan and Olexandr, agreed that we can just not call ./ece-patch apply command from ece-tools in case of git installation
@@ -14,6 +14,7 @@ | |||
"symfony/dependency-injection": "^3.3||^4.3", | |||
"symfony/process": "^2.1||^4.1", | |||
"symfony/proxy-manager-bridge": "^3.3||^4.3", | |||
"symfony/yaml": "^3.3||^4.0", | |||
"monolog/monolog": "^1.16", | |||
"magento/quality-patches": "^1.0.0" |
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 causes circular dependency and must be moved to another package
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.
The packages have a dependency on each other and the composer resolves them without issues. Why it should be moved?
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.
Having circular dependency is never good idea, in some cases, it lead to neverending dependency resolving and other problems. This may be either included in ECE-Tools or MCC
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.
And circular dependency consieded as "bad smell" from Architecture Design standpoint
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.
Having circular dependency is never good idea, in some cases, it lead to neverending dependency resolving and other problems. This may be either included in ECE-Tools or MCC
I agree with you, in case of recursive read it can lead to neverending resolving.
In the current case we A => B and B => A. Composer resolves it well.
Otherway, if we move dependency on quality-patches to ece-tools, it will be impossible to install magento-cloud-patches from the composer separately, as described in docs
P.S. It will be possible, but impossible to use.
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.
"magento/quality-patches" dependency was moved to suggest section
@shiftedreality please review
src/ApplicationEce.php
Outdated
protected function getDefaultCommands() | ||
{ | ||
return array_merge(parent::getDefaultCommands(), [ | ||
$this->container->get(Command\ApplyEce::class), |
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's better to move the classes under sub-namespace Command\Ece\Apply
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.
Make sense, in progress ... thanks
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.
@shiftedreality fixed, please check
@@ -4,7 +4,8 @@ | |||
* Copyright © Magento, Inc. All rights reserved. | |||
* See COPYING.txt for license details. | |||
*/ | |||
define('IS_CLOUD', 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 is redundant since ApplicationEce already Cloud-aware
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.
Yes, but there is CloudCollector service that is used by both applications and we need to define what is the environment to set patch type optional or required https://github.com/magento-mpi/magento-cloud-patches/blob/65837e0a187dfa282e47be67c7dc1cd349643709/src/Patch/Collector/CloudCollector.php#L94
src/Command/Process/ApplyLocal.php
Outdated
} catch (ApplierException $exception) { | ||
$this->printInfo($output, 'Error: patch conflict happened'); |
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.
Use the color tags instead of status, <error></error>
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 also must return corrent non-zero exit code
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.
Use the color tags instead of status,
<error></error>
Will be fixed, thanks
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 also must return corrent non-zero exit code
It throws RuntimeException which leads to non-zero exit code
https://github.com/magento-mpi/magento-cloud-patches/blob/65837e0a187dfa282e47be67c7dc1cd349643709/src/Command/Process/ApplyLocal.php#L101
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.
@shiftedreality fixed, please check
src/Command/Revert.php
Outdated
*/ | ||
const ARG_QUALITY_PATCHES = 'quality-patches'; | ||
const ARG_LIST_OF_PATCHES = 'list_of_patches'; |
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.
Cloud Tools use hyphens instead of underscores
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.
Will be fixed, thanks
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.
@shiftedreality fixed, please check
/** | ||
* Variable to define a Cloud environment. | ||
*/ | ||
const ENV_VAR_CLOUD = 'MAGENTO_CLOUD_PROJECT'; |
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 is not needed since you have separate entry point for Cloud
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.
The reason is that Status command is common for ece-patches and magento-patches. This command shows a table with patch type. I believed that is good to show all Clod patches as required even if the customer runs './magento-patches status' on the Cloud environment. Otherway cloud patches will display as optional. Does it make sense?
- fixes after CR
- fixes after CR
- fix table render for Symfony < 4
QA approved |
MCLOUD-9275: Cloud Tools Release
Description
Preconditions for test scenarios
Testing scenario 1 - Applying optional quality patch on a local and remote Cloud instance
Testing scenario 2 - test ece-patches 'apply' and 'revert' with QUALITY_PATCHES: '*' on local Cloud instance
Testing scenario 3 - test magento-patches 'apply' and 'revert' on local Cloud instance
Testing scenario 4 - work on Magento git-instance
Release notes
For user-facing changes, add a meaningful release note. For example, see Magento Cloud Patches release notes.
Associated documentation updates
Add link to Magento DevDocs PR or Issue, if needed.
Contribution checklist