{"action":"created","comment":{"url":"https://api.github.com/repos/nutanix/papiea-js/pulls/comments/344289302","pull_request_review_id":314355763,"id":344289302,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM0NDI4OTMwMg==","diff_hunk":"@@ -39,33 +39,67 @@ export class DifferResolver {\n \n     private async _run(delay: number) {\n         while (true) {\n+            await this.clearFinishedTasks()\n             await timeout(delay)\n-            this.clearFinishedTasks()\n+            await this.activateTask()\n         }\n     }\n \n-    public clearFinishedTasks() {\n-\n+    public async activateTask(): Promise<void> {\n+        for (let entityTask of this.watchlist) {\n+            let activeTasks = entityTask.tasks.filter(task => task.status === IntentfulStatus.Active)\n+            if (activeTasks.length === 0 && entityTask.tasks.length > 0) {\n+                let activeTask = entityTask.tasks[0]\n+                activeTask.status = IntentfulStatus.Active\n+                await this.intentfulTaskDb.update_task(activeTask.uuid, activeTask)\n+                const [metadata, entitySpec] = await this.specDb.get_spec(activeTask.entity_ref)\n+                const [_, entityStatus] = await this.statusDb.get_status(activeTask.entity_ref)\n+                for (let diff of activeTask.diffs) {\n+                    // TODO: diff fields should go into the context\n+                    await axios.post(diff.intentful_signature.procedural_signature.procedure_callback, {\n+                        metadata: metadata,\n+                        spec: entitySpec,\n+                        status: entityStatus,\n+                        input: diff.diff_fields\n+                    })","path":"papiea-engine/src/tasks/differ_resolver.ts","position":64,"original_position":46,"commit_id":"6606139cc658d00faf1a2e1e606213147f45e637","original_commit_id":"63e430868cc013195027056d643d94af039ca55a","user":{"login":"shlomi-nx","id":39283673,"node_id":"MDQ6VXNlcjM5MjgzNjcz","avatar_url":"https://avatars1.githubusercontent.com/u/39283673?v=4","gravatar_id":"","url":"https://api.github.com/users/shlomi-nx","html_url":"https://github.com/shlomi-nx","followers_url":"https://api.github.com/users/shlomi-nx/followers","following_url":"https://api.github.com/users/shlomi-nx/following{/other_user}","gists_url":"https://api.github.com/users/shlomi-nx/gists{/gist_id}","starred_url":"https://api.github.com/users/shlomi-nx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shlomi-nx/subscriptions","organizations_url":"https://api.github.com/users/shlomi-nx/orgs","repos_url":"https://api.github.com/users/shlomi-nx/repos","events_url":"https://api.github.com/users/shlomi-nx/events{/privacy}","received_events_url":"https://api.github.com/users/shlomi-nx/received_events","type":"User","site_admin":false},"body":"The behavior is exactly the same as regular procedures. Starts out with the identity of the provider, and if required, in code, the token will be switched to that of the user (see create cluster procedure for example)","created_at":"2019-11-08T17:40:45Z","updated_at":"2019-11-08T17:40:45Z","html_url":"https://github.com/nutanix/papiea-js/pull/308#discussion_r344289302","pull_request_url":"https://api.github.com/repos/nutanix/papiea-js/pulls/308","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/nutanix/papiea-js/pulls/comments/344289302"},"html":{"href":"https://github.com/nutanix/papiea-js/pull/308#discussion_r344289302"},"pull_request":{"href":"https://api.github.com/repos/nutanix/papiea-js/pulls/308"}},"in_reply_to_id":341979888},"pull_request":{"url":"https://api.github.com/repos/nutanix/papiea-js/pulls/308","id":324231665,"node_id":"MDExOlB1bGxSZXF1ZXN0MzI0MjMxNjY1","html_url":"https://github.com/nutanix/papiea-js/pull/308","diff_url":"https://github.com/nutanix/papiea-js/pull/308.diff","patch_url":"https://github.com/nutanix/papiea-js/pull/308.patch","issue_url":"https://api.github.com/repos/nutanix/papiea-js/issues/308","number":308,"state":"open","locked":false,"title":"Intentful Core","user":{"login":"Emulebest","id":26462528,"node_id":"MDQ6VXNlcjI2NDYyNTI4","avatar_url":"https://avatars0.githubusercontent.com/u/26462528?v=4","gravatar_id":"","url":"https://api.github.com/users/Emulebest","html_url":"https://github.com/Emulebest","followers_url":"https://api.github.com/users/Emulebest/followers","following_url":"https://api.github.com/users/Emulebest/following{/other_user}","gists_url":"https://api.github.com/users/Emulebest/gists{/gist_id}","starred_url":"https://api.github.com/users/Emulebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Emulebest/subscriptions","organizations_url":"https://api.github.com/users/Emulebest/orgs","repos_url":"https://api.github.com/users/Emulebest/repos","events_url":"https://api.github.com/users/Emulebest/events{/privacy}","received_events_url":"https://api.github.com/users/Emulebest/received_events","type":"User","site_admin":false},"body":"resolves #307 \r\nresolves #306 ","created_at":"2019-10-03T13:57:22Z","updated_at":"2019-11-08T17:40:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df06b37c8e578a24007ba29f0e0a856aae49b16f","assignee":{"login":"Emulebest","id":26462528,"node_id":"MDQ6VXNlcjI2NDYyNTI4","avatar_url":"https://avatars0.githubusercontent.com/u/26462528?v=4","gravatar_id":"","url":"https://api.github.com/users/Emulebest","html_url":"https://github.com/Emulebest","followers_url":"https://api.github.com/users/Emulebest/followers","following_url":"https://api.github.com/users/Emulebest/following{/other_user}","gists_url":"https://api.github.com/users/Emulebest/gists{/gist_id}","starred_url":"https://api.github.com/users/Emulebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Emulebest/subscriptions","organizations_url":"https://api.github.com/users/Emulebest/orgs","repos_url":"https://api.github.com/users/Emulebest/repos","events_url":"https://api.github.com/users/Emulebest/events{/privacy}","received_events_url":"https://api.github.com/users/Emulebest/received_events","type":"User","site_admin":false},"assignees":[{"login":"Emulebest","id":26462528,"node_id":"MDQ6VXNlcjI2NDYyNTI4","avatar_url":"https://avatars0.githubusercontent.com/u/26462528?v=4","gravatar_id":"","url":"https://api.github.com/users/Emulebest","html_url":"https://github.com/Emulebest","followers_url":"https://api.github.com/users/Emulebest/followers","following_url":"https://api.github.com/users/Emulebest/following{/other_user}","gists_url":"https://api.github.com/users/Emulebest/gists{/gist_id}","starred_url":"https://api.github.com/users/Emulebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Emulebest/subscriptions","organizations_url":"https://api.github.com/users/Emulebest/orgs","repos_url":"https://api.github.com/users/Emulebest/repos","events_url":"https://api.github.com/users/Emulebest/events{/privacy}","received_events_url":"https://api.github.com/users/Emulebest/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1161876698,"node_id":"MDU6TGFiZWwxMTYxODc2Njk4","url":"https://api.github.com/repos/nutanix/papiea-js/labels/backlog","name":"backlog","color":"ededed","default":false},{"id":1160980732,"node_id":"MDU6TGFiZWwxMTYwOTgwNzMy","url":"https://api.github.com/repos/nutanix/papiea-js/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/nutanix/papiea-js/pulls/308/commits","review_comments_url":"https://api.github.com/repos/nutanix/papiea-js/pulls/308/comments","review_comment_url":"https://api.github.com/repos/nutanix/papiea-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nutanix/papiea-js/issues/308/comments","statuses_url":"https://api.github.com/repos/nutanix/papiea-js/statuses/6606139cc658d00faf1a2e1e606213147f45e637","head":{"label":"nutanix:intentful_core","ref":"intentful_core","sha":"6606139cc658d00faf1a2e1e606213147f45e637","user":{"login":"nutanix","id":6165865,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNjU4NjU=","avatar_url":"https://avatars2.githubusercontent.com/u/6165865?v=4","gravatar_id":"","url":"https://api.github.com/users/nutanix","html_url":"https://github.com/nutanix","followers_url":"https://api.github.com/users/nutanix/followers","following_url":"https://api.github.com/users/nutanix/following{/other_user}","gists_url":"https://api.github.com/users/nutanix/gists{/gist_id}","starred_url":"https://api.github.com/users/nutanix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nutanix/subscriptions","organizations_url":"https://api.github.com/users/nutanix/orgs","repos_url":"https://api.github.com/users/nutanix/repos","events_url":"https://api.github.com/users/nutanix/events{/privacy}","received_events_url":"https://api.github.com/users/nutanix/received_events","type":"Organization","site_admin":false},"repo":{"id":153359549,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMzNTk1NDk=","name":"papiea-js","full_name":"nutanix/papiea-js","private":false,"owner":{"login":"nutanix","id":6165865,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNjU4NjU=","avatar_url":"https://avatars2.githubusercontent.com/u/6165865?v=4","gravatar_id":"","url":"https://api.github.com/users/nutanix","html_url":"https://github.com/nutanix","followers_url":"https://api.github.com/users/nutanix/followers","following_url":"https://api.github.com/users/nutanix/following{/other_user}","gists_url":"https://api.github.com/users/nutanix/gists{/gist_id}","starred_url":"https://api.github.com/users/nutanix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nutanix/subscriptions","organizations_url":"https://api.github.com/users/nutanix/orgs","repos_url":"https://api.github.com/users/nutanix/repos","events_url":"https://api.github.com/users/nutanix/events{/privacy}","received_events_url":"https://api.github.com/users/nutanix/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/nutanix/papiea-js","description":null,"fork":false,"url":"https://api.github.com/repos/nutanix/papiea-js","forks_url":"https://api.github.com/repos/nutanix/papiea-js/forks","keys_url":"https://api.github.com/repos/nutanix/papiea-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nutanix/papiea-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nutanix/papiea-js/teams","hooks_url":"https://api.github.com/repos/nutanix/papiea-js/hooks","issue_events_url":"https://api.github.com/repos/nutanix/papiea-js/issues/events{/number}","events_url":"https://api.github.com/repos/nutanix/papiea-js/events","assignees_url":"https://api.github.com/repos/nutanix/papiea-js/assignees{/user}","branches_url":"https://api.github.com/repos/nutanix/papiea-js/branches{/branch}","tags_url":"https://api.github.com/repos/nutanix/papiea-js/tags","blobs_url":"https://api.github.com/repos/nutanix/papiea-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nutanix/papiea-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nutanix/papiea-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/nutanix/papiea-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nutanix/papiea-js/statuses/{sha}","languages_url":"https://api.github.com/repos/nutanix/papiea-js/languages","stargazers_url":"https://api.github.com/repos/nutanix/papiea-js/stargazers","contributors_url":"https://api.github.com/repos/nutanix/papiea-js/contributors","subscribers_url":"https://api.github.com/repos/nutanix/papiea-js/subscribers","subscription_url":"https://api.github.com/repos/nutanix/papiea-js/subscription","commits_url":"https://api.github.com/repos/nutanix/papiea-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/nutanix/papiea-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/nutanix/papiea-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/nutanix/papiea-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/nutanix/papiea-js/contents/{+path}","compare_url":"https://api.github.com/repos/nutanix/papiea-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nutanix/papiea-js/merges","archive_url":"https://api.github.com/repos/nutanix/papiea-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nutanix/papiea-js/downloads","issues_url":"https://api.github.com/repos/nutanix/papiea-js/issues{/number}","pulls_url":"https://api.github.com/repos/nutanix/papiea-js/pulls{/number}","milestones_url":"https://api.github.com/repos/nutanix/papiea-js/milestones{/number}","notifications_url":"https://api.github.com/repos/nutanix/papiea-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nutanix/papiea-js/labels{/name}","releases_url":"https://api.github.com/repos/nutanix/papiea-js/releases{/id}","deployments_url":"https://api.github.com/repos/nutanix/papiea-js/deployments","created_at":"2018-10-16T21:57:29Z","updated_at":"2019-10-30T16:38:38Z","pushed_at":"2019-11-07T15:02:14Z","git_url":"git://github.com/nutanix/papiea-js.git","ssh_url":"git@github.com:nutanix/papiea-js.git","clone_url":"https://github.com/nutanix/papiea-js.git","svn_url":"https://github.com/nutanix/papiea-js","homepage":null,"size":2682,"stargazers_count":1,"watchers_count":1,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":42,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":42,"watchers":1,"default_branch":"master"}},"base":{"label":"nutanix:master","ref":"master","sha":"c6890e7c691701d502980febf13eb5bcbcdc2b63","user":{"login":"nutanix","id":6165865,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNjU4NjU=","avatar_url":"https://avatars2.githubusercontent.com/u/6165865?v=4","gravatar_id":"","url":"https://api.github.com/users/nutanix","html_url":"https://github.com/nutanix","followers_url":"https://api.github.com/users/nutanix/followers","following_url":"https://api.github.com/users/nutanix/following{/other_user}","gists_url":"https://api.github.com/users/nutanix/gists{/gist_id}","starred_url":"https://api.github.com/users/nutanix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nutanix/subscriptions","organizations_url":"https://api.github.com/users/nutanix/orgs","repos_url":"https://api.github.com/users/nutanix/repos","events_url":"https://api.github.com/users/nutanix/events{/privacy}","received_events_url":"https://api.github.com/users/nutanix/received_events","type":"Organization","site_admin":false},"repo":{"id":153359549,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMzNTk1NDk=","name":"papiea-js","full_name":"nutanix/papiea-js","private":false,"owner":{"login":"nutanix","id":6165865,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNjU4NjU=","avatar_url":"https://avatars2.githubusercontent.com/u/6165865?v=4","gravatar_id":"","url":"https://api.github.com/users/nutanix","html_url":"https://github.com/nutanix","followers_url":"https://api.github.com/users/nutanix/followers","following_url":"https://api.github.com/users/nutanix/following{/other_user}","gists_url":"https://api.github.com/users/nutanix/gists{/gist_id}","starred_url":"https://api.github.com/users/nutanix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nutanix/subscriptions","organizations_url":"https://api.github.com/users/nutanix/orgs","repos_url":"https://api.github.com/users/nutanix/repos","events_url":"https://api.github.com/users/nutanix/events{/privacy}","received_events_url":"https://api.github.com/users/nutanix/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/nutanix/papiea-js","description":null,"fork":false,"url":"https://api.github.com/repos/nutanix/papiea-js","forks_url":"https://api.github.com/repos/nutanix/papiea-js/forks","keys_url":"https://api.github.com/repos/nutanix/papiea-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nutanix/papiea-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nutanix/papiea-js/teams","hooks_url":"https://api.github.com/repos/nutanix/papiea-js/hooks","issue_events_url":"https://api.github.com/repos/nutanix/papiea-js/issues/events{/number}","events_url":"https://api.github.com/repos/nutanix/papiea-js/events","assignees_url":"https://api.github.com/repos/nutanix/papiea-js/assignees{/user}","branches_url":"https://api.github.com/repos/nutanix/papiea-js/branches{/branch}","tags_url":"https://api.github.com/repos/nutanix/papiea-js/tags","blobs_url":"https://api.github.com/repos/nutanix/papiea-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nutanix/papiea-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nutanix/papiea-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/nutanix/papiea-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nutanix/papiea-js/statuses/{sha}","languages_url":"https://api.github.com/repos/nutanix/papiea-js/languages","stargazers_url":"https://api.github.com/repos/nutanix/papiea-js/stargazers","contributors_url":"https://api.github.com/repos/nutanix/papiea-js/contributors","subscribers_url":"https://api.github.com/repos/nutanix/papiea-js/subscribers","subscription_url":"https://api.github.com/repos/nutanix/papiea-js/subscription","commits_url":"https://api.github.com/repos/nutanix/papiea-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/nutanix/papiea-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/nutanix/papiea-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/nutanix/papiea-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/nutanix/papiea-js/contents/{+path}","compare_url":"https://api.github.com/repos/nutanix/papiea-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nutanix/papiea-js/merges","archive_url":"https://api.github.com/repos/nutanix/papiea-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nutanix/papiea-js/downloads","issues_url":"https://api.github.com/repos/nutanix/papiea-js/issues{/number}","pulls_url":"https://api.github.com/repos/nutanix/papiea-js/pulls{/number}","milestones_url":"https://api.github.com/repos/nutanix/papiea-js/milestones{/number}","notifications_url":"https://api.github.com/repos/nutanix/papiea-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nutanix/papiea-js/labels{/name}","releases_url":"https://api.github.com/repos/nutanix/papiea-js/releases{/id}","deployments_url":"https://api.github.com/repos/nutanix/papiea-js/deployments","created_at":"2018-10-16T21:57:29Z","updated_at":"2019-10-30T16:38:38Z","pushed_at":"2019-11-07T15:02:14Z","git_url":"git://github.com/nutanix/papiea-js.git","ssh_url":"git@github.com:nutanix/papiea-js.git","clone_url":"https://github.com/nutanix/papiea-js.git","svn_url":"https://github.com/nutanix/papiea-js","homepage":null,"size":2682,"stargazers_count":1,"watchers_count":1,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":42,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":42,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nutanix/papiea-js/pulls/308"},"html":{"href":"https://github.com/nutanix/papiea-js/pull/308"},"issue":{"href":"https://api.github.com/repos/nutanix/papiea-js/issues/308"},"comments":{"href":"https://api.github.com/repos/nutanix/papiea-js/issues/308/comments"},"review_comments":{"href":"https://api.github.com/repos/nutanix/papiea-js/pulls/308/comments"},"review_comment":{"href":"https://api.github.com/repos/nutanix/papiea-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nutanix/papiea-js/pulls/308/commits"},"statuses":{"href":"https://api.github.com/repos/nutanix/papiea-js/statuses/6606139cc658d00faf1a2e1e606213147f45e637"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"shlomi-nx"}}