{"action":"created","comment":{"url":"https://api.github.com/repos/openwhisk/openwhisk/pulls/comments/88620525","pull_request_review_id":9188690,"id":88620525,"diff_hunk":"@@ -781,6 +796,318 @@ trait WhiskActionsApi extends WhiskCollectionAPI {\n         }\n     }\n \n+    /** Begin Sequence invocation/activation code */\n+\n+    /**\n+     * Executes a sequence by invoking in a blocking fashion each of its components.\n+     *\n+     * @param user the user invoking the action\n+     * @param action the sequence action to be invoked\n+     * @param env the merged parameters from the package/reference if any TODO: check ignoring these params\n+     * @param payload the dynamic arguments for the activation\n+     * @param blocking true iff this is a blocking invoke\n+     * @param topmost true iff this is the topmost sequence invoked directly through the api (not indirectly through a sequence)\n+     * @param components the actions in the sequence\n+     * @param cause the id of the activation that caused this sequence (defined only for inner sequences and None for topmost sequences)\n+     * @param atomicActionsCount the dynamic atomic action count observed so far since the start of invocation of the topmost sequence(0 if topmost)\n+     * @param transid a transaction id for logging\n+     * @return a future of type (ActivationId, Some(WhiskActivation), atomicActionsCount) if blocking; else (ActivationId, None, 0)\n+     */\n+    private def invokeSequence(\n+            user: Identity,\n+            action: WhiskAction,\n+            //env: Option[Parameters],\n+            payload: Option[JsObject],\n+            blocking: Boolean,\n+            topmost: Boolean,\n+            components: Vector[FullyQualifiedEntityName],\n+            cause: Option[ActivationId],\n+            atomicActionsCount: Int)(implicit transid: TransactionId): Future[(ActivationId, Option[WhiskActivation], Int)] = {\n+        // create new activation id that corresponds to the sequence\n+        val seqActivationId = activationIdFactory.make()\n+        info(this, s\"Invoking sequence $action topmost $topmost activationid '$seqActivationId'\")\n+        val start = Instant.now(Clock.systemUTC())\n+        var seqActivation: Option[WhiskActivation] = None\n+        // the cause for the component activations is the current sequence\n+        val futureWskActivations = invokeSequenceComponents(user, action, seqActivationId, payload, components, cause = Some(seqActivationId), atomicActionsCount)\n+        val futureSeqResult = Future.sequence(futureWskActivations)\n+        val response: Future[(ActivationId, Option[WhiskActivation], Int)] =\n+            if (topmost) { // need to deal with blocking and closing connection\n+                if (blocking) {\n+                    val timeout = maxWaitForBlockingActivation + blockingInvokeGrace\n+                    val futureSeqResultTimeout = futureSeqResult withTimeout(timeout, new BlockingInvokeTimeout(seqActivationId))\n+                    // if the future fails with a timeout, the failure is dealt with at the caller level\n+                    futureSeqResultTimeout map { wskActivationTuples =>\n+                        val wskActivationEithers = wskActivationTuples.map(_._1)\n+                        // the execution of the sequence was successful, return the result\n+                        val end = Instant.now(Clock.systemUTC())\n+                        seqActivation = Some(makeSequenceActivation(user, action, seqActivationId, wskActivationEithers, topmost, cause, start, end))","path":"core/controller/src/main/scala/whisk/core/controller/Actions.scala","position":249,"original_position":249,"commit_id":"8c452b702f9d5bd52910e6b5f834b36660979dde","original_commit_id":"8c452b702f9d5bd52910e6b5f834b36660979dde","user":{"login":"rabbah","id":4959922,"avatar_url":"https://avatars.githubusercontent.com/u/4959922?v=3","gravatar_id":"","url":"https://api.github.com/users/rabbah","html_url":"https://github.com/rabbah","followers_url":"https://api.github.com/users/rabbah/followers","following_url":"https://api.github.com/users/rabbah/following{/other_user}","gists_url":"https://api.github.com/users/rabbah/gists{/gist_id}","starred_url":"https://api.github.com/users/rabbah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rabbah/subscriptions","organizations_url":"https://api.github.com/users/rabbah/orgs","repos_url":"https://api.github.com/users/rabbah/repos","events_url":"https://api.github.com/users/rabbah/events{/privacy}","received_events_url":"https://api.github.com/users/rabbah/received_events","type":"User","site_admin":false},"body":"this flow for creating the seqActivation is repeated three times - the only difference is the `end` marker. \r\nsince the `end` marker is not that important for the sequence, is it really worth the code duplication?","created_at":"2016-11-18T09:07:27Z","updated_at":"2016-11-18T09:07:27Z","html_url":"https://github.com/openwhisk/openwhisk/pull/1473#discussion_r88620525","pull_request_url":"https://api.github.com/repos/openwhisk/openwhisk/pulls/1473","_links":{"self":{"href":"https://api.github.com/repos/openwhisk/openwhisk/pulls/comments/88620525"},"html":{"href":"https://github.com/openwhisk/openwhisk/pull/1473#discussion_r88620525"},"pull_request":{"href":"https://api.github.com/repos/openwhisk/openwhisk/pulls/1473"}}},"pull_request":{"url":"https://api.github.com/repos/openwhisk/openwhisk/pulls/1473","id":92443026,"html_url":"https://github.com/openwhisk/openwhisk/pull/1473","diff_url":"https://github.com/openwhisk/openwhisk/pull/1473.diff","patch_url":"https://github.com/openwhisk/openwhisk/pull/1473.patch","issue_url":"https://api.github.com/repos/openwhisk/openwhisk/issues/1473","number":1473,"state":"open","locked":false,"title":"Sequence execution","user":{"login":"ioana-blue","id":17202292,"avatar_url":"https://avatars.githubusercontent.com/u/17202292?v=3","gravatar_id":"","url":"https://api.github.com/users/ioana-blue","html_url":"https://github.com/ioana-blue","followers_url":"https://api.github.com/users/ioana-blue/followers","following_url":"https://api.github.com/users/ioana-blue/following{/other_user}","gists_url":"https://api.github.com/users/ioana-blue/gists{/gist_id}","starred_url":"https://api.github.com/users/ioana-blue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ioana-blue/subscriptions","organizations_url":"https://api.github.com/users/ioana-blue/orgs","repos_url":"https://api.github.com/users/ioana-blue/repos","events_url":"https://api.github.com/users/ioana-blue/events{/privacy}","received_events_url":"https://api.github.com/users/ioana-blue/received_events","type":"User","site_admin":false},"body":"The bulk of the work is done. Submitting for review to get some feedback.\r\n","created_at":"2016-11-05T05:24:57Z","updated_at":"2016-11-18T09:07:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b7722a82f0bbbf39a035a935049bc84dfdf4355e","assignee":{"login":"rabbah","id":4959922,"avatar_url":"https://avatars.githubusercontent.com/u/4959922?v=3","gravatar_id":"","url":"https://api.github.com/users/rabbah","html_url":"https://github.com/rabbah","followers_url":"https://api.github.com/users/rabbah/followers","following_url":"https://api.github.com/users/rabbah/following{/other_user}","gists_url":"https://api.github.com/users/rabbah/gists{/gist_id}","starred_url":"https://api.github.com/users/rabbah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rabbah/subscriptions","organizations_url":"https://api.github.com/users/rabbah/orgs","repos_url":"https://api.github.com/users/rabbah/repos","events_url":"https://api.github.com/users/rabbah/events{/privacy}","received_events_url":"https://api.github.com/users/rabbah/received_events","type":"User","site_admin":false},"assignees":[{"login":"rabbah","id":4959922,"avatar_url":"https://avatars.githubusercontent.com/u/4959922?v=3","gravatar_id":"","url":"https://api.github.com/users/rabbah","html_url":"https://github.com/rabbah","followers_url":"https://api.github.com/users/rabbah/followers","following_url":"https://api.github.com/users/rabbah/following{/other_user}","gists_url":"https://api.github.com/users/rabbah/gists{/gist_id}","starred_url":"https://api.github.com/users/rabbah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rabbah/subscriptions","organizations_url":"https://api.github.com/users/rabbah/orgs","repos_url":"https://api.github.com/users/rabbah/repos","events_url":"https://api.github.com/users/rabbah/events{/privacy}","received_events_url":"https://api.github.com/users/rabbah/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/openwhisk/openwhisk/pulls/1473/commits","review_comments_url":"https://api.github.com/repos/openwhisk/openwhisk/pulls/1473/comments","review_comment_url":"https://api.github.com/repos/openwhisk/openwhisk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openwhisk/openwhisk/issues/1473/comments","statuses_url":"https://api.github.com/repos/openwhisk/openwhisk/statuses/8c452b702f9d5bd52910e6b5f834b36660979dde","head":{"label":"ioana-blue:ioana-sequence-execution","ref":"ioana-sequence-execution","sha":"8c452b702f9d5bd52910e6b5f834b36660979dde","user":{"login":"ioana-blue","id":17202292,"avatar_url":"https://avatars.githubusercontent.com/u/17202292?v=3","gravatar_id":"","url":"https://api.github.com/users/ioana-blue","html_url":"https://github.com/ioana-blue","followers_url":"https://api.github.com/users/ioana-blue/followers","following_url":"https://api.github.com/users/ioana-blue/following{/other_user}","gists_url":"https://api.github.com/users/ioana-blue/gists{/gist_id}","starred_url":"https://api.github.com/users/ioana-blue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ioana-blue/subscriptions","organizations_url":"https://api.github.com/users/ioana-blue/orgs","repos_url":"https://api.github.com/users/ioana-blue/repos","events_url":"https://api.github.com/users/ioana-blue/events{/privacy}","received_events_url":"https://api.github.com/users/ioana-blue/received_events","type":"User","site_admin":false},"repo":{"id":53340716,"name":"openwhisk","full_name":"ioana-blue/openwhisk","owner":{"login":"ioana-blue","id":17202292,"avatar_url":"https://avatars.githubusercontent.com/u/17202292?v=3","gravatar_id":"","url":"https://api.github.com/users/ioana-blue","html_url":"https://github.com/ioana-blue","followers_url":"https://api.github.com/users/ioana-blue/followers","following_url":"https://api.github.com/users/ioana-blue/following{/other_user}","gists_url":"https://api.github.com/users/ioana-blue/gists{/gist_id}","starred_url":"https://api.github.com/users/ioana-blue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ioana-blue/subscriptions","organizations_url":"https://api.github.com/users/ioana-blue/orgs","repos_url":"https://api.github.com/users/ioana-blue/repos","events_url":"https://api.github.com/users/ioana-blue/events{/privacy}","received_events_url":"https://api.github.com/users/ioana-blue/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ioana-blue/openwhisk","description":"OpenWhisk is a cloud-first distributed event-based programming service.","fork":true,"url":"https://api.github.com/repos/ioana-blue/openwhisk","forks_url":"https://api.github.com/repos/ioana-blue/openwhisk/forks","keys_url":"https://api.github.com/repos/ioana-blue/openwhisk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ioana-blue/openwhisk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ioana-blue/openwhisk/teams","hooks_url":"https://api.github.com/repos/ioana-blue/openwhisk/hooks","issue_events_url":"https://api.github.com/repos/ioana-blue/openwhisk/issues/events{/number}","events_url":"https://api.github.com/repos/ioana-blue/openwhisk/events","assignees_url":"https://api.github.com/repos/ioana-blue/openwhisk/assignees{/user}","branches_url":"https://api.github.com/repos/ioana-blue/openwhisk/branches{/branch}","tags_url":"https://api.github.com/repos/ioana-blue/openwhisk/tags","blobs_url":"https://api.github.com/repos/ioana-blue/openwhisk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ioana-blue/openwhisk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ioana-blue/openwhisk/git/refs{/sha}","trees_url":"https://api.github.com/repos/ioana-blue/openwhisk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ioana-blue/openwhisk/statuses/{sha}","languages_url":"https://api.github.com/repos/ioana-blue/openwhisk/languages","stargazers_url":"https://api.github.com/repos/ioana-blue/openwhisk/stargazers","contributors_url":"https://api.github.com/repos/ioana-blue/openwhisk/contributors","subscribers_url":"https://api.github.com/repos/ioana-blue/openwhisk/subscribers","subscription_url":"https://api.github.com/repos/ioana-blue/openwhisk/subscription","commits_url":"https://api.github.com/repos/ioana-blue/openwhisk/commits{/sha}","git_commits_url":"https://api.github.com/repos/ioana-blue/openwhisk/git/commits{/sha}","comments_url":"https://api.github.com/repos/ioana-blue/openwhisk/comments{/number}","issue_comment_url":"https://api.github.com/repos/ioana-blue/openwhisk/issues/comments{/number}","contents_url":"https://api.github.com/repos/ioana-blue/openwhisk/contents/{+path}","compare_url":"https://api.github.com/repos/ioana-blue/openwhisk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ioana-blue/openwhisk/merges","archive_url":"https://api.github.com/repos/ioana-blue/openwhisk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ioana-blue/openwhisk/downloads","issues_url":"https://api.github.com/repos/ioana-blue/openwhisk/issues{/number}","pulls_url":"https://api.github.com/repos/ioana-blue/openwhisk/pulls{/number}","milestones_url":"https://api.github.com/repos/ioana-blue/openwhisk/milestones{/number}","notifications_url":"https://api.github.com/repos/ioana-blue/openwhisk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ioana-blue/openwhisk/labels{/name}","releases_url":"https://api.github.com/repos/ioana-blue/openwhisk/releases{/id}","deployments_url":"https://api.github.com/repos/ioana-blue/openwhisk/deployments","created_at":"2016-03-07T16:32:35Z","updated_at":"2016-03-07T16:32:37Z","pushed_at":"2016-11-18T03:59:42Z","git_url":"git://github.com/ioana-blue/openwhisk.git","ssh_url":"git@github.com:ioana-blue/openwhisk.git","clone_url":"https://github.com/ioana-blue/openwhisk.git","svn_url":"https://github.com/ioana-blue/openwhisk","homepage":"","size":43728,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openwhisk:master","ref":"master","sha":"884c913c1bddfd4d2cc5b1409cb2b8e3c46d8977","user":{"login":"openwhisk","id":16900235,"avatar_url":"https://avatars.githubusercontent.com/u/16900235?v=3","gravatar_id":"","url":"https://api.github.com/users/openwhisk","html_url":"https://github.com/openwhisk","followers_url":"https://api.github.com/users/openwhisk/followers","following_url":"https://api.github.com/users/openwhisk/following{/other_user}","gists_url":"https://api.github.com/users/openwhisk/gists{/gist_id}","starred_url":"https://api.github.com/users/openwhisk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openwhisk/subscriptions","organizations_url":"https://api.github.com/users/openwhisk/orgs","repos_url":"https://api.github.com/users/openwhisk/repos","events_url":"https://api.github.com/users/openwhisk/events{/privacy}","received_events_url":"https://api.github.com/users/openwhisk/received_events","type":"Organization","site_admin":false},"repo":{"id":52039373,"name":"openwhisk","full_name":"openwhisk/openwhisk","owner":{"login":"openwhisk","id":16900235,"avatar_url":"https://avatars.githubusercontent.com/u/16900235?v=3","gravatar_id":"","url":"https://api.github.com/users/openwhisk","html_url":"https://github.com/openwhisk","followers_url":"https://api.github.com/users/openwhisk/followers","following_url":"https://api.github.com/users/openwhisk/following{/other_user}","gists_url":"https://api.github.com/users/openwhisk/gists{/gist_id}","starred_url":"https://api.github.com/users/openwhisk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openwhisk/subscriptions","organizations_url":"https://api.github.com/users/openwhisk/orgs","repos_url":"https://api.github.com/users/openwhisk/repos","events_url":"https://api.github.com/users/openwhisk/events{/privacy}","received_events_url":"https://api.github.com/users/openwhisk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openwhisk/openwhisk","description":"OpenWhisk is a serverless event-based programming service.","fork":false,"url":"https://api.github.com/repos/openwhisk/openwhisk","forks_url":"https://api.github.com/repos/openwhisk/openwhisk/forks","keys_url":"https://api.github.com/repos/openwhisk/openwhisk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openwhisk/openwhisk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openwhisk/openwhisk/teams","hooks_url":"https://api.github.com/repos/openwhisk/openwhisk/hooks","issue_events_url":"https://api.github.com/repos/openwhisk/openwhisk/issues/events{/number}","events_url":"https://api.github.com/repos/openwhisk/openwhisk/events","assignees_url":"https://api.github.com/repos/openwhisk/openwhisk/assignees{/user}","branches_url":"https://api.github.com/repos/openwhisk/openwhisk/branches{/branch}","tags_url":"https://api.github.com/repos/openwhisk/openwhisk/tags","blobs_url":"https://api.github.com/repos/openwhisk/openwhisk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openwhisk/openwhisk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openwhisk/openwhisk/git/refs{/sha}","trees_url":"https://api.github.com/repos/openwhisk/openwhisk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openwhisk/openwhisk/statuses/{sha}","languages_url":"https://api.github.com/repos/openwhisk/openwhisk/languages","stargazers_url":"https://api.github.com/repos/openwhisk/openwhisk/stargazers","contributors_url":"https://api.github.com/repos/openwhisk/openwhisk/contributors","subscribers_url":"https://api.github.com/repos/openwhisk/openwhisk/subscribers","subscription_url":"https://api.github.com/repos/openwhisk/openwhisk/subscription","commits_url":"https://api.github.com/repos/openwhisk/openwhisk/commits{/sha}","git_commits_url":"https://api.github.com/repos/openwhisk/openwhisk/git/commits{/sha}","comments_url":"https://api.github.com/repos/openwhisk/openwhisk/comments{/number}","issue_comment_url":"https://api.github.com/repos/openwhisk/openwhisk/issues/comments{/number}","contents_url":"https://api.github.com/repos/openwhisk/openwhisk/contents/{+path}","compare_url":"https://api.github.com/repos/openwhisk/openwhisk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openwhisk/openwhisk/merges","archive_url":"https://api.github.com/repos/openwhisk/openwhisk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openwhisk/openwhisk/downloads","issues_url":"https://api.github.com/repos/openwhisk/openwhisk/issues{/number}","pulls_url":"https://api.github.com/repos/openwhisk/openwhisk/pulls{/number}","milestones_url":"https://api.github.com/repos/openwhisk/openwhisk/milestones{/number}","notifications_url":"https://api.github.com/repos/openwhisk/openwhisk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openwhisk/openwhisk/labels{/name}","releases_url":"https://api.github.com/repos/openwhisk/openwhisk/releases{/id}","deployments_url":"https://api.github.com/repos/openwhisk/openwhisk/deployments","created_at":"2016-02-18T21:16:19Z","updated_at":"2016-11-17T23:22:24Z","pushed_at":"2016-11-18T08:59:18Z","git_url":"git://github.com/openwhisk/openwhisk.git","ssh_url":"git@github.com:openwhisk/openwhisk.git","clone_url":"https://github.com/openwhisk/openwhisk.git","svn_url":"https://github.com/openwhisk/openwhisk","homepage":"","size":45845,"stargazers_count":753,"watchers_count":753,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":169,"mirror_url":null,"open_issues_count":324,"forks":169,"open_issues":324,"watchers":753,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openwhisk/openwhisk/pulls/1473"},"html":{"href":"https://github.com/openwhisk/openwhisk/pull/1473"},"issue":{"href":"https://api.github.com/repos/openwhisk/openwhisk/issues/1473"},"comments":{"href":"https://api.github.com/repos/openwhisk/openwhisk/issues/1473/comments"},"review_comments":{"href":"https://api.github.com/repos/openwhisk/openwhisk/pulls/1473/comments"},"review_comment":{"href":"https://api.github.com/repos/openwhisk/openwhisk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openwhisk/openwhisk/pulls/1473/commits"},"statuses":{"href":"https://api.github.com/repos/openwhisk/openwhisk/statuses/8c452b702f9d5bd52910e6b5f834b36660979dde"}}}}
{"actor":{"display_login":"rabbah"}}