Skip to content
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

Merged
merged 9 commits into from
Jan 25, 2018
Merged

MAGECLOUD-1600: Merge ece-patches into ece-tools #158

merged 9 commits into from
Jan 25, 2018

Conversation

shiftedreality
Copy link
Member

@shiftedreality shiftedreality commented Jan 23, 2018

https://magento2.atlassian.net/browse/MAGECLOUD-1600

Description

Integrates patches into ECE-Tools

Zephyr Tests

  1. https://jira.corp.magento.com/browse/MAGETWO-83981
  2. https://jira.corp.magento.com/browse/MAGETWO-70994

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • Pull request was approved by architect
  • Pull request was approved by QA member
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)
    MAGECLOUD-1600: Merge ece-patches into ece-tools #158

@@ -0,0 +1,28 @@
{
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Moved

$this->directoryList = $directoryList;
}

public function apply()
Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Renamed

*
* @return void
*/
private function copyStaticFile()
Copy link
Contributor

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/

Copy link
Member Author

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


$this->logger->info('Applying hot-fixes.');

$files = glob($hotFixesDir . '/*.patch', GLOB_NOSORT);
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed

/**
* Applies all needed patches.
*/
public function applyAll()
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added

use Psr\Log\LoggerInterface;

/**
* Class Manager.
Copy link
Contributor

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Added

@andriyShevtsov
Copy link
Contributor

QA approved

@shiftedreality shiftedreality changed the base branch from develop to 2002.0 January 24, 2018 17:02
@andriyShevtsov andriyShevtsov added Progress: accept PR/issue status and removed Progress: review PR/Issue status labels Jan 25, 2018
}

/**
* {@inheritdoc
Copy link
Contributor

@NadiyaS NadiyaS Jan 25, 2018

Choose a reason for hiding this comment

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

add second brace

Copy link
Member Author

Choose a reason for hiding this comment

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

Added

/**
* {@inheritdoc
*
* @throws \RuntimeException
Copy link
Contributor

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.

Copy link
Member Author

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;
Copy link
Contributor

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?

Copy link
Member Author

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
Copy link
Contributor

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?

Copy link
Member Author

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

@shiftedreality shiftedreality merged commit 2644086 into magento:2002.0 Jan 25, 2018
@shiftedreality shiftedreality deleted the MAGECLOUD-1600 branch January 25, 2018 11:09
@JacobBrownAustin JacobBrownAustin restored the MAGECLOUD-1600 branch January 25, 2018 16:36
@YPyltiai YPyltiai added Release: 2002.0.8 ECE-Tools Release and removed Release Line: 2002.0 labels May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Progress: accept PR/issue status Release: 2002.0.8 ECE-Tools Release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants