Skip to content

Conversation

ProcessEight
Copy link
Contributor

app:config:import failed: Added logic to throw RuntimeException if app:config:import returns failure error code

This PR adds logic which detects if the return code of the app:config:import command returns an error code greater than zero and if so, throws a RuntimeException.

Description (*)

These CLI commands are used for deployments. If there is an error on deployment, the command should stop. But without an error code we cannot stop. This PR adds the error code.

Fixed Issues (if relevant)

  1. setup:upgrade should return failure when app:config:import failed #23222: setup:upgrade should return failure when app:config:import failed

Manual testing scenarios (*)

  1. Add an Exception to Magento\Deploy\Console\Command\App\ConfigImport\Processor
    after Line 114
 if (!$importers || !$this->changeDetector->hasChanges()) {
              throw new \Exception('Test'); // added line
  1. Run bin/magento setup:upgrade
  2. Verify that the bin/magento setup:upgrade command is terminated by the RuntimeException

Questions or comments

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 are green)

…:config:import failed: Added logic to throw RuntimeException if app:config:import returns failure error code
@m2-assistant
Copy link

m2-assistant bot commented Jun 18, 2019

Hi @ProcessEight. 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 give me test instance - deploy test instance based on PR changes
  • @magento give me 2.3-develop instance - deploy vanilla Magento instance

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

…:config:import failed: Replaced constant in localised error message with string literal
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.

Hi @ProcessEight,
Could you cover your change with test in order not to make regression there in future?

@ghost ghost assigned ihor-sviziev Jun 19, 2019
@ihor-sviziev ihor-sviziev added the Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests label Jun 19, 2019
@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-5395 has been created to process this Pull Request

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

@m2-assistant
Copy link

m2-assistant bot commented Jul 5, 2019

Hi @ProcessEight, 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 magento-engcom-team added this to the Release: 2.3.3 milestone Jul 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants