Skip to content

Commit 2d9fcf9

Browse files
authored
#580 - Fix in product sync while fixing unresolved references. (#581)
* We need all cache of key to ids for finding missing references during product sync, test case was missing because it was not working with multiple batches. * add release notes entry. * bump version docs to 2.2.1
1 parent 9059dab commit 2d9fcf9

15 files changed

Lines changed: 34 additions & 25 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# commercetools sync
33
[![Build Status](https://travis-ci.org/commercetools/commercetools-sync-java.svg?branch=master)](https://travis-ci.org/commercetools/commercetools-sync-java)
44
[![codecov](https://codecov.io/gh/commercetools/commercetools-sync-java/branch/master/graph/badge.svg)](https://codecov.io/gh/commercetools/commercetools-sync-java)
5-
[![Benchmarks 2.2.0](https://img.shields.io/badge/Benchmarks-2.2.0-orange.svg)](https://commercetools.github.io/commercetools-sync-java/benchmarks/)
5+
[![Benchmarks 2.2.1](https://img.shields.io/badge/Benchmarks-2.2.1-orange.svg)](https://commercetools.github.io/commercetools-sync-java/benchmarks/)
66
[![Download](https://api.bintray.com/packages/commercetools/maven/commercetools-sync-java/images/download.svg) ](https://bintray.com/commercetools/maven/commercetools-sync-java/_latestVersion)
7-
[![Javadoc](http://javadoc-badge.appspot.com/com.commercetools/commercetools-sync-java.svg?label=Javadoc)](https://commercetools.github.io/commercetools-sync-java/v/2.2.0/)
7+
[![Javadoc](http://javadoc-badge.appspot.com/com.commercetools/commercetools-sync-java.svg?label=Javadoc)](https://commercetools.github.io/commercetools-sync-java/v/2.2.1/)
88
[![Known Vulnerabilities](https://snyk.io/test/github/commercetools/commercetools-sync-java/4b2e26113d591bda158217c5dc1cf80a88665646/badge.svg)](https://snyk.io/test/github/commercetools/commercetools-sync-java/4b2e26113d591bda158217c5dc1cf80a88665646)
99

1010
More at https://commercetools.github.io/commercetools-sync-java
@@ -37,7 +37,7 @@ The library supports synchronising the following entities in commercetools
3737
- [Ivy](#ivy)
3838
- [Roadmap](#roadmap)
3939
- [Release Notes](/docs/RELEASE_NOTES.md)
40-
- [Javadoc](https://commercetools.github.io/commercetools-sync-java/v/2.2.0/)
40+
- [Javadoc](https://commercetools.github.io/commercetools-sync-java/v/2.2.1/)
4141
- [Benchmarks](https://commercetools.github.io/commercetools-sync-java/benchmarks/)
4242

4343
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -79,26 +79,26 @@ Here are the most popular ones:
7979
<dependency>
8080
<groupId>com.commercetools</groupId>
8181
<artifactId>commercetools-sync-java</artifactId>
82-
<version>2.2.0</version>
82+
<version>2.2.1</version>
8383
</dependency>
8484
````
8585

8686
#### Gradle
8787

8888
````groovy
89-
implementation 'com.commercetools:commercetools-sync-java:2.2.0'
89+
implementation 'com.commercetools:commercetools-sync-java:2.2.1'
9090
````
9191

9292
#### SBT
9393

9494
````
95-
libraryDependencies += "com.commercetools" % "commercetools-sync-java" % "2.2.0"
95+
libraryDependencies += "com.commercetools" % "commercetools-sync-java" % "2.2.1"
9696
````
9797

9898
#### Ivy
9999

100100
````xml
101-
<dependency org="com.commercetools" name="commercetools-sync-java" rev="2.2.0"/>
101+
<dependency org="com.commercetools" name="commercetools-sync-java" rev="2.2.1"/>
102102
````
103103

104104

docs/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# commercetools sync
33
[![Build Status](https://travis-ci.org/commercetools/commercetools-sync-java.svg?branch=master)](https://travis-ci.org/commercetools/commercetools-sync-java)
44
[![codecov](https://codecov.io/gh/commercetools/commercetools-sync-java/branch/master/graph/badge.svg)](https://codecov.io/gh/commercetools/commercetools-sync-java)
5-
[![Benchmarks 2.2.0](https://img.shields.io/badge/Benchmarks-2.2.0-orange.svg)](https://commercetools.github.io/commercetools-sync-java/benchmarks/)
5+
[![Benchmarks 2.2.1](https://img.shields.io/badge/Benchmarks-2.2.1-orange.svg)](https://commercetools.github.io/commercetools-sync-java/benchmarks/)
66
[![Download](https://api.bintray.com/packages/commercetools/maven/commercetools-sync-java/images/download.svg) ](https://bintray.com/commercetools/maven/commercetools-sync-java/_latestVersion)
7-
[![Javadoc](http://javadoc-badge.appspot.com/com.commercetools/commercetools-sync-java.svg?label=Javadoc)](https://commercetools.github.io/commercetools-sync-java/v/2.2.0/)
7+
[![Javadoc](http://javadoc-badge.appspot.com/com.commercetools/commercetools-sync-java.svg?label=Javadoc)](https://commercetools.github.io/commercetools-sync-java/v/2.2.1/)
88
[![Known Vulnerabilities](https://snyk.io/test/github/commercetools/commercetools-sync-java/4b2e26113d591bda158217c5dc1cf80a88665646/badge.svg)](https://snyk.io/test/github/commercetools/commercetools-sync-java/4b2e26113d591bda158217c5dc1cf80a88665646)
99

1010

@@ -56,18 +56,18 @@ Here are the most popular ones:
5656
<dependency>
5757
<groupId>com.commercetools</groupId>
5858
<artifactId>commercetools-sync-java</artifactId>
59-
<version>2.2.0</version>
59+
<version>2.2.1</version>
6060
</dependency>
6161
````
6262
#### Gradle
6363
````groovy
64-
implementation 'com.commercetools:commercetools-sync-java:2.2.0'
64+
implementation 'com.commercetools:commercetools-sync-java:2.2.1'
6565
````
6666
#### SBT
6767
````
68-
libraryDependencies += "com.commercetools" % "commercetools-sync-java" % "2.2.0"
68+
libraryDependencies += "com.commercetools" % "commercetools-sync-java" % "2.2.1"
6969
````
7070
#### Ivy
7171
````xml
72-
<dependency org="com.commercetools" name="commercetools-sync-java" rev="2.2.0"/>
72+
<dependency org="com.commercetools" name="commercetools-sync-java" rev="2.2.1"/>
7373
````

docs/RELEASE_NOTES.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@
2828
2929
-->
3030

31+
### 2.2.1 - Sep 29, 2020
32+
[Commits](https://github.com/commercetools/commercetools-sync-java/compare/2.2.0...2.2.1) |
33+
[Javadoc](https://commercetools.github.io/commercetools-sync-java/v/2.2.1/) |
34+
[Jar](https://bintray.com/commercetools/maven/commercetools-sync-java/2.2.1)
35+
36+
🐞 **Bug Fixes** (1)
37+
- **Product Sync** - Fixed a bug in the `ProductSync` related handling of unresolved product references provided in
38+
different batches. [#580](https://github.com/commercetools/commercetools-sync-java/issues/580)
39+
40+
3141
### 2.2.0 - Sep 25, 2020
3242
[Commits](https://github.com/commercetools/commercetools-sync-java/compare/2.1.0...2.2.0) |
3343
[Javadoc](https://commercetools.github.io/commercetools-sync-java/v/2.2.0/) |

docs/usage/CART_DISCOUNT_SYNC.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fields set, otherwise they won't be matched.
3232
Types are matched by their `key`s. Therefore, in order for the sync to resolve the
3333
actual ids of the type reference, the `key` of the `Type` has to be supplied.
3434

35-
- When syncing from a source commercetools project, you can use [`mapToCartDiscountDrafts`](https://commercetools.github.io/commercetools-sync-java/v/2.2.0/com/commercetools/sync/cartdiscounts/utils/CartDiscountReferenceResolutionUtils.html#mapToCartDiscountDrafts-java.util.List-)
35+
- When syncing from a source commercetools project, you can use [`mapToCartDiscountDrafts`](https://commercetools.github.io/commercetools-sync-java/v/2.2.1/com/commercetools/sync/cartdiscounts/utils/CartDiscountReferenceResolutionUtils.html#mapToCartDiscountDrafts-java.util.List-)
3636
method that maps from a `CartDiscount` to `CartDiscountDraft` in order to make them ready for reference resolution by the sync:
3737

3838
````java

docs/usage/CATEGORY_SYNC.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ otherwise they won't be matched.
3434
These references are matched by their `key`s. Therefore, in order for the sync to resolve the
3535
actual ids of the references, their `key`s has to be supplied.
3636

37-
- When syncing from a source commercetools project, you can use [`mapToCategoryDrafts`](https://commercetools.github.io/commercetools-sync-java/v/2.2.0/com/commercetools/sync/categories/utils/CategoryReferenceResolutionUtils.html#mapToCategoryDrafts-java.util.List-)
37+
- When syncing from a source commercetools project, you can use [`mapToCategoryDrafts`](https://commercetools.github.io/commercetools-sync-java/v/2.2.1/com/commercetools/sync/categories/utils/CategoryReferenceResolutionUtils.html#mapToCategoryDrafts-java.util.List-)
3838
method that maps from a `Category` to `CategoryDraft` in order to make them ready for reference resolution by the sync:
3939
````java
4040
final List<CategoryDraft> categoryDrafts = CategoryReferenceResolutionUtils.mapToCategoryDrafts(categories);

docs/usage/IMPORTANT_USAGE_TIPS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ productSync.sync(batch1)
3131
By design, scaling the sync process should **not** be done by executing the batches themselves in parallel. However, it can be done either by:
3232

3333
- Changing the number of [max parallel requests](https://github.com/commercetools/commercetools-sync-java/tree/master/src/main/java/com/commercetools/sync/commons/utils/ClientConfigurationUtils.java#L116) within the `sphereClient` configuration. It defines how many requests the client can execute in parallel.
34-
- or changing the draft [batch size](https://commercetools.github.io/commercetools-sync-java/v/2.2.0/com/commercetools/sync/commons/BaseSyncOptionsBuilder.html#batchSize-int-). It defines how many drafts can one batch contain.
34+
- or changing the draft [batch size](https://commercetools.github.io/commercetools-sync-java/v/2.2.1/com/commercetools/sync/commons/BaseSyncOptionsBuilder.html#batchSize-int-). It defines how many drafts can one batch contain.
3535

3636
The current overridable default [configuration](https://github.com/commercetools/commercetools-sync-java/tree/master/src/main/java/com/commercetools/sync/commons/utils/ClientConfigurationUtils.java#L45) of the `sphereClient`
3737
is the recommended good balance for stability and performance for the sync process.

docs/usage/INVENTORY_SYNC.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ against a [InventoryEntryDraft](https://docs.commercetools.com/http-api-projects
3232
references are matched by their `key`s. Therefore, in order for the sync to resolve the actual ids of those references,
3333
their `key`s has to be supplied.
3434

35-
- When syncing from a source commercetools project, you can use [`mapToInventoryEntryDrafts`](https://commercetools.github.io/commercetools-sync-java/v/2.2.0/com/commercetools/sync/inventories/utils/InventoryReferenceResolutionUtils.html#mapToInventoryEntryDrafts-java.util.List-)
35+
- When syncing from a source commercetools project, you can use [`mapToInventoryEntryDrafts`](https://commercetools.github.io/commercetools-sync-java/v/2.2.1/com/commercetools/sync/inventories/utils/InventoryReferenceResolutionUtils.html#mapToInventoryEntryDrafts-java.util.List-)
3636
method that that maps from a `InventoryEntry` to `InventoryEntryDraft` in order to make them ready for reference resolution by the sync:
3737
````java
3838
final List<InventoryEntryDraft> inventoryEntryDrafts = InventoryReferenceResolutionUtils.mapToInventoryEntryDrafts(inventoryEntries);

docs/usage/PRODUCT_SYNC.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ all the variants in the target project are expected to have the `sku` fields set
3838
of the product also have prices, where each price also has some references including a reference to the `Type` of its
3939
custom fields and a reference to a `channel`. All these referenced resources are matched by their `key`s. Therefore, in
4040
order for the sync to resolve the actual ids of those references, those `key`s have to be supplied in the following way:
41-
- When syncing from a source commercetools project, you can use [`mapToProductDrafts`](https://commercetools.github.io/commercetools-sync-java/v/2.2.0/com/commercetools/sync/products/utils/ProductReferenceResolutionUtils.html#mapToProductDrafts-java.util.List-)
41+
- When syncing from a source commercetools project, you can use [`mapToProductDrafts`](https://commercetools.github.io/commercetools-sync-java/v/2.2.1/com/commercetools/sync/products/utils/ProductReferenceResolutionUtils.html#mapToProductDrafts-java.util.List-)
4242
method that maps from a `Product` to `ProductDraft` in order to make them ready for reference resolution by the sync:
4343
````java
4444
final List<ProductDraft> productDrafts = ProductReferenceResolutionUtils.mapToProductDrafts(products);

docs/usage/PRODUCT_TYPE_SYNC.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ references, those `key`s have to be supplied in the following way:
3838
- Provide the `key` value on the `id` field of the reference. This means that calling `getId()` on the
3939
reference would return its `key`.
4040

41-
**Note**: When syncing from a source commercetools project, you can use [`mapToProductTypeDrafts`](https://commercetools.github.io/commercetools-sync-java/v/2.2.0/com/commercetools/sync/producttypes/utils/ProductTypeReferenceResolutionUtils.html#mapToProductTypeDrafts-java.util.List-)
41+
**Note**: When syncing from a source commercetools project, you can use [`mapToProductTypeDrafts`](https://commercetools.github.io/commercetools-sync-java/v/2.2.1/com/commercetools/sync/producttypes/utils/ProductTypeReferenceResolutionUtils.html#mapToProductTypeDrafts-java.util.List-)
4242

4343
that replaces the references id fields with keys, in order to make them ready for reference resolution by the sync:
4444
````java

docs/usage/QUICK_START.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<dependency>
3838
<groupId>com.commercetools</groupId>
3939
<artifactId>commercetools-sync-java</artifactId>
40-
<version>2.2.0</version>
40+
<version>2.2.1</version>
4141
</dependency>
4242
````
4343
- For Gradle users:
@@ -48,7 +48,7 @@ implementation 'com.commercetools.sdk.jvm.core:commercetools-java-client:1.53.0'
4848
implementation 'com.commercetools.sdk.jvm.core:commercetools-convenience:1.53.0'
4949
5050
// Add commercetools-sync-java dependency.
51-
implementation 'com.commercetools:commercetools-sync-java:2.2.0'
51+
implementation 'com.commercetools:commercetools-sync-java:2.2.1'
5252
````
5353

5454
### 2. Setup Syncing Options

0 commit comments

Comments
 (0)