-
Notifications
You must be signed in to change notification settings - Fork 9.4k
catalog:images:resize CLI command fix #14154
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
catalog:images:resize CLI command fix #14154
Conversation
@@ -71,7 +71,7 @@ protected function execute(InputInterface $input, OutputInterface $output) | |||
if (!count($productIds)) { | |||
$output->writeln("<info>No product images to resize</info>"); | |||
// we must have an exit code higher than zero to indicate something was wrong |
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.
@okorshenko I'm wondering if the comment is correct in the first place. Should an error be triggered if there are no products? Running the command when there are no products / product images does no harm.
If exiting with an error is desired, we shoul also change the output from <info>
to <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.
Hi @nfourteen , I agree with @mzeis , it's ok if the status code will be 'success' if no products in the store. Regarding the comment in the line above - status code was changed from 'failure' to 'success' in scope of bugfix and developer forget to remove this line. For now, it would be better remove comment line and leave status code as is.
@@ -71,7 +71,7 @@ protected function execute(InputInterface $input, OutputInterface $output) | |||
if (!count($productIds)) { | |||
$output->writeln("<info>No product images to resize</info>"); | |||
// we must have an exit code higher than zero to indicate something was wrong |
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.
Hi @nfourteen , I agree with @mzeis , it's ok if the status code will be 'success' if no products in the store. Regarding the comment in the line above - status code was changed from 'failure' to 'success' in scope of bugfix and developer forget to remove this line. For now, it would be better remove comment line and leave status code as is.
@nfourteen thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
Hi @mzeis, thank you for the review. |
Hi @nfourteen, thanks for your PR! It has been merged into |
Description
Updated
catalog:images:resize
CLI command to return correct exit code on failure. Currently, the conditional check to verify if there are any images to resize returns\Magento\Framework\Console\Cli::RETURN_SUCCESS
(a const === 0) if there aren't any images. Per the comment above the return—"we must have an exit code higher than zero to indicate something was wrong"—this PR returns\Magento\Framework\Console\Cli::RETURN_FAILURE
(a const === 1).Fixed Issues (if relevant)
n/a
Manual testing scenarios
n/a
Contribution checklist