Skip to content

magento/magento2#28239: resize command does not process hidden images #33452

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

Merged

Conversation

BogdanGorbach
Copy link

@BogdanGorbach BogdanGorbach commented Jul 10, 2021

Description (*)

  • added new options --skip-hidden-images
  • added new unit test

Related Pull Requests

no

Fixed Issues (if relevant)

  1. Fixes php bin/magento catalog:images:resize does not process hidden images. #28239

Manual testing scenarios (*)

  1. View the product page, only Image 1 should be visible
  2. pub/media/catalog/cache folder should contain resized Image 1's
  3. pub/media/catalog/cache folder should contain resized Image 2's
  4. Clear image cache
  5. Run php bin/magento catalog:images:resize
  6. pub/media/catalog/cache folder should contain resized Image 1's
  7. pub/media/catalog/cache folder should contain resized Image 2's
  8. Clear image cache
  9. Run php bin/magento catalog:images:resize --skip-hidden-images
  10. Image resize command processes 1 image, not 2
  11. pub/media/catalog/cache folder should contain resized Image 1's
  12. pub/media/catalog/cache folder does not contain resized Image 2's

Questions or comments

no

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)

- added new options --skip-hidden-images
- added new unit test
@m2-assistant
Copy link

m2-assistant bot commented Jul 10, 2021

Hi @BogdanGorbach. Thank you for your contribution
Here are 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.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@m2-community-project m2-community-project bot added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: pending review labels Jul 10, 2021
@BogdanGorbach
Copy link
Author

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@mrtuvn
Copy link
Contributor

mrtuvn commented Jul 10, 2021

Can you check unit fails test

- Fixed Unit Test
- Removed unnecessary dependency in the constructor
@BogdanGorbach
Copy link
Author

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@BogdanGorbach
Copy link
Author

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@BogdanGorbach
Copy link
Author

@magento run Functional Tests B2B

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@BogdanGorbach
Copy link
Author

@magento run Functional Tests B2B

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@BogdanGorbach
Copy link
Author

@magento run Functional Tests B2B

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@BogdanGorbach
Copy link
Author

@magento run Functional Tests B2B

@mrtuvn mrtuvn added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: test coverage labels Jul 14, 2021
@mrtuvn mrtuvn requested a review from ihor-sviziev July 15, 2021 01:38
@magento-engcom-team
Copy link
Contributor

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

@magento-engcom-team
Copy link
Contributor

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

@engcom-Alfa
Copy link
Contributor

engcom-Alfa commented Jul 19, 2021

✔️ QA Passed

Preconditions:

  1. Have a fresh Magento instance without sample data to reproduce easily.
  2. Create a product uploading a couple of images to it where one with hidden option.

Manual testing scenario:

  1. Go to Magento \pub\media\catalog\product folder and check the cache folder existing; if so delete it. Also cross check the product image 1 and product image 2 are existing that have been used in the pre condition.

  2. Using terminal, navigate to the Magento root folder and command : php bin/magento catalog:images:resize followed by php bin/magento catalog:images:resize --skip_hidden_images

Before: ✖️ Only un-hidden image used to be get resized

image

After: ✔️ Along with visible file, hidden image file is also getting resized

image

No other regression is required on this, since it is a part of command background fixes. The above manual scenario covers both the commands validation.

@m2-assistant
Copy link

m2-assistant bot commented Jul 19, 2021

Hi @BogdanGorbach, 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.

@m2-assistant
Copy link

m2-assistant bot commented Jul 29, 2021

Hi @BogdanGorbach, 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.

mozok added a commit to mozok/devdocs that referenced this pull request Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: test coverage Component: MediaStorage Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: accept Release Line: 2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

php bin/magento catalog:images:resize does not process hidden images.
8 participants