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

Refactor \Order\Shipment\Save Controller to use ResultInterface #20057

Conversation

JeroenVanLeusden
Copy link
Member

@JeroenVanLeusden JeroenVanLeusden commented Jan 3, 2019

Description (*)

Refactor \Order\Shipment\Save Controller to use ResultInterface

Fixed Issues (if relevant)

  1. Found references to internal ticket MAGETWO-28356: Refactor controller actions to new ResultInterface.

Manual testing scenarios (*)

  1. Create shipment and see if redirects are working.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • 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)

@magento-engcom-team
Copy link
Contributor

Hi @JeroenVanLeusden. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@ihor-sviziev
Copy link
Contributor

@magento-engcom-team give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, here is your new Magento instance.
Admin access: https://pr-20057.instances.magento-community.engineering/admin
Login: admin Password: 123123q

@ihor-sviziev
Copy link
Contributor

Hi @paliarush,
I'd like to mark

/**
* Forward to action
*
* @TODO MAGETWO-28356: Refactor controller actions to new ResultInterface
* @param string $action
* @param string|null $controller
* @param string|null $module
* @param array|null $params
* @return void
*/
protected function _forward($action, $controller = null, $module = null, array $params = null)
{
$this->_getSession()->setIsUrlNotice($this->_actionFlag->get('', self::FLAG_IS_URLS_CHECKED));
return parent::_forward($action, $controller, $module, $params);
}
and
/**
* Set redirect into response
*
* @TODO MAGETWO-28356: Refactor controller actions to new ResultInterface
* @param string $path
* @param array $arguments
* @return \Magento\Framework\App\ResponseInterface
*/
protected function _redirect($path, $arguments = [])
{
$this->_getSession()->setIsUrlNotice($this->_actionFlag->get('', self::FLAG_IS_URLS_CHECKED));
$this->getResponse()->setRedirect($this->getUrl($path, $arguments));
return $this->getResponse();
}

as deprecated with description that we need to use result object instead. What do you think? Can we add deprecation for them?

@JeroenVanLeusden JeroenVanLeusden force-pushed the JeroenVanLeusden-patch-1 branch from 320aa32 to cc12d87 Compare January 7, 2019 11:09
Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

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

Looks like here still few issues:

  1. added not needed dependency: Refactor \Order\Shipment\Save Controller to use ResultInterface #20057 (diff)
  2. here is regression, previously there were if-else, but now it will execute both parts.
    Refactor \Order\Shipment\Save Controller to use ResultInterface #20057 (diff)
  3. In one place there still NOT return result object, but setting response body via $this->getResponse()->representJson($responseAjax->toJson()).. Would be better to fix all places to return ResultInterface
    Refactor \Order\Shipment\Save Controller to use ResultInterface #20057 (diff)
  4. There are some unit tests failures. Please fix them.

There also integration tests failures, but I think they should NOT be related to this change, so it's actually ok.

@JeroenVanLeusden JeroenVanLeusden force-pushed the JeroenVanLeusden-patch-1 branch from 8d67d08 to 00953bc Compare January 9, 2019 16:54
@JeroenVanLeusden
Copy link
Member Author

@ihor-sviziev Should be all solved now.

Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

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

Now everything is fine, will fix one really minor issue little bit later and approve your pr

@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko, thank you for the review.
ENGCOM-3831 has been created to process this Pull Request

@magento-engcom-team magento-engcom-team merged commit 43b9a9d into magento:2.3-develop Jan 23, 2019
@ghost
Copy link

ghost commented Jan 23, 2019

Hi @JeroenVanLeusden, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@magento-engcom-team
Copy link
Contributor

Hi @JeroenVanLeusden. Thank you for your contribution.
We will aim to release these changes as part of 2.3.1.
Please check the release notes for final confirmation.

@JeroenVanLeusden JeroenVanLeusden deleted the JeroenVanLeusden-patch-1 branch January 24, 2019 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants