Skip to content

366: validate asset keys#509

Merged
ahalberkamp merged 20 commits intomasterfrom
366__validate_asset_keys
Apr 22, 2020
Merged

366: validate asset keys#509
ahalberkamp merged 20 commits intomasterfrom
366__validate_asset_keys

Conversation

@ahalberkamp
Copy link
Copy Markdown
Contributor

@ahalberkamp ahalberkamp commented Apr 17, 2020

In This pr, it is validated that assetKeys exists on old and new resources exist.If not a warning-callback is triggered
Fixes: #366

Comment thread src/main/java/com/commercetools/sync/commons/helpers/AssetActionFactory.java Outdated
Comment thread src/main/java/com/commercetools/sync/commons/utils/AssetsUpdateActionUtils.java Outdated
Comment thread src/main/java/com/commercetools/sync/commons/utils/AssetsUpdateActionUtils.java Outdated
Comment thread src/main/java/com/commercetools/sync/commons/utils/AssetsUpdateActionUtils.java Outdated
…eActionUtils.java

Co-Authored-By: Jude Niroshan <jude.niroshan11@gmail.com>
@codecov-io
Copy link
Copy Markdown

codecov-io commented Apr 21, 2020

Codecov Report

Merging #509 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #509   +/-   ##
=========================================
  Coverage     98.78%   98.78%           
- Complexity     1502     1509    +7     
=========================================
  Files           134      134           
  Lines          3780     3795   +15     
  Branches        200      203    +3     
=========================================
+ Hits           3734     3749   +15     
  Misses           31       31           
  Partials         15       15           
Impacted Files Coverage Δ Complexity Δ
...nc/categories/utils/CategoryUpdateActionUtils.java 100.00% <ø> (ø) 23.00 <0.00> (ø)
...tools/sync/commons/helpers/AssetActionFactory.java 100.00% <ø> (ø) 1.00 <0.00> (ø)
...ls/sync/commons/utils/AssetsUpdateActionUtils.java 100.00% <100.00%> (ø) 26.00 <11.00> (+7.00)
...roducts/utils/ProductVariantUpdateActionUtils.java 100.00% <100.00%> (ø) 30.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7baae24...567b09f. Read the comment docs.

ahalberkamp and others added 2 commits April 21, 2020 09:41
…updateactionutils/BuildAssetsUpdateActionsTest.java

Co-Authored-By: Jude Niroshan <jude.niroshan11@gmail.com>
…updateactionutils/BuildAssetsUpdateActionsTest.java

Co-Authored-By: Jude Niroshan <jude.niroshan11@gmail.com>
Copy link
Copy Markdown
Contributor

@ahmetoz ahmetoz left a comment

Choose a reason for hiding this comment

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

could you please write an integration test for your changes? also, Travis build is failing.

Comment thread src/main/java/com/commercetools/sync/commons/helpers/AssetActionFactory.java Outdated
Comment thread src/main/java/com/commercetools/sync/commons/utils/AssetsUpdateActionUtils.java Outdated
Comment thread src/main/java/com/commercetools/sync/commons/utils/AssetsUpdateActionUtils.java Outdated
Comment thread src/main/java/com/commercetools/sync/commons/utils/AssetsUpdateActionUtils.java Outdated
Comment thread src/test/java/com/commercetools/sync/products/utils/ProductSyncUtilsTest.java Outdated
ahalberkamp and others added 2 commits April 21, 2020 10:43
…eActionUtils.java

Co-Authored-By: Ahmet Öz <bilmuhahmet@gmail.com>
…eActionUtils.java

Co-Authored-By: Ahmet Öz <bilmuhahmet@gmail.com>
@ahalberkamp
Copy link
Copy Markdown
Contributor Author

I have allready write some integration test, see: https://github.com/commercetools/commercetools-sync-java/pull/509/files#diff-cadc851f237ef9842d0224c27748bf3aR120 and I fixed the build @ahmetoz

@ahalberkamp ahalberkamp reopened this Apr 21, 2020
@ahalberkamp ahalberkamp merged commit ac20aca into master Apr 22, 2020
@ahmetoz ahmetoz deleted the 366__validate_asset_keys branch April 22, 2020 06:55
@butenkor
Copy link
Copy Markdown
Member

@ahalberkamp Does it call warning callback and skip processing faulty resource or it will make a request to the API with assets without keys?

@ahalberkamp
Copy link
Copy Markdown
Contributor Author

@butenkor assets without keys will be skipped, so no invalid request will be sent to the API.

@butenkor
Copy link
Copy Markdown
Member

Ok, Thanks. What about sync statistics? Will the totals (updated, processed, failed, skipped...) be updated accordingly?

@ahalberkamp
Copy link
Copy Markdown
Contributor Author

No, because if a assetkey is missing, the given Product will still be updated and only a Warning, that the asset is not synced, will be printed out. So there is no need to change the statistic in this case.

@butenkor
Copy link
Copy Markdown
Member

ok. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validate asset keys

5 participants