{"action":"created","comment":{"url":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/comments/193464317","pull_request_review_id":126442139,"id":193464317,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MzQ2NDMxNw==","diff_hunk":"@@ -135,24 +150,27 @@ class ProductImport\n           @logger.warn \"Filtering out #{filteredProductsLength} product(s) which do not have SKU\"\n           @_summary.productsWithMissingSKU += filteredProductsLength\n \n-        skus = @_extractUniqueSkus(productsToProcess)\n-        if skus.length then @_getExistingProductsForSkus(skus) else []\n-      .then (queriedEntries) =>\n         if (@variantReassignmentOptions.enabled)\n           @logger.debug 'execute reassignment process'\n+\n           reassignmentService = new Reassignment(@client, @logger,\n-            @variantReassignmentOptions.retainExistingData)\n+             @variantReassignmentOptions.retainExistingData)\n           reassignmentService.execute(productsToProcess, @_cache.productType)\n-          .then((statistics) =>\n-            @_summary.variantReassignment = statistics\n-            if (statistics.processed > 0)\n-              skus = @_extractUniqueSkus(productsToProcess)\n-              if skus.length then @_getExistingProductsForSkus(skus) else queriedEntries\n-            else\n-              return queriedEntries\n+          .then((res) =>\n+            @_summary.variantReassignment = res.statistics\n+\n+            # if there are products which failed during reassignment, remove them from processing\n+            if(res.failedSkus.length)\n+              @logger.warn(\n+                \"Removing #{res.failedSkus} skus from processing due to a reassignment error\"\n+              )\n+              productsToProcess = @_filterOutProductsBySkus(productsToProcess, res.failedSkus)\n+\n+            # fetch existing products - they should be reassigned now\n+            @_getExistingProductsForSkus(@_extractUniqueSkus(productsToProcess))","path":"lib/product-import.coffee","position":54,"original_position":54,"commit_id":"e26174e30881cb5370bbaa91867d7c0e2f8947a3","original_commit_id":"e26174e30881cb5370bbaa91867d7c0e2f8947a3","user":{"login":"lojzatran","id":803826,"node_id":"MDQ6VXNlcjgwMzgyNg==","avatar_url":"https://avatars0.githubusercontent.com/u/803826?v=4","gravatar_id":"","url":"https://api.github.com/users/lojzatran","html_url":"https://github.com/lojzatran","followers_url":"https://api.github.com/users/lojzatran/followers","following_url":"https://api.github.com/users/lojzatran/following{/other_user}","gists_url":"https://api.github.com/users/lojzatran/gists{/gist_id}","starred_url":"https://api.github.com/users/lojzatran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lojzatran/subscriptions","organizations_url":"https://api.github.com/users/lojzatran/orgs","repos_url":"https://api.github.com/users/lojzatran/repos","events_url":"https://api.github.com/users/lojzatran/events{/privacy}","received_events_url":"https://api.github.com/users/lojzatran/received_events","type":"User","site_admin":false},"body":"You shoud put back this condition. If there was no reassignment, it should not refetch the products, but just use what has been passed. It's quite a big performance improvement.\r\n\r\n```if (statistics.processed > 0)```","created_at":"2018-06-06T15:56:07Z","updated_at":"2018-06-06T15:58:38Z","html_url":"https://github.com/sphereio/sphere-product-import/pull/121#discussion_r193464317","pull_request_url":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/121","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/comments/193464317"},"html":{"href":"https://github.com/sphereio/sphere-product-import/pull/121#discussion_r193464317"},"pull_request":{"href":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/121"}}},"pull_request":{"url":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/121","id":193059837,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzMDU5ODM3","html_url":"https://github.com/sphereio/sphere-product-import/pull/121","diff_url":"https://github.com/sphereio/sphere-product-import/pull/121.diff","patch_url":"https://github.com/sphereio/sphere-product-import/pull/121.patch","issue_url":"https://api.github.com/repos/sphereio/sphere-product-import/issues/121","number":121,"state":"open","locked":false,"title":"feat(product-import): Filter out failed products #116","user":{"login":"junajan","id":1090382,"node_id":"MDQ6VXNlcjEwOTAzODI=","avatar_url":"https://avatars0.githubusercontent.com/u/1090382?v=4","gravatar_id":"","url":"https://api.github.com/users/junajan","html_url":"https://github.com/junajan","followers_url":"https://api.github.com/users/junajan/followers","following_url":"https://api.github.com/users/junajan/following{/other_user}","gists_url":"https://api.github.com/users/junajan/gists{/gist_id}","starred_url":"https://api.github.com/users/junajan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junajan/subscriptions","organizations_url":"https://api.github.com/users/junajan/orgs","repos_url":"https://api.github.com/users/junajan/repos","events_url":"https://api.github.com/users/junajan/events{/privacy}","received_events_url":"https://api.github.com/users/junajan/received_events","type":"User","site_admin":false},"body":"#### Summary\r\nIn this PR I filter out products for which reassignment failed from next processing","created_at":"2018-06-06T15:48:41Z","updated_at":"2018-06-06T15:58:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ffa371a25d580fb9ac82dff5a7032c053586ee0f","assignee":{"login":"junajan","id":1090382,"node_id":"MDQ6VXNlcjEwOTAzODI=","avatar_url":"https://avatars0.githubusercontent.com/u/1090382?v=4","gravatar_id":"","url":"https://api.github.com/users/junajan","html_url":"https://github.com/junajan","followers_url":"https://api.github.com/users/junajan/followers","following_url":"https://api.github.com/users/junajan/following{/other_user}","gists_url":"https://api.github.com/users/junajan/gists{/gist_id}","starred_url":"https://api.github.com/users/junajan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junajan/subscriptions","organizations_url":"https://api.github.com/users/junajan/orgs","repos_url":"https://api.github.com/users/junajan/repos","events_url":"https://api.github.com/users/junajan/events{/privacy}","received_events_url":"https://api.github.com/users/junajan/received_events","type":"User","site_admin":false},"assignees":[{"login":"junajan","id":1090382,"node_id":"MDQ6VXNlcjEwOTAzODI=","avatar_url":"https://avatars0.githubusercontent.com/u/1090382?v=4","gravatar_id":"","url":"https://api.github.com/users/junajan","html_url":"https://github.com/junajan","followers_url":"https://api.github.com/users/junajan/followers","following_url":"https://api.github.com/users/junajan/following{/other_user}","gists_url":"https://api.github.com/users/junajan/gists{/gist_id}","starred_url":"https://api.github.com/users/junajan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junajan/subscriptions","organizations_url":"https://api.github.com/users/junajan/orgs","repos_url":"https://api.github.com/users/junajan/repos","events_url":"https://api.github.com/users/junajan/events{/privacy}","received_events_url":"https://api.github.com/users/junajan/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/121/commits","review_comments_url":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/121/comments","review_comment_url":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sphereio/sphere-product-import/issues/121/comments","statuses_url":"https://api.github.com/repos/sphereio/sphere-product-import/statuses/e26174e30881cb5370bbaa91867d7c0e2f8947a3","head":{"label":"sphereio:116-variant-reassignment-filtering-failed-products","ref":"116-variant-reassignment-filtering-failed-products","sha":"e26174e30881cb5370bbaa91867d7c0e2f8947a3","user":{"login":"sphereio","id":4119130,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMTkxMzA=","avatar_url":"https://avatars1.githubusercontent.com/u/4119130?v=4","gravatar_id":"","url":"https://api.github.com/users/sphereio","html_url":"https://github.com/sphereio","followers_url":"https://api.github.com/users/sphereio/followers","following_url":"https://api.github.com/users/sphereio/following{/other_user}","gists_url":"https://api.github.com/users/sphereio/gists{/gist_id}","starred_url":"https://api.github.com/users/sphereio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sphereio/subscriptions","organizations_url":"https://api.github.com/users/sphereio/orgs","repos_url":"https://api.github.com/users/sphereio/repos","events_url":"https://api.github.com/users/sphereio/events{/privacy}","received_events_url":"https://api.github.com/users/sphereio/received_events","type":"Organization","site_admin":false},"repo":{"id":34815423,"node_id":"MDEwOlJlcG9zaXRvcnkzNDgxNTQyMw==","name":"sphere-product-import","full_name":"sphereio/sphere-product-import","owner":{"login":"sphereio","id":4119130,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMTkxMzA=","avatar_url":"https://avatars1.githubusercontent.com/u/4119130?v=4","gravatar_id":"","url":"https://api.github.com/users/sphereio","html_url":"https://github.com/sphereio","followers_url":"https://api.github.com/users/sphereio/followers","following_url":"https://api.github.com/users/sphereio/following{/other_user}","gists_url":"https://api.github.com/users/sphereio/gists{/gist_id}","starred_url":"https://api.github.com/users/sphereio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sphereio/subscriptions","organizations_url":"https://api.github.com/users/sphereio/orgs","repos_url":"https://api.github.com/users/sphereio/repos","events_url":"https://api.github.com/users/sphereio/events{/privacy}","received_events_url":"https://api.github.com/users/sphereio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sphereio/sphere-product-import","description":"Manage product data","fork":false,"url":"https://api.github.com/repos/sphereio/sphere-product-import","forks_url":"https://api.github.com/repos/sphereio/sphere-product-import/forks","keys_url":"https://api.github.com/repos/sphereio/sphere-product-import/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sphereio/sphere-product-import/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sphereio/sphere-product-import/teams","hooks_url":"https://api.github.com/repos/sphereio/sphere-product-import/hooks","issue_events_url":"https://api.github.com/repos/sphereio/sphere-product-import/issues/events{/number}","events_url":"https://api.github.com/repos/sphereio/sphere-product-import/events","assignees_url":"https://api.github.com/repos/sphereio/sphere-product-import/assignees{/user}","branches_url":"https://api.github.com/repos/sphereio/sphere-product-import/branches{/branch}","tags_url":"https://api.github.com/repos/sphereio/sphere-product-import/tags","blobs_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/refs{/sha}","trees_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sphereio/sphere-product-import/statuses/{sha}","languages_url":"https://api.github.com/repos/sphereio/sphere-product-import/languages","stargazers_url":"https://api.github.com/repos/sphereio/sphere-product-import/stargazers","contributors_url":"https://api.github.com/repos/sphereio/sphere-product-import/contributors","subscribers_url":"https://api.github.com/repos/sphereio/sphere-product-import/subscribers","subscription_url":"https://api.github.com/repos/sphereio/sphere-product-import/subscription","commits_url":"https://api.github.com/repos/sphereio/sphere-product-import/commits{/sha}","git_commits_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/commits{/sha}","comments_url":"https://api.github.com/repos/sphereio/sphere-product-import/comments{/number}","issue_comment_url":"https://api.github.com/repos/sphereio/sphere-product-import/issues/comments{/number}","contents_url":"https://api.github.com/repos/sphereio/sphere-product-import/contents/{+path}","compare_url":"https://api.github.com/repos/sphereio/sphere-product-import/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sphereio/sphere-product-import/merges","archive_url":"https://api.github.com/repos/sphereio/sphere-product-import/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sphereio/sphere-product-import/downloads","issues_url":"https://api.github.com/repos/sphereio/sphere-product-import/issues{/number}","pulls_url":"https://api.github.com/repos/sphereio/sphere-product-import/pulls{/number}","milestones_url":"https://api.github.com/repos/sphereio/sphere-product-import/milestones{/number}","notifications_url":"https://api.github.com/repos/sphereio/sphere-product-import/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sphereio/sphere-product-import/labels{/name}","releases_url":"https://api.github.com/repos/sphereio/sphere-product-import/releases{/id}","deployments_url":"https://api.github.com/repos/sphereio/sphere-product-import/deployments","created_at":"2015-04-29T20:01:14Z","updated_at":"2018-04-25T11:57:45Z","pushed_at":"2018-06-06T15:48:41Z","git_url":"git://github.com/sphereio/sphere-product-import.git","ssh_url":"git@github.com:sphereio/sphere-product-import.git","clone_url":"https://github.com/sphereio/sphere-product-import.git","svn_url":"https://github.com/sphereio/sphere-product-import","homepage":null,"size":414,"stargazers_count":3,"watchers_count":3,"language":"CoffeeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":14,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":14,"watchers":3,"default_branch":"master"}},"base":{"label":"sphereio:116-variant-reassignment","ref":"116-variant-reassignment","sha":"970794576b57912ac79545a5c6bf6e1ddc27af5b","user":{"login":"sphereio","id":4119130,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMTkxMzA=","avatar_url":"https://avatars1.githubusercontent.com/u/4119130?v=4","gravatar_id":"","url":"https://api.github.com/users/sphereio","html_url":"https://github.com/sphereio","followers_url":"https://api.github.com/users/sphereio/followers","following_url":"https://api.github.com/users/sphereio/following{/other_user}","gists_url":"https://api.github.com/users/sphereio/gists{/gist_id}","starred_url":"https://api.github.com/users/sphereio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sphereio/subscriptions","organizations_url":"https://api.github.com/users/sphereio/orgs","repos_url":"https://api.github.com/users/sphereio/repos","events_url":"https://api.github.com/users/sphereio/events{/privacy}","received_events_url":"https://api.github.com/users/sphereio/received_events","type":"Organization","site_admin":false},"repo":{"id":34815423,"node_id":"MDEwOlJlcG9zaXRvcnkzNDgxNTQyMw==","name":"sphere-product-import","full_name":"sphereio/sphere-product-import","owner":{"login":"sphereio","id":4119130,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMTkxMzA=","avatar_url":"https://avatars1.githubusercontent.com/u/4119130?v=4","gravatar_id":"","url":"https://api.github.com/users/sphereio","html_url":"https://github.com/sphereio","followers_url":"https://api.github.com/users/sphereio/followers","following_url":"https://api.github.com/users/sphereio/following{/other_user}","gists_url":"https://api.github.com/users/sphereio/gists{/gist_id}","starred_url":"https://api.github.com/users/sphereio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sphereio/subscriptions","organizations_url":"https://api.github.com/users/sphereio/orgs","repos_url":"https://api.github.com/users/sphereio/repos","events_url":"https://api.github.com/users/sphereio/events{/privacy}","received_events_url":"https://api.github.com/users/sphereio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sphereio/sphere-product-import","description":"Manage product data","fork":false,"url":"https://api.github.com/repos/sphereio/sphere-product-import","forks_url":"https://api.github.com/repos/sphereio/sphere-product-import/forks","keys_url":"https://api.github.com/repos/sphereio/sphere-product-import/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sphereio/sphere-product-import/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sphereio/sphere-product-import/teams","hooks_url":"https://api.github.com/repos/sphereio/sphere-product-import/hooks","issue_events_url":"https://api.github.com/repos/sphereio/sphere-product-import/issues/events{/number}","events_url":"https://api.github.com/repos/sphereio/sphere-product-import/events","assignees_url":"https://api.github.com/repos/sphereio/sphere-product-import/assignees{/user}","branches_url":"https://api.github.com/repos/sphereio/sphere-product-import/branches{/branch}","tags_url":"https://api.github.com/repos/sphereio/sphere-product-import/tags","blobs_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/refs{/sha}","trees_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sphereio/sphere-product-import/statuses/{sha}","languages_url":"https://api.github.com/repos/sphereio/sphere-product-import/languages","stargazers_url":"https://api.github.com/repos/sphereio/sphere-product-import/stargazers","contributors_url":"https://api.github.com/repos/sphereio/sphere-product-import/contributors","subscribers_url":"https://api.github.com/repos/sphereio/sphere-product-import/subscribers","subscription_url":"https://api.github.com/repos/sphereio/sphere-product-import/subscription","commits_url":"https://api.github.com/repos/sphereio/sphere-product-import/commits{/sha}","git_commits_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/commits{/sha}","comments_url":"https://api.github.com/repos/sphereio/sphere-product-import/comments{/number}","issue_comment_url":"https://api.github.com/repos/sphereio/sphere-product-import/issues/comments{/number}","contents_url":"https://api.github.com/repos/sphereio/sphere-product-import/contents/{+path}","compare_url":"https://api.github.com/repos/sphereio/sphere-product-import/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sphereio/sphere-product-import/merges","archive_url":"https://api.github.com/repos/sphereio/sphere-product-import/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sphereio/sphere-product-import/downloads","issues_url":"https://api.github.com/repos/sphereio/sphere-product-import/issues{/number}","pulls_url":"https://api.github.com/repos/sphereio/sphere-product-import/pulls{/number}","milestones_url":"https://api.github.com/repos/sphereio/sphere-product-import/milestones{/number}","notifications_url":"https://api.github.com/repos/sphereio/sphere-product-import/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sphereio/sphere-product-import/labels{/name}","releases_url":"https://api.github.com/repos/sphereio/sphere-product-import/releases{/id}","deployments_url":"https://api.github.com/repos/sphereio/sphere-product-import/deployments","created_at":"2015-04-29T20:01:14Z","updated_at":"2018-04-25T11:57:45Z","pushed_at":"2018-06-06T15:48:41Z","git_url":"git://github.com/sphereio/sphere-product-import.git","ssh_url":"git@github.com:sphereio/sphere-product-import.git","clone_url":"https://github.com/sphereio/sphere-product-import.git","svn_url":"https://github.com/sphereio/sphere-product-import","homepage":null,"size":414,"stargazers_count":3,"watchers_count":3,"language":"CoffeeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":14,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":14,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/121"},"html":{"href":"https://github.com/sphereio/sphere-product-import/pull/121"},"issue":{"href":"https://api.github.com/repos/sphereio/sphere-product-import/issues/121"},"comments":{"href":"https://api.github.com/repos/sphereio/sphere-product-import/issues/121/comments"},"review_comments":{"href":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/121/comments"},"review_comment":{"href":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/121/commits"},"statuses":{"href":"https://api.github.com/repos/sphereio/sphere-product-import/statuses/e26174e30881cb5370bbaa91867d7c0e2f8947a3"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"lojzatran"}}