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

Sku uniqueness #22746

Closed
wants to merge 9 commits into from
Closed

Sku uniqueness #22746

wants to merge 9 commits into from

Conversation

dmanners
Copy link
Contributor

@dmanners dmanners commented May 6, 2019

This is a migration of the PR magento-engcom/import-export-improvements#119 from the now closed import-export-improvements repo.

Originally by @federivo and @pogster

Description

This PR may replace #102.
In contrast to the original PR I restored the SKU autogeneration in case a product is duplicated. The product copier will copy the original SKU and save the duplicate in a loop until a unique url key is found - if no SKU is autogenerated and no valid SKU is supplied it simply won't save the product.

Since the copier sets "isDuplicate" = true I thought it would be good simple solution to check for that entry before autogenerating a SKU.

Fixed Issues (if relevant)

magento-engcom/import-export-improvements#101

Manual testing scenarios

  • Create product with sku "TEST"
  • Create another product with sku "TEST"
  • You should receive an error saying that the sku already exists instead of getting your sku modified.
  • "Save & Duplicate" the product with sku "TEST"
  • The duplicate receives the SKU "TEST-1" and will already be saved.

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 on Travis CI are green)

@m2-assistant
Copy link

m2-assistant bot commented May 6, 2019

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

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

@okorshenko
Copy link
Contributor

@magento run all tests

@ghost ghost added the Progress: on hold label Nov 11, 2019
@sidolov sidolov changed the base branch from 2.3-develop to 2.4-develop December 5, 2019 17:21
@ihor-sviziev
Copy link
Contributor

@magento run all tests

1 similar comment
@ihor-sviziev
Copy link
Contributor

@magento run all tests

@ihor-sviziev
Copy link
Contributor

As we discussed with @sidolov in slack - there were some issues, so I’ll move in from on hold to review it again

@ihor-sviziev
Copy link
Contributor

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

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 @dmanners,
Sorry that we didn't processed your PR so much time!

I see that on this PR we have too many test failures it means that your changes breaks functionality. Could you do following?

  1. review test failures and update your PR accordingly
  2. Revert permissions changes on files you've changed
  3. Sign Adobe CLA

Thank you so much for your contribution!

@ihor-sviziev
Copy link
Contributor

@dmanners will you be able to update your PR based on feedback above?

@dmanners
Copy link
Contributor Author

dmanners commented Apr 7, 2020

sure @ihor-sviziev either this week or next week I will get around to this.

pogster and others added 5 commits April 7, 2020 09:55
…nge. Does not fit the test and the constraint anymore this way. Test needs to be adjusted to result in expected error.
…w behaviour. A product's SKU won't be changed by beforeSave anymore. Only a duplicated product will receive a changed SKU on its creation.
…e two different products with the same URL key to prevent 'SKU already exists' error.
Clean up the header of the class to fit with the static-tests.
@ihor-sviziev ihor-sviziev added Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. Auto-Tests: Covered All changes in Pull Request is covered by auto-tests labels Apr 28, 2020
@ihor-sviziev
Copy link
Contributor

Hi @dmanners,
I see tests still failing after you pushed your last changes. Please check it again

@ihor-sviziev
Copy link
Contributor

Hi @dmanners,
Will you be able to update your PR?

@dmanners
Copy link
Contributor Author

Hi @ihor-sviziev sadly I have not been able to find the time to work on this.

@ihor-sviziev
Copy link
Contributor

Hi @dmanners,
I am closing this PR now due to inactivity.
Please reopen and update your PR if you wish to continue.
Thank you for the collaboration!

@m2-assistant
Copy link

m2-assistant bot commented May 25, 2020

Hi @dmanners, 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
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Component: Catalog Progress: needs update Release Line: 2.4 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants