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

Import/Export - Fix 'entity values are mixed' exception when no valid data #32904

Conversation

fredden
Copy link
Member

@fredden fredden commented Apr 29, 2021

Description

The Import/Export module can operate in two modes: skip errors, stop on error. When configured to skip errors, the import will proceed irrespective of the validation result. When there is no data to import, a exception "entity values are mixed" is thrown. This pull request solves the problem by failing validation in this case.

Related Pull Requests

Fixed Issues

  1. Fixes Error in data structure: entity values are mixed firegento/FireGento_FastSimpleImport2#109
  2. Fixes [Issue] Import/Export - Fix 'entity values are mixed' exception when no valid data #32905

Manual testing scenarios

  1. Create an import file with only invalid data (eg, SKUs that don't exist, invalid customer address fields, malformed customer email addresses)
  2. Configure the Magento importer to skip validation errors
  3. Import the file
  4. Without this pull request: validation passes, but the import fails with a message that "entity values are mixed"
  5. With this pull request: validation fails with a message saying that "There are no valid rows to import."

Questions or comments

none

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)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] Import/Export - Fix 'entity values are mixed' exception when no valid data #32905: Import/Export - Fix 'entity values are mixed' exception when no valid data

@m2-assistant
Copy link

m2-assistant bot commented Apr 29, 2021

Hi @fredden. 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

@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.

@gabrieldagama gabrieldagama added the Priority: P3 May be fixed according to the position in the backlog. label Apr 29, 2021
@m2-community-project m2-community-project bot added this to Pending Review in Pull Requests Dashboard Apr 29, 2021
@gabrieldagama
Copy link
Contributor

@magento create issue

@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.

@ihor-sviziev ihor-sviziev added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Award: test coverage labels May 7, 2021
@ihor-sviziev ihor-sviziev self-assigned this May 7, 2021
@m2-community-project m2-community-project bot moved this from Pending Review to Review in Progress in Pull Requests Dashboard May 7, 2021
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.

Please check failing integration tests

@m2-community-project m2-community-project bot moved this from Review in Progress to Changes Requested in Pull Requests Dashboard May 7, 2021
Copy link
Contributor

@Den4ik Den4ik left a comment

Choose a reason for hiding this comment

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

Hi @fredden! Thanks for your contribution.
I believe that extending of isErrorLimitExceeded for both situations: skip or stop on errors is better solution.

@fredden
Copy link
Member Author

fredden commented May 9, 2021

I believe that extending of isErrorLimitExceeded for both situations: skip or stop on errors is better solution.

@Den4ik the ProcessingErrorAggregator (where isErrorLimitExceeded() is found) does not appear to have access to the total row count. How do you suggest this information should be obtained?

@engcom-Lima
Copy link
Contributor

✔️ QA Passed

Preconditions:

  • Install fresh Magento 2.4-develop and PHP 8.1

*Manual testing scenario:

  1. Create an import file with only invalid data (eg, SKUs that don't exist, invalid customer address fields, malformed customer email addresses)
  2. Configure the Magento importer to skip validation errors
  3. Import the file

Before: ✖️ Import button was displayed.

Screenshot 2023-07-06 at 12 40 30 PM

Getting error after importing "Additional data:Error in data structure: entity values are mixed":
Screenshot 2023-06-23 at 4 31 02 PM

After: ✔️ Now working fine.
Import button disappeared because of invalid data
Screenshot 2023-07-06 at 12 40 48 PM

Screenshot 2023-07-06 at 12 58 16 PM Screenshot 2023-07-06 at 12 57 06 PM

Builds are failed. Hence, moving this PR to Extended Testing.

@engcom-Lima engcom-Lima added the QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope label Jul 6, 2023
@m2-community-project m2-community-project bot moved this from Testing in Progress to Ready for Testing in Community Dashboard Jul 6, 2023
@engcom-Lima engcom-Lima moved this from Ready for Testing to Extended testing (optional) in Community Dashboard Jul 6, 2023
@engcom-Echo
Copy link
Contributor

@magento run Integration Tests, Functional Tests EE,Functional Tests CE,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 message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@engcom-Echo
Copy link
Contributor

@magento run Integration 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 message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@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 message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@engcom-Echo engcom-Echo self-assigned this Jul 10, 2023
@m2-community-project m2-community-project bot moved this from Extended testing (optional) to Ready for Testing in Community Dashboard Jul 10, 2023
@engcom-Echo engcom-Echo moved this from Ready for Testing to Extended testing (optional) in Community Dashboard Jul 10, 2023
@engcom-Echo
Copy link
Contributor

@magento run Functional Tests B2B,Functional Tests CE,Functional Tests EE

@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 message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@engcom-Echo
Copy link
Contributor

Integration Tests failure is not related to PR.
Functional Tests CE, Functional Tests EE, Functional Tests B2B failures are different on last two run on same commit.
Functional Tests CE
Run1
image

Run2
image

Functional Tests EE
Run1
image

Run2
image

Functional Tests B2B
Run1
image

Run2
image

Hence moving it to Merge In Progress

@engcom-Echo engcom-Echo moved this from Extended testing (optional) to Merge in Progress in Community Dashboard Jul 10, 2023
@magento-devops-reposync-svc magento-devops-reposync-svc merged commit a413707 into magento:2.4-develop Aug 31, 2023
8 of 12 checks passed
@engcom-Echo engcom-Echo moved this from Merge in Progress to Recently Merged in Community Dashboard Aug 31, 2023
@fredden fredden deleted the import-export/entity-values-are-mixed branch August 31, 2023 12:47
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: bug fix Award: test coverage Component: ImportExport Partner: Fisheye partners-contribution Pull Request is created by Magento Partner Priority: P3 May be fixed according to the position in the backlog. Progress: accept Project: Community Picked PRs upvoted by the community QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4
Projects
Community Dashboard
Recently Merged
10 participants