{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/pulls/comments/196492410","pull_request_review_id":130055119,"id":196492410,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NjQ5MjQxMA==","diff_hunk":"@@ -8,37 +11,53 @@ import { ArtifactItemStore } from '../Store/artifactItemStore';\n import { ArtifactEngineOptions } from \"./artifactEngineOptions\"\n import { Logger } from './logger';\n import { Worker } from './worker';\n+import { TicketState } from '../Models/ticketState';\n+import { CacheProvider } from '../Providers/cacheProvider';\n \n export class ArtifactEngine {\n     processItems(sourceProvider: models.IArtifactProvider, destProvider: models.IArtifactProvider, artifactEngineOptions?: ArtifactEngineOptions): Promise<models.ArtifactDownloadTicket[]> {\n         var artifactDownloadTicketsPromise = new Promise<models.ArtifactDownloadTicket[]>((resolve, reject) => {\n             const workers: Promise<void>[] = [];\n             artifactEngineOptions = artifactEngineOptions || new ArtifactEngineOptions();\n+            artifactEngineOptions.artifactCacheDirectory = artifactEngineOptions.artifactCacheDirectory ? artifactEngineOptions.artifactCacheDirectory : tl.getVariable(\"AGENT_WORKFOLDER\");\n             this.createPatternList(artifactEngineOptions);\n+            var artifactName = sourceProvider.getRootItemPath();\n+            this.artifactItemStore = new ArtifactItemStore(artifactName);\n             this.artifactItemStore.flush();\n             Logger.verbose = artifactEngineOptions.verbose;\n             this.logger = new Logger(this.artifactItemStore);\n             this.logger.logProgress();\n             sourceProvider.artifactItemStore = this.artifactItemStore;\n             destProvider.artifactItemStore = this.artifactItemStore;\n+            if(!artifactEngineOptions.enableIncrementalDownload) {\n+                artifactEngineOptions.artifactCacheDirectory = '';\n+                artifactEngineOptions.artifactCacheKey = '';\n+            }\n+            this.cacheProvider = new CacheProvider(artifactEngineOptions.artifactCacheDirectory,artifactEngineOptions.artifactCacheKey,artifactName);\n             sourceProvider.getRootItems().then((itemsToProcess: models.ArtifactItem[]) => {\n                 this.artifactItemStore.addItems(itemsToProcess);\n-\n-                for (let i = 0; i < artifactEngineOptions.parallelProcessingLimit; ++i) {\n-                    var worker = new Worker<models.ArtifactItem>(i + 1, item => this.processArtifactItem(sourceProvider, item, destProvider, artifactEngineOptions), () => this.artifactItemStore.getNextItemToProcess(), () => !this.artifactItemStore.itemsPendingProcessing());\n-                    workers.push(worker.init());\n-                }\n-\n-                Promise.all(workers).then(() => {\n-                    this.logger.logSummary();\n-                    sourceProvider.dispose();\n-                    destProvider.dispose();\n-                    resolve(this.artifactItemStore.getTickets());\n-                }, (err) => {\n-                    ci.publishEvent('reliability', <ci.IReliabilityData>{ issueType: 'error', errorMessage: JSON.stringify(err, Object.getOwnPropertyNames(err)) });\n-                    sourceProvider.dispose();\n-                    destProvider.dispose();\n-                    reject(err);\n+                this.createNewHashMap(sourceProvider,itemsToProcess,artifactEngineOptions).then(() => {\n+                    for (let i = 0; i < artifactEngineOptions.parallelProcessingLimit; ++i) {\n+                        var worker = new Worker<models.ArtifactItem>(i + 1, item => this.processArtifactItem(sourceProvider, item, destProvider, artifactEngineOptions), () => this.artifactItemStore.getNextItemToProcess(), () => !this.artifactItemStore.itemsPendingProcessing());\n+                        workers.push(worker.init());\n+                    }\n+        \n+                    Promise.all(workers).then(() => {\n+                        this.logger.logSummary();","path":"Extensions/ArtifactEngine/Engine/artifactEngine.ts","position":61,"original_position":61,"commit_id":"38e8f4037821b40f63d0d89a3b343b7550de8422","original_commit_id":"38e8f4037821b40f63d0d89a3b343b7550de8422","user":{"login":"omeshp","id":11783897,"node_id":"MDQ6VXNlcjExNzgzODk3","avatar_url":"https://avatars2.githubusercontent.com/u/11783897?v=4","gravatar_id":"","url":"https://api.github.com/users/omeshp","html_url":"https://github.com/omeshp","followers_url":"https://api.github.com/users/omeshp/followers","following_url":"https://api.github.com/users/omeshp/following{/other_user}","gists_url":"https://api.github.com/users/omeshp/gists{/gist_id}","starred_url":"https://api.github.com/users/omeshp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omeshp/subscriptions","organizations_url":"https://api.github.com/users/omeshp/orgs","repos_url":"https://api.github.com/users/omeshp/repos","events_url":"https://api.github.com/users/omeshp/events{/privacy}","received_events_url":"https://api.github.com/users/omeshp/received_events","type":"User","site_admin":false},"body":"logSummary published telemetry for success, we should also add if incremental download was enabled in that telemetry. ","created_at":"2018-06-19T16:22:08Z","updated_at":"2018-06-19T16:22:08Z","html_url":"https://github.com/Microsoft/vsts-rm-extensions/pull/446#discussion_r196492410","pull_request_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/pulls/446","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/pulls/comments/196492410"},"html":{"href":"https://github.com/Microsoft/vsts-rm-extensions/pull/446#discussion_r196492410"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/pulls/446"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/pulls/446","id":194595579,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk0NTk1NTc5","html_url":"https://github.com/Microsoft/vsts-rm-extensions/pull/446","diff_url":"https://github.com/Microsoft/vsts-rm-extensions/pull/446.diff","patch_url":"https://github.com/Microsoft/vsts-rm-extensions/pull/446.patch","issue_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/issues/446","number":446,"state":"open","locked":false,"title":"Changes for Incremental Download","user":{"login":"deep2696","id":33370767,"node_id":"MDQ6VXNlcjMzMzcwNzY3","avatar_url":"https://avatars0.githubusercontent.com/u/33370767?v=4","gravatar_id":"","url":"https://api.github.com/users/deep2696","html_url":"https://github.com/deep2696","followers_url":"https://api.github.com/users/deep2696/followers","following_url":"https://api.github.com/users/deep2696/following{/other_user}","gists_url":"https://api.github.com/users/deep2696/gists{/gist_id}","starred_url":"https://api.github.com/users/deep2696/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deep2696/subscriptions","organizations_url":"https://api.github.com/users/deep2696/orgs","repos_url":"https://api.github.com/users/deep2696/repos","events_url":"https://api.github.com/users/deep2696/events{/privacy}","received_events_url":"https://api.github.com/users/deep2696/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-13T13:56:57Z","updated_at":"2018-06-19T16:22:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9a8585e2156dc306bad2c7855131ae532058b28","assignee":null,"assignees":[],"requested_reviewers":[{"login":"GitHubSriramB","id":13654692,"node_id":"MDQ6VXNlcjEzNjU0Njky","avatar_url":"https://avatars2.githubusercontent.com/u/13654692?v=4","gravatar_id":"","url":"https://api.github.com/users/GitHubSriramB","html_url":"https://github.com/GitHubSriramB","followers_url":"https://api.github.com/users/GitHubSriramB/followers","following_url":"https://api.github.com/users/GitHubSriramB/following{/other_user}","gists_url":"https://api.github.com/users/GitHubSriramB/gists{/gist_id}","starred_url":"https://api.github.com/users/GitHubSriramB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GitHubSriramB/subscriptions","organizations_url":"https://api.github.com/users/GitHubSriramB/orgs","repos_url":"https://api.github.com/users/GitHubSriramB/repos","events_url":"https://api.github.com/users/GitHubSriramB/events{/privacy}","received_events_url":"https://api.github.com/users/GitHubSriramB/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/pulls/446/commits","review_comments_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/pulls/446/comments","review_comment_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/issues/446/comments","statuses_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/statuses/38e8f4037821b40f63d0d89a3b343b7550de8422","head":{"label":"deep2696:master","ref":"master","sha":"38e8f4037821b40f63d0d89a3b343b7550de8422","user":{"login":"deep2696","id":33370767,"node_id":"MDQ6VXNlcjMzMzcwNzY3","avatar_url":"https://avatars0.githubusercontent.com/u/33370767?v=4","gravatar_id":"","url":"https://api.github.com/users/deep2696","html_url":"https://github.com/deep2696","followers_url":"https://api.github.com/users/deep2696/followers","following_url":"https://api.github.com/users/deep2696/following{/other_user}","gists_url":"https://api.github.com/users/deep2696/gists{/gist_id}","starred_url":"https://api.github.com/users/deep2696/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deep2696/subscriptions","organizations_url":"https://api.github.com/users/deep2696/orgs","repos_url":"https://api.github.com/users/deep2696/repos","events_url":"https://api.github.com/users/deep2696/events{/privacy}","received_events_url":"https://api.github.com/users/deep2696/received_events","type":"User","site_admin":false},"repo":{"id":136433742,"node_id":"MDEwOlJlcG9zaXRvcnkxMzY0MzM3NDI=","name":"vsts-rm-extensions","full_name":"deep2696/vsts-rm-extensions","owner":{"login":"deep2696","id":33370767,"node_id":"MDQ6VXNlcjMzMzcwNzY3","avatar_url":"https://avatars0.githubusercontent.com/u/33370767?v=4","gravatar_id":"","url":"https://api.github.com/users/deep2696","html_url":"https://github.com/deep2696","followers_url":"https://api.github.com/users/deep2696/followers","following_url":"https://api.github.com/users/deep2696/following{/other_user}","gists_url":"https://api.github.com/users/deep2696/gists{/gist_id}","starred_url":"https://api.github.com/users/deep2696/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deep2696/subscriptions","organizations_url":"https://api.github.com/users/deep2696/orgs","repos_url":"https://api.github.com/users/deep2696/repos","events_url":"https://api.github.com/users/deep2696/events{/privacy}","received_events_url":"https://api.github.com/users/deep2696/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/deep2696/vsts-rm-extensions","description":"Collection of all RM and deployment extensions","fork":true,"url":"https://api.github.com/repos/deep2696/vsts-rm-extensions","forks_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/forks","keys_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/teams","hooks_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/hooks","issue_events_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/issues/events{/number}","events_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/events","assignees_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/assignees{/user}","branches_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/branches{/branch}","tags_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/tags","blobs_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/git/refs{/sha}","trees_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/statuses/{sha}","languages_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/languages","stargazers_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/stargazers","contributors_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/contributors","subscribers_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/subscribers","subscription_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/subscription","commits_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/commits{/sha}","git_commits_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/git/commits{/sha}","comments_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/comments{/number}","issue_comment_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/issues/comments{/number}","contents_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/contents/{+path}","compare_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/merges","archive_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/downloads","issues_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/issues{/number}","pulls_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/pulls{/number}","milestones_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/milestones{/number}","notifications_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/labels{/name}","releases_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/releases{/id}","deployments_url":"https://api.github.com/repos/deep2696/vsts-rm-extensions/deployments","created_at":"2018-06-07T06:42:35Z","updated_at":"2018-06-19T11:21:13Z","pushed_at":"2018-06-19T11:21:10Z","git_url":"git://github.com/deep2696/vsts-rm-extensions.git","ssh_url":"git@github.com:deep2696/vsts-rm-extensions.git","clone_url":"https://github.com/deep2696/vsts-rm-extensions.git","svn_url":"https://github.com/deep2696/vsts-rm-extensions","homepage":"http://www.visualstudio.com/explore/release-management-vs","size":5181,"stargazers_count":0,"watchers_count":0,"language":"PowerShell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"84d84ce637c85c98fe37816fefceaa41525e2275","user":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":55225846,"node_id":"MDEwOlJlcG9zaXRvcnk1NTIyNTg0Ng==","name":"vsts-rm-extensions","full_name":"Microsoft/vsts-rm-extensions","owner":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/vsts-rm-extensions","description":"Collection of all RM and deployment extensions","fork":false,"url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions","forks_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/forks","keys_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/teams","hooks_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/events","assignees_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/tags","blobs_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/languages","stargazers_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/subscription","commits_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/merges","archive_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/downloads","issues_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/deployments","created_at":"2016-04-01T10:56:59Z","updated_at":"2018-06-19T13:18:28Z","pushed_at":"2018-06-19T11:21:12Z","git_url":"git://github.com/Microsoft/vsts-rm-extensions.git","ssh_url":"git@github.com:Microsoft/vsts-rm-extensions.git","clone_url":"https://github.com/Microsoft/vsts-rm-extensions.git","svn_url":"https://github.com/Microsoft/vsts-rm-extensions","homepage":"http://www.visualstudio.com/explore/release-management-vs","size":5089,"stargazers_count":57,"watchers_count":57,"language":"PowerShell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":87,"mirror_url":null,"archived":false,"open_issues_count":47,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":87,"open_issues":47,"watchers":57,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/pulls/446"},"html":{"href":"https://github.com/Microsoft/vsts-rm-extensions/pull/446"},"issue":{"href":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/issues/446"},"comments":{"href":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/issues/446/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/pulls/446/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/pulls/446/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/vsts-rm-extensions/statuses/38e8f4037821b40f63d0d89a3b343b7550de8422"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"omeshp"}}