-
Notifications
You must be signed in to change notification settings - Fork 82
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
MAGECLOUD-1600: Merge ece-patches into ece-tools #158
MAGECLOUD-1600: Merge ece-patches into ece-tools #158
Conversation
config/patches.json
Outdated
@@ -0,0 +1,28 @@ | |||
{ |
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 we need config folder? I think it's better to put this file in root.
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.
Moved
src/Patch/Manager.php
Outdated
$this->directoryList = $directoryList; | ||
} | ||
|
||
public function 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.
Please add description to this method and @throw tags
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 I think applyAll
or applyAllPatches
is better name for this method
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.
Renamed
src/Patch/Manager.php
Outdated
* | ||
* @return void | ||
*/ | ||
private function copyStaticFile() |
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 method should be moved from this class because the logic of this method is not related to patching.
Let's move it to some build or deploy process/
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 moved within next tasks
src/Patch/Manager.php
Outdated
|
||
$this->logger->info('Applying hot-fixes.'); | ||
|
||
$files = glob($hotFixesDir . '/*.patch', GLOB_NOSORT); |
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.
Looks like GLOB_NOSORT is not needed here. When this flag is not used, the pathnames are sorted alphabetically and next line can be removed.
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.
Removed
src/Patch/Manager.php
Outdated
/** | ||
* Applies all needed patches. | ||
*/ | ||
public function applyAll() |
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.
Please add throw tags, this method can throw RuntimeException and FileSystemException.
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.
Added
src/Patch/Manager.php
Outdated
use Psr\Log\LoggerInterface; | ||
|
||
/** | ||
* Class Manager. |
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.
Please remove or change this description
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.
Added
QA approved |
src/Command/ApplyPatches.php
Outdated
} | ||
|
||
/** | ||
* {@inheritdoc |
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.
add second brace
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.
Added
src/Command/ApplyPatches.php
Outdated
/** | ||
* {@inheritdoc | ||
* | ||
* @throws \RuntimeException |
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.
Patch manager may throw at least 2 types of exception.
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.
Removed
} catch (\Exception $exception) { | ||
$this->logger->critical($exception->getMessage()); | ||
|
||
throw $exception; |
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 you need to throw the exception again?
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 standard flow curretly
* Applies all needed patches. | ||
* | ||
* @throws \RuntimeException | ||
* @throws FileSystemException |
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 you need 2 types of exceptions here?
Isn't it better to add try catch and throw only one exception?
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 being caught in command itself
https://magento2.atlassian.net/browse/MAGECLOUD-1600
Description
Integrates patches into ECE-Tools
Zephyr Tests
Contribution checklist
MAGECLOUD-1600: Merge ece-patches into ece-tools #158