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

In System/Export controlers use MessageManager instead of throwing exceptions #26746

Merged
merged 6 commits into from
Mar 17, 2020

Conversation

pmarki
Copy link

@pmarki pmarki commented Feb 7, 2020

Description (*)

Currently when you try to download or delete a file from Magento admin in System/Export section if the file is corrupted or was already deleted both controllers will throw exceptions that won't be caught. This will result in internal server error. I have refactor ImportExport\Controller\Adminhtml\Export\File\Delete and ImportExport\Controller\Adminhtml\Export\File\Download controllers. They will use messageManager instead of throwing errors. This means admin user will see proper success/error messages as in other admin areas.

Related Pull Requests

NA

Fixed Issues (if relevant)

NA

Manual testing scenarios (*)

  1. Go to Magento admin and navigate to System/Export
  2. Export some entities
  3. Keep the tab open and in a new tab go to the same page and delete one file
  4. Try to delete/download the same file in the first tab (without refreshing before)
  5. User friendly message will be visible

Testing can be done with SSH access to file system: File to download\delete can be made corrupted, ready only, no access to apache user, new folder can be created in var/export, etc.

Questions or comments

The section with files to download shouldn't list folders. I'll try to fix this in a separate PR.

Contribution checklist (*)

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

@m2-assistant
Copy link

m2-assistant bot commented Feb 7, 2020

Hi @pmarki. 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.4-develop instance - deploy vanilla Magento instance

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

Copy link
Contributor

@eduard13 eduard13 left a comment

Choose a reason for hiding this comment

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

Hi @pmarki, thank you for your contribution.
Could you please review the comments below related to the backslash and answer the question?
Also, please provide the translations for new texts into i81n/en_US.csv.

Additionally, based on Magento Definition of Done all the changes have to be to covered by automated tests.
Thank you.

@eduard13 eduard13 added the Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests label Mar 10, 2020
Copy link
Contributor

@eduard13 eduard13 left a comment

Choose a reason for hiding this comment

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

Hi @pmarki, thank you for the test coverage, here are couple of suggestions, could you please adjust the tests based on them?
Please do the same for the other test.
Please check the failing static tests as well.

Thank you.

@eduard13
Copy link
Contributor

Hi @pmarki, thank you for the test adjustments, could you please check the failing Static Tests and fix them?
Thanks.

@eduard13 eduard13 added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests and removed Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests labels Mar 11, 2020
@pmarki
Copy link
Author

pmarki commented Mar 12, 2020

hi @eduard13 Static tests fixed. I checked other failed tests and looks like it is not related to my changes. Let me know if anything else can be improved and thank you for your patience, I'm doing PR for Magento first time, plenty of things to check :)

@eduard13
Copy link
Contributor

@magento run all tests

@eduard13
Copy link
Contributor

Hi @pmarki, awesome 🎉. You're welcome, and thank you for all the fixes. The failing functional tests indeed aren't related with the existing changes, but let's wait them to finish running.

Copy link
Contributor

@eduard13 eduard13 left a comment

Choose a reason for hiding this comment

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

The failing tests aren't related to these changes.

@magento-engcom-team
Copy link
Contributor

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

@magento-engcom-team
Copy link
Contributor

@pmarki thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@engcom-Delta
Copy link
Contributor

✔️ QA passed

@engcom-Golf
Copy link
Contributor

@magento run all tests

@engcom-Golf
Copy link
Contributor

Failed functional tests not related to the changes in this PR

magento-engcom-team pushed a commit that referenced this pull request Mar 17, 2020
@magento-engcom-team magento-engcom-team merged commit 27d165c into magento:2.4-develop Mar 17, 2020
@m2-assistant
Copy link

m2-assistant bot commented Mar 17, 2020

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

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.

None yet

5 participants