[GitHub] rabbah opened a new pull request #3300: For MacOSX using docker-for-mac, do not use runc.

2018-02-16 Thread GitBox
rabbah opened a new pull request #3300: For MacOSX using docker-for-mac, do not 
use runc.
URL: https://github.com/apache/incubator-openwhisk/pull/3300
 
 
   `runc` fails on docker-for-mac; use docker pause/resume instead.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rabbah commented on issue #3167: Remove API for listing all entities in namespace

2018-02-16 Thread GitBox
rabbah commented on issue #3167: Remove API for listing all entities in 
namespace
URL: 
https://github.com/apache/incubator-openwhisk/pull/3167#issuecomment-366413304
 
 
   pg5/104 ? 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rabbah commented on issue #3298: Attempt to resolve action name from conductor to a fully qualified name for added convenience.

2018-02-16 Thread GitBox
rabbah commented on issue #3298: Attempt to resolve action name from conductor 
to a fully qualified name for added convenience.
URL: 
https://github.com/apache/incubator-openwhisk/pull/3298#issuecomment-366413109
 
 
   pg2/2829 already ? 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rabbah opened a new pull request #3299: Remove two log messages, tweak logging with metrics, add log message for conductors

2018-02-16 Thread GitBox
rabbah opened a new pull request #3299: Remove two log messages, tweak logging 
with metrics, add log message for conductors
URL: https://github.com/apache/incubator-openwhisk/pull/3299
 
 
   When logging only a metric, skip the message unless the log level is enabled.
   Lowered log level on two messages.
   Add log message for compositions.
   
   @vvraskin can you review?
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] csantanapr commented on issue #3298: Attempt to resolve action name from conductor to a fully qualified name for added convenience.

2018-02-16 Thread GitBox
csantanapr commented on issue #3298: Attempt to resolve action name from 
conductor to a fully qualified name for added convenience.
URL: 
https://github.com/apache/incubator-openwhisk/pull/3298#issuecomment-366411885
 
 
   @rabbah check on Travis and do PG


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mdeuser commented on issue #49: Add code query parameter for action get

2018-02-16 Thread GitBox
mdeuser commented on issue #49: Add code query parameter for action get
URL: 
https://github.com/apache/incubator-openwhisk-client-go/pull/49#issuecomment-366408881
 
 
   @dubeejw - is there a companion cli pr that exposes a new command line 
parameter to the `wsk action get` command?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] pritidesai commented on issue #748: ReadProjectDirectory() does not appear to work; uses default package

2018-02-16 Thread GitBox
pritidesai commented on issue #748: ReadProjectDirectory() does not appear to 
work; uses default package
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/748#issuecomment-366406316
 
 
   `ReadProjectDirectory()` is called when `wskdeploy` is invoked with 
`--use-defaults`. Lets delete this function and other functions from 
`filesystemreader.go`. This functionality was added to support auto creation of 
manifest file based on the directory structure `actions//...` in 
interactive mode. After discussing with @mrutkows regarding deprecating 
interactive mode, `--use-defaults` should be deprecated as well.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] pritidesai commented on issue #748: ReadProjectDirectory() does not appear to work; uses default package

2018-02-16 Thread GitBox
pritidesai commented on issue #748: ReadProjectDirectory() does not appear to 
work; uses default package
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/748#issuecomment-366406316
 
 
   `ReadProjectDirectory()` is called when `wskdeploy` is invoked with 
`--use-defaults`. Lets delete this function and other functions from 
`filesystemreader.go`. This functionality was added to support auto creation of 
manifest file based on the directory structure `actions//...` in 
interactive mode. After discussing with @mrutkows regarding deprecating 
interactive mode, `--use-defaults` can be deprecated as well.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rabbah opened a new pull request #3298: Attempt to resolve action name from conductor to a fully qualified name for added convenience.

2018-02-16 Thread GitBox
rabbah opened a new pull request #3298: Attempt to resolve action name from 
conductor to a fully qualified name for added convenience.
URL: https://github.com/apache/incubator-openwhisk/pull/3298
 
 
   I updated the document for conductor actions to specify that the action name 
for a continuation should be a fully qualified name. I however also added a 
conversion from string to a FQN with sensible defaults. This makes for slightly 
more convenient return results and avoids potentially confusing error messages 
when referencing a packages action but neglecting to specify the namespace. We 
have in the past resisted doing this and required the clients to resolve the 
names fully. 
   
   @tardieu can you review and comment?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] csantanapr closed pull request #49: Add code query parameter for action get

2018-02-16 Thread GitBox
csantanapr closed pull request #49: Add code query parameter for action get
URL: https://github.com/apache/incubator-openwhisk-client-go/pull/49
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/whisk/action.go b/whisk/action.go
index 1bdb879e..c1e06eaa 100644
--- a/whisk/action.go
+++ b/whisk/action.go
@@ -27,7 +27,7 @@ import (
 )
 
 type ActionService struct {
-   client *Client
+   client ClientInterface
 }
 
 type Action struct {
@@ -231,11 +231,11 @@ func (s *ActionService) Insert(action *Action, overwrite 
bool) (*Action, *http.R
return a, resp, nil
 }
 
-func (s *ActionService) Get(actionName string) (*Action, *http.Response, 
error) {
+func (s *ActionService) Get(actionName string, fetchCode bool) (*Action, 
*http.Response, error) {
// Encode resource name as a path (with no query params) before 
inserting it into the URI
// This way any '?' chars in the name won't be treated as the beginning 
of the query params
actionName = (&url.URL{Path: actionName}).String()
-   route := fmt.Sprintf("actions/%s", actionName)
+   route := fmt.Sprintf("actions/%s?code=%t", actionName, fetchCode)
 
req, err := s.client.NewRequest("GET", route, nil, 
IncludeNamespaceInUrl)
if err != nil {
diff --git a/whisk/action_test.go b/whisk/action_test.go
new file mode 100644
index ..57f7e664
--- /dev/null
+++ b/whisk/action_test.go
@@ -0,0 +1,151 @@
+ +build unit
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package whisk
+
+import (
+   "encoding/json"
+   "github.com/stretchr/testify/assert"
+   "io/ioutil"
+   "net/http"
+   "net/url"
+   "strings"
+   "testing"
+)
+
+const (
+   NODE_ACTION_NO_CODE = `{
+"name": "test",
+"publish": false,
+"annotations": [
+{
+"key": "exec",
+"value": "nodejs:6"
+}
+],
+"version": "0.0.1",
+"exec": {
+"kind": "nodejs:6",
+"binary": false
+},
+"parameters": [],
+"limits": {
+"timeout": 6,
+"memory": 256,
+"logs": 10
+},
+"namespace": "test@openwhisk"
+}`
+
+   NODE_ACTION = `{
+"name": "test",
+"publish": false,
+"annotations": [
+{
+"key": "exec",
+"value": "nodejs:6"
+}
+],
+"version": "0.0.1",
+"exec": {
+"kind": "nodejs:6",
+"code": "...",
+"binary": false
+},
+"parameters": [],
+"limits": {
+"timeout": 6,
+"memory": 256,
+"logs": 10
+},
+"namespace": "test@openwhisk"
+}`
+)
+
+type ActionResponse struct {
+   Body string
+}
+
+type ActionRequest struct {
+   Method string
+   URLstring
+}
+
+var actionResponse = &ActionResponse{}
+var actionRequest = &ActionRequest{}
+
+type MockClient struct{}
+
+func (c *MockClient) NewRequestUrl(method string, urlRelResource *url.URL, 
body interface{}, includeNamespaceInUrl bool, appendOpenWhiskPath bool, 
encodeBodyAs string, useAuthentication bool) (*http.Request, error) {
+   return &http.Request{}, nil
+}
+
+func (c *MockClient) NewRequest(method, urlStr string, body interface{}, 
includeNamespaceInUrl bool) (*http.Request, error) {
+   actionRequest.Method = method
+   actionRequest.URL = urlStr
+
+   request, err := http.NewRequest(method, urlStr, nil)
+   if err != nil {
+   return &http.Request{}, err
+   }
+
+   return request, nil
+}
+
+func (c *MockClient) Do(req *http.Request, v interface{}, 
ExitWithErrorOnTimeout bool, secretToObfuscate ...ObfuscateSet) 
(*http.Response, error) {
+   var reader = strings.NewReader(actionResponse.Body)
+
+   dc := json.NewDecoder(reader)
+   dc.UseNumber()
+   err := dc.Decode(v)
+
+   if 

[GitHub] pritidesai commented on issue #745: inline function does not work

2018-02-16 Thread GitBox
pritidesai commented on issue #745: inline function does not work
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/745#issuecomment-366381986
 
 
   Please address #622 while fixing this issue.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] pritidesai commented on issue #728: Export Manifest - get rid of empty structures from exported manifest

2018-02-16 Thread GitBox
pritidesai commented on issue #728: Export Manifest - get rid of empty 
structures from exported manifest
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/728#issuecomment-366381571
 
 
   Duplicate of #729 ...


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] pritidesai commented on issue #739: Missing NOTICE file

2018-02-16 Thread GitBox
pritidesai commented on issue #739: Missing NOTICE file
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/739#issuecomment-366381279
 
 
   Priority High


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] pritidesai commented on issue #740: Segfault when root package is not defined

2018-02-16 Thread GitBox
pritidesai commented on issue #740: Segfault when root package is not defined
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/740#issuecomment-366381157
 
 
   This is fixed with PR #744, please close it.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] pritidesai commented on issue #742: Add top level package definition and it ignores packages

2018-02-16 Thread GitBox
pritidesai commented on issue #742: Add top level package definition and it 
ignores packages
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/742#issuecomment-366380936
 
 
   This will be addressed with Matt's recent PR: 
https://github.com/apache/incubator-openwhisk-wskdeploy/pull/743
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] pritidesai commented on issue #745: inline function does not work

2018-02-16 Thread GitBox
pritidesai commented on issue #745: inline function does not work
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/745#issuecomment-366380401
 
 
   @lionelvillard @mrutkows I think we can overload the key `function` here, 
saying it can point to directory or an action file (as its supported today) or 
it can point to raw action source. `ComposeActions`can add a check if the 
supplied value is neither a file nor a directory, treat the value as an action 
source code. Anyways I believe this use case is more for testing functionality 
since its hardly possible to have a meaningfull action with just a couple of 
lines of code. We can bump the priority to high if we have an immediate need to 
support this feature.
   
   Enhancement with Priority: medium


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] pritidesai commented on issue #745: inline function does not work

2018-02-16 Thread GitBox
pritidesai commented on issue #745: inline function does not work
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/745#issuecomment-366380401
 
 
   @lionelvillard @mrutkows I think we can overload the key `function` here, 
saying it can point to directory or an action file (as its supported today) or 
it can point to raw action source. `ComposeActions`can add a check if the 
supplied value is neither a file nor a directory, treat the value as an action 
source code. Anyways I believe this use case is more for testing functionality 
since its hardly possible to have a meaning full action with just a couple of 
lines of code. We can bump the priority to high if we have an immediate need to 
support this feature.
   
   Enhancement with Priority: medium


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] bwmcadams commented on a change in pull request #3219: Kubernetes ContainerFactoryProvider implementation

2018-02-16 Thread GitBox
bwmcadams commented on a change in pull request #3219: Kubernetes 
ContainerFactoryProvider implementation
URL: 
https://github.com/apache/incubator-openwhisk/pull/3219#discussion_r168885749
 
 

 ##
 File path: 
core/invoker/src/main/scala/whisk/core/containerpool/kubernetes/KubernetesClient.scala
 ##
 @@ -0,0 +1,222 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package whisk.core.containerpool.kubernetes
+
+import java.io.FileNotFoundException
+import java.net.URL
+import java.nio.file.Files
+import java.nio.file.Paths
+
+import akka.actor.ActorSystem
+import akka.event.Logging.ErrorLevel
+import akka.stream.scaladsl.Source
+import akka.util.ByteString
+import pureconfig.loadConfigOrThrow
+import whisk.common.Logging
+import whisk.common.LoggingMarkers
+import whisk.common.TransactionId
+import whisk.core.containerpool.ContainerId
+import whisk.core.containerpool.ContainerAddress
+import whisk.core.containerpool.docker.ProcessRunner
+import scala.concurrent.duration.Duration
+import scala.concurrent.ExecutionContext
+import scala.concurrent.Future
+import scala.concurrent.blocking
+import scala.concurrent.duration._
+import scala.util.Failure
+import scala.util.Success
+import scala.util.Try
+
+import io.fabric8.kubernetes.client.ConfigBuilder
+import spray.json._
+import spray.json.DefaultJsonProtocol._
+import io.fabric8.kubernetes.client.DefaultKubernetesClient
+import io.fabric8.kubernetes.client.utils.URLUtils
+import okhttp3.Request
+
+/**
+ * Configuration for kubernetes client command timeouts.
+ */
+case class KubernetesClientTimeoutConfig(run: Duration, rm: Duration, inspect: 
Duration, logs: Duration)
+
+/**
+ * Serves as interface to the kubectl CLI tool.
+ *
+ * Be cautious with the ExecutionContext passed to this, as the
+ * calls to the CLI are blocking.
+ *
+ * You only need one instance (and you shouldn't get more).
+ */
+class KubernetesClient(
+  timeouts: KubernetesClientTimeoutConfig = 
loadConfigOrThrow[KubernetesClientTimeoutConfig](
+"whisk.kubernetes.timeouts"))(executionContext: ExecutionContext)(implicit 
log: Logging, as: ActorSystem)
+extends KubernetesApi
+with ProcessRunner {
+  implicit private val ec = executionContext
+  implicit private val kubeRestClient = new DefaultKubernetesClient(
+new ConfigBuilder()
+  .withConnectionTimeout(timeouts.logs.toMillis.toInt)
+  .withRequestTimeout(timeouts.logs.toMillis.toInt)
+  .build())
+
+  // Determines how to run kubectl. Failure to find a kubectl binary implies
+  // a failure to initialize this instance of KubernetesClient.
+  protected val kubectlCmd: Seq[String] = {
+val alternatives = List("/usr/bin/kubectl", "/usr/local/bin/kubectl")
+
+val kubectlBin = Try {
+  alternatives.find(a => Files.isExecutable(Paths.get(a))).get
+} getOrElse {
+  throw new FileNotFoundException(s"Couldn't locate kubectl binary (tried: 
${alternatives.mkString(", ")}).")
+}
+
+Seq(kubectlBin)
+  }
+
+  def run(image: String, name: String, environment: Map[String, String] = 
Map(), labels: Map[String, String] = Map())(
+implicit transid: TransactionId): Future[ContainerId] = {
+val environmentArgs = environment.flatMap {
+  case (key, value) => Seq("--env", s"$key=$value")
+}.toSeq
+
+val labelArgs = labels.map {
+  case (key, value) => s"$key=$value"
+} match {
+  case Seq() => Seq()
+  case pairs => Seq("-l") ++ pairs
+}
+
+val runArgs = Seq(
+  "run",
+  name,
+  "--image",
+  image,
+  "--generator",
+  "run-pod/v1",
+  "--restart",
+  "Always",
+  "--limits",
+  "memory=256Mi") ++ environmentArgs ++ labelArgs
+
+runCmd(runArgs, timeouts.run)
+  .map { _ =>
+name
+  }
+  .map(ContainerId.apply)
+  }
+
+  def inspectIPAddress(id: ContainerId)(implicit transid: TransactionId): 
Future[ContainerAddress] = {
+Future {
+  blocking {
 
 Review comment:
   After reviewing, with regards to this section of code, I can't see a way 
with the fabric8 java client to *not* block here. Even if you avoid the utility 
method for waiting that we use in this code, every layer all the way down the 
client blocks at 

[GitHub] mrutkows commented on issue #747: Add 0.9.2 version of spec. as PDF

2018-02-16 Thread GitBox
mrutkows commented on issue #747: Add 0.9.2 version of spec. as PDF
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/pull/747#issuecomment-366374978
 
 
   @houshengbo please merge at your earliest, thanks!


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] csantanapr closed pull request #15: Return activationID

2018-02-16 Thread GitBox
csantanapr closed pull request #15: Return activationID
URL: https://github.com/apache/incubator-openwhisk-package-deploy/pull/15
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/packages/actions/deployWeb.js b/packages/actions/deployWeb.js
index 2639496..4865549 100644
--- a/packages/actions/deployWeb.js
+++ b/packages/actions/deployWeb.js
@@ -15,6 +15,7 @@ let command = '';
  *  @return {object} Promise
  */
 function main(params) {
+  const activationId = process.env.__OW_ACTIVATION_ID;
   // Grab optional envData and manifestPath params for wskdeploy
   let {
 envData,
@@ -80,7 +81,7 @@ function main(params) {
 resolve({
   statusCode: 200,
   headers: {'Content-Type': 'application/json'},
-  body: new Buffer(JSON.stringify({'status': 
'success'})).toString('base64')
+  body: new Buffer(JSON.stringify({status: success, activationId: 
activationId })).toString('base64')
 });
   });
 })
@@ -118,14 +119,15 @@ function getWskApiAuth(params) {
 }
 
 function sendError(statusCode, error, message) {
-  var params = {error: error};
+  const activationId = process.env.__OW_ACTIVATION_ID;
+  const params = { error, activationId };
   if (message) {
-  params.message = message;
+params.message = message;
   }
   return {
-  statusCode: statusCode,
-  headers: { 'Content-Type': 'application/json' },
-  body: new Buffer(JSON.stringify(params)).toString('base64')
+statusCode: statusCode,
+headers: { 'Content-Type': 'application/json' },
+body: new Buffer(JSON.stringify(params)).toString('base64')
   };
 }
 
diff --git a/tests/src/test/scala/packages/deployWebTests.scala 
b/tests/src/test/scala/packages/deployWebTests.scala
index d917f65..054aa06 100644
--- a/tests/src/test/scala/packages/deployWebTests.scala
+++ b/tests/src/test/scala/packages/deployWebTests.scala
@@ -52,8 +52,9 @@ class DeployWebTests extends TestHelpers
 val helloWorldActionPackage = "myPackage/helloworld"
 
 // statuses from deployWeb
-val successStatus = """{"status":"success"}"""
-val githubNonExistentStatus = """{"error":"There was a problem cloning 
from github.  Does that github repo exist?  Does it begin with http?"}"""
+val successStatus = status":"success
+val activationId = activationId:
+val githubNonExistentStatus = error":"There was a problem cloning from 
github.  Does that github repo exist?  Does it begin with http?
 
 def makePostCallWithExpectedResult(params: JsObject, expectedResult: 
String, expectedCode: Int) = {
   val response = RestAssured.given()
@@ -62,7 +63,8 @@ class DeployWebTests extends TestHelpers
   .body(params.toString())
   .post(deployActionURL)
   assert(response.statusCode() == expectedCode)
-  response.body.asString shouldBe expectedResult
+  response.body.asString should include(expectedResult)
+  response.body.asString.parseJson.asJsObject.getFields("activationId") 
should have length 1
 }
 
 behavior of "deployWeb Package"
@@ -105,7 +107,7 @@ class DeployWebTests extends TestHelpers
 "manifestPath" -> JsString(helloWorldPath),
 "wskApiHost" -> JsString(wskprops.apihost),
 "wskAuth" -> JsString(wskprops.authKey)
-  ), """{"error":"Please enter the GitHub repo url in params"}""", 400)
+  ), error":"Please enter the GitHub repo url in params, 400)
 }
 
 // test to create a template with a nonexistant github repo provided
@@ -139,7 +141,7 @@ class DeployWebTests extends TestHelpers
 "manifestPath" -> JsString(incorrectManifestPath),
 "wskApiHost" -> JsString(wskprops.apihost),
 "wskAuth" -> JsString(wskprops.authKey)
-  ), """{"error":"Error loading manifest file. Does a manifest file 
exist?"}""", 400)
+  ), error":"Error loading manifest file. Does a manifest file 
exist?, 400)
 }
 
 // test to create a template with manifestPath provided, but no 
manifestFile existing
@@ -149,6 +151,6 @@ class DeployWebTests extends TestHelpers
 "manifestPath" -> JsString(helloWorldWithNoManifest),
 "wskApiHost" -> JsString(wskprops.apihost),
 "wskAuth" -> JsString(wskprops.authKey)
-  ), """{"error":"Error loading manifest file. Does a manifest file 
exist?"}""", 400)
+  ), error":"Error loading manifest file. Does a manifest file 
exist?, 400)
 }
 }


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache

[GitHub] beemarie commented on issue #15: Return activationID

2018-02-16 Thread GitBox
beemarie commented on issue #15: Return activationID
URL: 
https://github.com/apache/incubator-openwhisk-package-deploy/pull/15#issuecomment-366355714
 
 
   Hey @csantanapr can you please review this when you have a chance, and merge 
it if LGTY


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] beemarie opened a new pull request #16: WIP: Basic code cleanup

2018-02-16 Thread GitBox
beemarie opened a new pull request #16: WIP: Basic code cleanup
URL: https://github.com/apache/incubator-openwhisk-package-deploy/pull/16
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] beemarie opened a new pull request #15: return activationID

2018-02-16 Thread GitBox
beemarie opened a new pull request #15: return activationID
URL: https://github.com/apache/incubator-openwhisk-package-deploy/pull/15
 
 
   in case of errors, having the activation ID will aid in debugging.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ddragosd commented on issue #2799: ansible fix for #2788 for docker for mac

2018-02-16 Thread GitBox
ddragosd commented on issue #2799: ansible fix for #2788 for docker for mac 
URL: 
https://github.com/apache/incubator-openwhisk/pull/2799#issuecomment-366320396
 
 
   Referencing the other PR that might make this obsolete: 
https://github.com/apache/incubator-openwhisk/pull/2828


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mrutkows opened a new issue #748: ReadProjectDirectory() does not appear to work; uses default package

2018-02-16 Thread GitBox
mrutkows opened a new issue #748: ReadProjectDirectory() does not appear to 
work; uses default package
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/issues/748
 
 
   filesystemreader.go has the function ReadProjectDirectory() which has code 
that creates actions it finds under the "default" (or root package) which is 
not a concept we support.  We need to take a serious look at this code and the 
code that invokes it and make it work properly.
   
   ```
   ReadProjectDirectory
   
   ```


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] jcrossley3 commented on issue #3219: Kubernetes ContainerFactoryProvider implementation

2018-02-16 Thread GitBox
jcrossley3 commented on issue #3219: Kubernetes ContainerFactoryProvider 
implementation
URL: 
https://github.com/apache/incubator-openwhisk/pull/3219#issuecomment-366301995
 
 
   Ok, we've rebased and changed the logging stuff quite a bit, but I think we 
have good unit test coverage now, at least parity with our Docker counterparts. 
Once you guys approve, let me know how much you'd like to squash. I say 
probably at least back to 3ef07bf and maybe even farther.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mrutkows commented on issue #743: Remove top-level deprecated Package schema.

2018-02-16 Thread GitBox
mrutkows commented on issue #743: Remove top-level deprecated Package schema.
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/pull/743#issuecomment-366298008
 
 
   @pritidesai complete removal causes the entire manifest_parser_test.go and 
all .yaml files it uses to be invalidated causing a complete rewrite of all 
these unit tests.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rabbah commented on issue #2799: ansible fix for #2788 for docker for mac

2018-02-16 Thread GitBox
rabbah commented on issue #2799: ansible fix for #2788 for docker for mac 
URL: 
https://github.com/apache/incubator-openwhisk/pull/2799#issuecomment-366276409
 
 
   I rebased to HEAD to resolve conflicts.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mdeuser opened a new pull request #63: Parse new 'rules' field in 'trigger get' response

2018-02-16 Thread GitBox
mdeuser opened a new pull request #63: Parse new 'rules' field in 'trigger get' 
response
URL: https://github.com/apache/incubator-openwhisk-client-go/pull/63
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mrutkows commented on issue #743: Remove top-level deprecated Package schema.

2018-02-16 Thread GitBox
mrutkows commented on issue #743: Remove top-level deprecated Package schema.
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/pull/743#issuecomment-366275273
 
 
   @pritidesai I thought I had removed all references (in fact I had to since I 
did remove "Package" from yamlparser.go.  Maybe there was a time-lag between 
your review and my commits... ?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mrutkows commented on issue #743: Remove top-level deprecated Package schema.

2018-02-16 Thread GitBox
mrutkows commented on issue #743: Remove top-level deprecated Package schema.
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/pull/743#issuecomment-366275273
 
 
   @pritidesai I thought I had removed all references (in fact I had to since I 
did remove "Package" from yamlparser.go.  Maybe there was a time-lag between 
your review and my commits... ?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mrutkows commented on issue #743: Remove top-level deprecated Package schema.

2018-02-16 Thread GitBox
mrutkows commented on issue #743: Remove top-level deprecated Package schema.
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/pull/743#issuecomment-366275273
 
 
   @pritidesai I thought I had removed all references (in fact I had to since I 
did remove "Package" from yamlparser.go.  Maybe there was a time-lag between 
your review and my commits...


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mrutkows commented on issue #743: Remove top-level deprecated Package schema.

2018-02-16 Thread GitBox
mrutkows commented on issue #743: Remove top-level deprecated Package schema.
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/pull/743#issuecomment-366275273
 
 
   @pritidesai I thought I had removed all references (in fact I had to since I 
did remove "Package" from yamlparser.go.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mrutkows closed pull request #746: Adding support for env variables into github repo

2018-02-16 Thread GitBox
mrutkows closed pull request #746: Adding support for env variables into github 
repo
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/pull/746
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/deployers/deploymentreader.go b/deployers/deploymentreader.go
index 03c7abcb..9e60ff90 100644
--- a/deployers/deploymentreader.go
+++ b/deployers/deploymentreader.go
@@ -122,7 +122,7 @@ func (reader *DeploymentReader) 
bindPackageInputsAndAnnotations() error {
 
keyVal.Key = name
 
-   keyVal.Value = wskenv.GetEnvVar(input.Value)
+   keyVal.Value = 
wskenv.InterpolateStringWithEnvVar(input.Value)
 
keyValArr = append(keyValArr, keyVal)
}
@@ -215,7 +215,7 @@ func (reader *DeploymentReader) 
bindActionInputsAndAnnotations() error {
 
keyVal.Key = name
 
-   keyVal.Value = 
wskenv.GetEnvVar(input.Value)
+   keyVal.Value = 
wskenv.InterpolateStringWithEnvVar(input.Value)
 
keyValArr = append(keyValArr, keyVal)
}
@@ -303,7 +303,7 @@ func (reader *DeploymentReader) 
bindTriggerInputsAndAnnotations() error {
var keyVal whisk.KeyValue
 
keyVal.Key = name
-   keyVal.Value = 
wskenv.GetEnvVar(input.Value)
+   keyVal.Value = 
wskenv.InterpolateStringWithEnvVar(input.Value)
 
keyValArr = append(keyValArr, keyVal)
}
diff --git a/parsers/manifest_parser.go b/parsers/manifest_parser.go
index b18118e3..349891c9 100644
--- a/parsers/manifest_parser.go
+++ b/parsers/manifest_parser.go
@@ -162,6 +162,7 @@ func (dm *YAMLParser) ComposeDependencies(pkg Package, 
projectPath string, fileP
// TODO() define const for the protocol prefix, etc.
if !strings.HasPrefix(location, "https://";) && 
!strings.HasPrefix(location, "http://";) {
location = "https://"; + dependency.Location
+   location = 
wskenv.InterpolateStringWithEnvVar(location).(string)
}
 
isBinding = false
@@ -190,7 +191,7 @@ func (dm *YAMLParser) ComposeDependencies(pkg Package, 
projectPath string, fileP
for name, value := range dependency.Annotations {
var keyVal whisk.KeyValue
keyVal.Key = name
-   keyVal.Value = wskenv.GetEnvVar(value)
+   keyVal.Value = wskenv.InterpolateStringWithEnvVar(value)
 
keyValArrAnot = append(keyValArrAnot, keyVal)
}
@@ -315,7 +316,7 @@ func (dm *YAMLParser) ComposePackage(pkg Package, 
packageName string, filePath s
for name, value := range pkg.Annotations {
var keyVal whisk.KeyValue
keyVal.Key = name
-   keyVal.Value = wskenv.GetEnvVar(value)
+   keyVal.Value = wskenv.InterpolateStringWithEnvVar(value)
listOfAnnotations = append(listOfAnnotations, keyVal)
}
if len(listOfAnnotations) > 0 {
@@ -384,7 +385,7 @@ func (dm *YAMLParser) ComposeSequences(namespace string, 
sequences map[string]Se
for name, value := range sequence.Annotations {
var keyVal whisk.KeyValue
keyVal.Key = name
-   keyVal.Value = wskenv.GetEnvVar(value)
+   keyVal.Value = wskenv.InterpolateStringWithEnvVar(value)
 
keyValArr = append(keyValArr, keyVal)
}
@@ -647,7 +648,7 @@ func (dm *YAMLParser) ComposeActions(filePath string, 
actions map[string]Action,
for name, value := range action.Annotations {
var keyVal whisk.KeyValue
keyVal.Key = name
-   keyVal.Value = wskenv.GetEnvVar(value)
+   keyVal.Value = wskenv.InterpolateStringWithEnvVar(value)
listOfAnnotations = append(listOfAnnotations, keyVal)
}
if len(listOfAnnotations) > 0 {
@@ -776,7 +777,7 @@ func (dm *YAMLParser) ComposeTriggers(filePath string, pkg 
Package, ma whisk.Key
 
// replacing env. variables here in the trigger feed name
// to support trigger feed with $READ_FROM_ENV_TRIGGER_FEED
-   trigge

[GitHub] dubeejw commented on a change in pull request #223: Sync tests

2018-02-16 Thread GitBox
dubeejw commented on a change in pull request #223: Sync tests
URL: 
https://github.com/apache/incubator-openwhisk-cli/pull/223#discussion_r168794134
 
 

 ##
 File path: tests/src/test/scala/system/basic/WskBasicTests.scala
 ##
 @@ -464,34 +470,67 @@ class WskBasicTests extends TestHelpers with 
WskTestHelpers {
   behavior of "Wsk Trigger CLI"
 
   it should "create, update, get, fire and list trigger" in 
withAssetCleaner(wskprops) { (wp, assetHelper) =>
-val name = "listTriggers"
+val ruleName = withTimestamp("r1toa1")
+val triggerName = withTimestamp("t1tor1")
+val actionName = withTimestamp("a1")
 val params = Map("a" -> "A".toJson)
-assetHelper.withCleaner(wsk.trigger, name) { (trigger, _) =>
-  trigger.create(name, parameters = params)
-  trigger.create(name, update = true)
+val ns = wsk.namespace.whois()
+
+assetHelper.withCleaner(wsk.trigger, triggerName) { (trigger, _) =>
+  trigger.create(triggerName, parameters = params)
+  trigger.create(triggerName, update = true)
+}
+
+assetHelper.withCleaner(wsk.action, actionName) { (action, name) =>
+  action.create(name, defaultAction)
+}
+
+assetHelper.withCleaner(wsk.rule, ruleName) { (rule, name) =>
+  rule.create(name, trigger = triggerName, action = actionName)
 }
-val stdout = wsk.trigger.get(name).stdout
-stdout should include regex (key": "a)
-stdout should include regex (value": "A)
-stdout should include regex (publish": false""")
-stdout should include regex (version": "0.0.2)
+
+val trigger = wsk.trigger.get(triggerName)
+getJSONFromResponse(trigger.stdout, true).fields("parameters") shouldBe 
JsArray(JsObject("key" -> JsString("a"), "value" -> JsString("A")))
+getJSONFromResponse(trigger.stdout, true).fields("publish") shouldBe 
false.toJson
+getJSONFromResponse(trigger.stdout, true).fields("version") shouldBe 
"0.0.2".toJson
+
+val expectedRules = JsObject(
+  ns + "/" + ruleName -> JsObject(
+"action" -> JsObject("name" -> JsString(actionName), "path" -> 
JsString(ns)),
+"status" -> JsString("active")))
+
+// getJSONFromResponse(trigger.stdout, true).fields("rules") shouldBe 
expectedRules
 
 Review comment:
   @mdeuser, it can't be uncomment because the CLI does not output the rules 
property.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mrutkows closed issue #734: Enable query of dynamic runtimes from deployment host

2018-02-16 Thread GitBox
mrutkows closed issue #734: Enable query of dynamic runtimes from deployment 
host
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/issues/734
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mrutkows closed pull request #737: adding info message with openwhisk url for runtimes

2018-02-16 Thread GitBox
mrutkows closed pull request #737: adding info message with openwhisk url for 
runtimes
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/pull/737
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/utils/runtimes.go b/utils/runtimes.go
index cacf9804..48f6af65 100644
--- a/utils/runtimes.go
+++ b/utils/runtimes.go
@@ -22,19 +22,24 @@ import (
"encoding/json"
"github.com/apache/incubator-openwhisk-client-go/whisk"
"github.com/apache/incubator-openwhisk-wskdeploy/wski18n"
+   "github.com/apache/incubator-openwhisk-wskdeploy/wskprint"
"io/ioutil"
"net/http"
"strings"
"time"
 )
 
-const NODEJS_FILE_EXTENSION = "js"
-const SWIFT_FILE_EXTENSION = "swift"
-const PYTHON_FILE_EXTENSION = "py"
-const JAVA_FILE_EXTENSION = "java"
-const JAR_FILE_EXTENSION = "jar"
-const PHP_FILE_EXTENSION = "php"
-const ZIP_FILE_EXTENSION = "zip"
+const (
+   NODEJS_FILE_EXTENSION   = "js"
+   SWIFT_FILE_EXTENSION= "swift"
+   PYTHON_FILE_EXTENSION   = "py"
+   JAVA_FILE_EXTENSION = "java"
+   JAR_FILE_EXTENSION  = "jar"
+   PHP_FILE_EXTENSION  = "php"
+   ZIP_FILE_EXTENSION  = "zip"
+   HTTP_CONTENT_TYPE_KEY   = "Content-Type"
+   HTTP_CONTENT_TYPE_VALUE = "application/json; charset=UTF-8"
+)
 
 // Structs used to denote the OpenWhisk Runtime information
 type Limit struct {
@@ -74,10 +79,9 @@ var FileRuntimeExtensionsMap map[string]string
 // `curl -k https://openwhisk.ng.bluemix.net`
 // hard coding it here in case of network unavailable or failure.
 func ParseOpenWhisk(apiHost string) (op OpenWhiskInfo, err error) {
-   // TODO() create HTTP header constants and use them
-   ct := "application/json; charset=UTF-8"
-   req, _ := http.NewRequest("GET", "https://"+apiHost, nil)
-   req.Header.Set("Content-Type", ct)
+   url := "https://"; + apiHost
+   req, _ := http.NewRequest("GET", url, nil)
+   req.Header.Set(HTTP_CONTENT_TYPE_KEY, HTTP_CONTENT_TYPE_VALUE)
tlsConfig := &tls.Config{
InsecureSkipVerify: true,
}
@@ -104,16 +108,16 @@ func ParseOpenWhisk(apiHost string) (op OpenWhiskInfo, 
err error) {
}
 
// Local openwhisk deployment sometimes only returns "application/json" 
as the content type
-   // TODO() create HTTP header constants and use them
-   if err != nil || !strings.Contains(ct, res.Header.Get("Content-Type")) {
+   if err != nil || !strings.Contains(HTTP_CONTENT_TYPE_VALUE, 
res.Header.Get(HTTP_CONTENT_TYPE_KEY)) {
stdout := wski18n.T(wski18n.ID_MSG_UNMARSHAL_LOCAL)
-   whisk.Debug(whisk.DbgInfo, stdout)
+   wskprint.PrintOpenWhiskInfo(stdout)
err = json.Unmarshal(RUNTIME_DETAILS, &op)
} else {
b, _ := ioutil.ReadAll(res.Body)
if b != nil && len(b) > 0 {
-   stdout := wski18n.T(wski18n.ID_MSG_UNMARSHAL_NETWORK)
-   whisk.Debug(whisk.DbgInfo, stdout)
+   stdout := 
wski18n.T(wski18n.ID_MSG_UNMARSHAL_NETWORK_X_url_X,
+   map[string]interface{}{"url": url})
+   wskprint.PrintOpenWhiskInfo(stdout)
err = json.Unmarshal(b, &op)
}
}
diff --git a/wski18n/i18n_ids.go b/wski18n/i18n_ids.go
index 3ce8f210..f0a223e9 100644
--- a/wski18n/i18n_ids.go
+++ b/wski18n/i18n_ids.go
@@ -99,9 +99,9 @@ const (
ID_MSG_CONFIG_INFO_NAMESPACE_X_namespace_X_source_X = 
"msg_config_namespace_info"
ID_MSG_CONFIG_INFO_APIGE_ACCESS_TOKEN_X_source_X= 
"msg_config_apigw_access_token_info"
 
-   // YAML marshall / unmarshall
-   ID_MSG_UNMARSHAL_LOCAL   = "msg_unmarshall_local"
-   ID_MSG_UNMARSHAL_NETWORK = "msg_unmarshall_network"
+   // YAML marshal / unmarshal
+   ID_MSG_UNMARSHAL_LOCAL   = "msg_unmarshal_local"
+   ID_MSG_UNMARSHAL_NETWORK_X_url_X = "msg_unmarshal_network"
 
// Informational
ID_MSG_DEPLOYMENT_CANCELLED = "msg_deployment_cancelled"
@@ -297,7 +297,7 @@ var I18N_ID_SET = [](string){
ID_MSG_UNDEPLOYMENT_FAILED,
ID_MSG_UNDEPLOYMENT_SUCCEEDED,
ID_MSG_UNMARSHAL_LOCAL,
-   ID_MSG_UNMARSHAL_NETWORK,
+   ID_MSG_UNMARSHAL_NETWORK_X_url_X,
ID_WARN_COMMAND_RETRY,
ID_WARN_CONFIG_INVALID_X_path_X,
ID_WARN_ENTITY_NAME_EXISTS_X_key_X_name_X,
diff --git a/wski18n/i18n_resources.go b/wski18n/i18n_resources.go
index fd6099d3..303aff0b 100644
--- a/wski18n/i18n_resources.go
+++ b/wski18n/i18n_resources.go
@@ -109,12 +109,12 @@ func wski18nResourcesDe_deAllJson() (*asset, error) {
return nil, err
}
 
-   info

[GitHub] mrutkows closed pull request #744: fixing seg violation error

2018-02-16 Thread GitBox
mrutkows closed pull request #744: fixing seg violation error
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/pull/744
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/deployers/manifestreader.go b/deployers/manifestreader.go
index 6c433fb3..a7d1c69a 100644
--- a/deployers/manifestreader.go
+++ b/deployers/manifestreader.go
@@ -52,12 +52,12 @@ func (deployer *ManifestReader) ParseManifest() 
(*parsers.YAML, *parsers.YAMLPar
return manifest, manifestParser, nil
 }
 
-func (reader *ManifestReader) InitRootPackage(manifestParser 
*parsers.YAMLParser, manifest *parsers.YAML, ma whisk.KeyValue) error {
+func (reader *ManifestReader) InitPackages(manifestParser *parsers.YAMLParser, 
manifest *parsers.YAML, ma whisk.KeyValue) error {
packages, err := manifestParser.ComposeAllPackages(manifest, 
reader.serviceDeployer.ManifestPath, ma)
if err != nil {
return err
}
-   reader.SetPackage(packages)
+   reader.SetPackages(packages)
 
return nil
 }
@@ -161,7 +161,7 @@ func (reader *ManifestReader) SetDependencies(deps 
map[string]utils.DependencyRe
return nil
 }
 
-func (reader *ManifestReader) SetPackage(packages map[string]*whisk.Package) 
error {
+func (reader *ManifestReader) SetPackages(packages map[string]*whisk.Package) 
error {
 
dep := reader.serviceDeployer
 
diff --git a/deployers/manifestreader_test.go b/deployers/manifestreader_test.go
index b4cc6725..05d51ba9 100644
--- a/deployers/manifestreader_test.go
+++ b/deployers/manifestreader_test.go
@@ -46,15 +46,15 @@ func TestManifestReader_ParseManifest(t *testing.T) {
 }
 
 // Test could Init root package successfully.
-func TestManifestReader_InitRootPackage(t *testing.T) {
-   err := mr.InitRootPackage(ps, ms, whisk.KeyValue{})
+func TestManifestReader_InitPackages(t *testing.T) {
+   err := mr.InitPackages(ps, ms, whisk.KeyValue{})
assert.Equal(t, err, nil, "Init Root Package failed")
 }
 
 // Test Parameters
 func TestManifestReader_param(t *testing.T) {
ms, _ := ps.ParseManifest("../tests/dat/manifest6.yaml")
-   err := mr.InitRootPackage(ps, ms, whisk.KeyValue{})
+   err := mr.InitPackages(ps, ms, whisk.KeyValue{})
assert.Equal(t, err, nil, "Init Root Package failed")
 
// TODO(#695) Is there more to do here?  Original author left a TODO 
here in comments
diff --git a/deployers/servicedeployer.go b/deployers/servicedeployer.go
index 1bb2f5e4..69f0baed 100644
--- a/deployers/servicedeployer.go
+++ b/deployers/servicedeployer.go
@@ -81,16 +81,15 @@ func NewDeploymentPackage() *DeploymentPackage {
 //   3. Collect information about the source code files in the working 
directory
 //   4. Create a deployment plan to create OpenWhisk service
 type ServiceDeployer struct {
-   ProjectName string
-   Deployment  *DeploymentProject
-   Client  *whisk.Client
-   mt  sync.RWMutex
-   RootPackageName string
-   IsInteractive   bool
-   IsDefault   bool
-   ManifestPathstring
-   ProjectPath string
-   DeploymentPath  string
+   ProjectNamestring
+   Deployment *DeploymentProject
+   Client *whisk.Client
+   mt sync.RWMutex
+   IsInteractive  bool
+   IsDefault  bool
+   ManifestPath   string
+   ProjectPathstring
+   DeploymentPath string
// whether to deploy the action under the package
DeployActionInPackage bool
InteractiveChoice bool
@@ -132,7 +131,6 @@ func (deployer *ServiceDeployer) ConstructDeploymentPlan() 
error {
return err
}
 
-   deployer.RootPackageName = manifest.Package.Packagename
deployer.ProjectName = manifest.GetProject().Name
 
// Generate Managed Annotations if its marked as a Managed Deployment
@@ -155,7 +153,7 @@ func (deployer *ServiceDeployer) ConstructDeploymentPlan() 
error {
}
}
 
-   manifestReader.InitRootPackage(manifestParser, manifest, 
deployer.ManagedAnnotation)
+   manifestReader.InitPackages(manifestParser, manifest, 
deployer.ManagedAnnotation)
 
if deployer.IsDefault == true {
fileReader := NewFileSystemReader(deployer)
@@ -236,8 +234,7 @@ func (deployer *ServiceDeployer) 
ConstructUnDeploymentPlan() (*DeploymentProject
return deployer.Deployment, err
}
 
-   deployer.RootPackageName = manifest.Package.Packagename
-   manifestReader.InitRootPackage(manifestParser, manifest, 
whisk.KeyValue{})
+   manifestReader.InitPackages(manifestParser, manifest, whisk.KeyValue{})
 
// process file system
if deployer.IsDefault == true {
@

[GitHub] mrutkows opened a new pull request #747: Add 0.9.2 version of spec. as PDF

2018-02-16 Thread GitBox
mrutkows opened a new pull request #747: Add 0.9.2 version of spec. as PDF
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/pull/747
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mrutkows commented on issue #745: inline function does not work

2018-02-16 Thread GitBox
mrutkows commented on issue #745: inline function does not work
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/745#issuecomment-366269864
 
 
   @lionelvillard looking at the possible paths in the code (trial and error), 
perhaps we should designate a new key "code" (or something similar) on the 
function to clearly designate in-line code.  This would be the simplest 
approach and we would not need to document the try/retry path anywhere.   Also, 
it would be trivial to add this to schema...
   
   What do you think?
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mrutkows commented on issue #745: inline function does not work

2018-02-16 Thread GitBox
mrutkows commented on issue #745: inline function does not work
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/745#issuecomment-366269864
 
 
   @lionelvillard looking at the possible paths in the code (trial and error), 
perhaps we should designate a new key "code" (or something similar) on the 
function to clearly designate in-line code.  This would be the simplest 
approach and we would not need to document the try/retry path anywhere.  What 
do you think?
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mdeuser closed pull request #3019: WIP: Trigger activation reduction

2018-02-16 Thread GitBox
mdeuser closed pull request #3019: WIP: Trigger activation reduction
URL: https://github.com/apache/incubator-openwhisk/pull/3019
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/core/controller/src/main/scala/whisk/core/controller/Triggers.scala 
b/core/controller/src/main/scala/whisk/core/controller/Triggers.scala
index 93a7a51e80..1354c19de9 100644
--- a/core/controller/src/main/scala/whisk/core/controller/Triggers.scala
+++ b/core/controller/src/main/scala/whisk/core/controller/Triggers.scala
@@ -46,6 +46,7 @@ import spray.json.DefaultJsonProtocol.RootJsObjectFormat
 
 import whisk.common.TransactionId
 import whisk.core.database.CacheChangeNotification
+import whisk.core.database.NoDocumentException
 import whisk.core.entitlement.Collection
 import whisk.core.entity.ActivationResponse
 import whisk.core.entity.EntityPath
@@ -143,71 +144,81 @@ trait WhiskTriggersApi extends WhiskCollectionAPI {
 response = ActivationResponse.success(payload orElse 
Some(JsObject())),
 version = trigger.version,
 duration = None)
-  logging.info(this, s"[POST] trigger activated, writing activation 
record to datastore: $triggerActivationId")
-  val saveTriggerActivation = WhiskActivation.put(activationStore, 
triggerActivation) map { _ =>
-triggerActivationId
-  }
 
   val url = Uri(s"http://localhost:${whiskConfig.servicePort}";)
 
-  trigger.rules.map {
-_.filter {
-  case (ruleName, rule) => rule.status == Status.ACTIVE
-} foreach {
-  case (ruleName, rule) =>
-val ruleActivation = WhiskActivation(
-  namespace = user.namespace.toPath, // all activations should 
end up in the one space regardless trigger.namespace,
-  ruleName.name,
-  user.subject,
-  activationIdFactory.make(),
-  Instant.now(Clock.systemUTC()),
-  Instant.EPOCH,
-  cause = Some(triggerActivationId),
-  response = ActivationResponse.success(),
-  version = trigger.version,
-  duration = None)
-logging.info(this, s"[POST] rule ${ruleName} activated, 
writing activation record to datastore")
-WhiskActivation.put(activationStore, ruleActivation)
-
-val actionNamespace = rule.action.path.root.asString
-val actionPath = {
-  rule.action.path.relativePath.map { pkg =>
-(Path.SingleSlash + pkg.namespace) / 
rule.action.name.asString
-  } getOrElse {
-Path.SingleSlash + rule.action.name.asString
-  }
-}.toString
-
-val actionUrl = Path("/api/v1") / "namespaces" / 
actionNamespace / "actions"
-val request = HttpRequest(
-  method = POST,
-  uri = url.withPath(actionUrl + actionPath),
-  headers =
-
List(Authorization(BasicHttpCredentials(user.authkey.uuid.asString, 
user.authkey.key.asString))),
-  entity = HttpEntity(MediaTypes.`application/json`, 
args.getOrElse(JsObject()).compactPrint))
-
-Http().singleRequest(request).map {
-  response =>
-response.status match {
-  case OK | Accepted =>
-Unmarshal(response.entity).to[JsObject].map { a =>
-  logging.info(this, s"${rule.action} activated 
${a.fields("activationId")}")
-}
-  case NotFound =>
-response.discardEntityBytes()
-logging.info(this, s"${rule.action} failed, action not 
found")
-  case _ =>
-Unmarshal(response.entity).to[String].map { error =>
-  logging.warn(this, s"${rule.action} failed due to 
$error")
-}
-}
-}
+  val activeRules = trigger.rules map { _.filter((r) => r._2.status == 
Status.ACTIVE) } getOrElse Map[
+FullyQualifiedEntityName,
+whisk.core.entity.ReducedRule]()
+
+  val saveTriggerActivation = if (activeRules.size > 0) {
+logging.info(
+  this,
+  s"[POST] trigger activated against active rule(s), writing 
activation record to datastore: $triggerActivationId")
+WhiskActivation.put(activationStore, triggerActivation) map { _ =>
+  triggerActivationId
 }
+  } else {
+logging.info(this, s"[POST] tri

[GitHub] mdeuser commented on issue #3019: WIP: Trigger activation reduction

2018-02-16 Thread GitBox
mdeuser commented on issue #3019: WIP: Trigger activation reduction
URL: 
https://github.com/apache/incubator-openwhisk/pull/3019#issuecomment-366269093
 
 
   Closing due to having moved the implementation to several other PRs
   - #3031 / #3062 
   - #3187 
   - #3262 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rabbah commented on a change in pull request #3262: Handle trigger activations with inactive rules

2018-02-16 Thread GitBox
rabbah commented on a change in pull request #3262: Handle trigger activations 
with inactive rules
URL: 
https://github.com/apache/incubator-openwhisk/pull/3262#discussion_r168788124
 
 

 ##
 File path: core/controller/src/main/scala/whisk/core/controller/Triggers.scala
 ##
 @@ -146,9 +147,14 @@ trait WhiskTriggersApi extends WhiskCollectionAPI {
 case Failure(t) =>
   logging.error(this, s"[POST] storing trigger activation 
$triggerActivationId failed: ${t.getMessage}")
   }
+complete(Accepted, triggerActivationId.toJsObject)
+  } else {
+logging
+  .info(
 
 Review comment:
   set to debug level.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rabbah commented on a change in pull request #3262: Handle trigger activations with inactive rules

2018-02-16 Thread GitBox
rabbah commented on a change in pull request #3262: Handle trigger activations 
with inactive rules
URL: 
https://github.com/apache/incubator-openwhisk/pull/3262#discussion_r168788377
 
 

 ##
 File path: core/controller/src/main/scala/whisk/core/controller/Triggers.scala
 ##
 @@ -146,9 +147,14 @@ trait WhiskTriggersApi extends WhiskCollectionAPI {
 case Failure(t) =>
   logging.error(this, s"[POST] storing trigger activation 
$triggerActivationId failed: ${t.getMessage}")
   }
+complete(Accepted, triggerActivationId.toJsObject)
+  } else {
+logging
+  .info(
+this,
+s"[POST] trigger without an active rule was activated; no 
trigger activation record created for $triggerActivationId")
+complete(NoContent)
 
 Review comment:
   we could add a message here so that the HTTP resonse status code is 
NoContent and the message is informative: Trigger has no associated rules that 
are active.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rabbah commented on a change in pull request #3262: Handle trigger activations with inactive rules

2018-02-16 Thread GitBox
rabbah commented on a change in pull request #3262: Handle trigger activations 
with inactive rules
URL: 
https://github.com/apache/incubator-openwhisk/pull/3262#discussion_r168787949
 
 

 ##
 File path: common/scala/src/main/scala/whisk/http/ErrorResponse.scala
 ##
 @@ -111,6 +111,11 @@ object Messages {
   val notAllowedOnBinding = "Operation not permitted on package binding."
   def packageNameIsReserved(name: String) = s"Package name '$name' is 
reserved."
 
+  /** Error messages for triggers */
+  def triggerWithInactiveRule(rule: String, action: String) = {
+s"Rule ${rule} is inactive; action ${action} was not activated."
 
 Review comment:
   i suggest small change here:
   ```scala
+s"Rule '$rule' is inactive; action '$action' was not activated." 
   ```


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rabbah commented on issue #3297: Allow adding a feed on trigger update.

2018-02-16 Thread GitBox
rabbah commented on issue #3297: Allow adding a feed on trigger update.
URL: 
https://github.com/apache/incubator-openwhisk/issues/3297#issuecomment-366258647
 
 
   +1 allowing an update of a trigger with a feed if one is not attached makes 
sense. The current restriction was intended to prevent a trigger that is 
already attached to a feed to participate in another feed which replaces the 
first - and neglecting to disable the first feed. With a trigger that does not 
have an attached feed, there is no such concern.
   
   The `wsk` CLI does not offer `--feed` on `wsk trigger update` and will need 
to also be updated.
   
   Relevant lines: 
https://github.com/apache/incubator-openwhisk/blob/54527b5d76cbbc130a7ecb42132b5075ab60890e/core/controller/src/main/scala/whisk/core/controller/Triggers.scala#L244-L250


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rabbah commented on issue #3297: Allow adding a feed on trigger update.

2018-02-16 Thread GitBox
rabbah commented on issue #3297: Allow adding a feed on trigger update.
URL: 
https://github.com/apache/incubator-openwhisk/issues/3297#issuecomment-366258647
 
 
   +1 allowing an update of a trigger with a feed if one is not attached makes 
sense. The current restriction was intended to prevent a trigger that is 
already attached to a feed to participate in another feed which replaces the 
first - and neglecting to disable the first feed. With a trigger that does not 
have an attached feed, there is no such concern.
   
   The `wsk` CLI does not offer `--feed` on `wsk trigger update` and will need 
to also be updated.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] markusthoemmes opened a new issue #3297: Allow adding a feed on trigger update.

2018-02-16 Thread GitBox
markusthoemmes opened a new issue #3297: Allow adding a feed on trigger update.
URL: https://github.com/apache/incubator-openwhisk/issues/3297
 
 
   Today, updating a trigger (even if it has no feed attached) does not allow 
adding the feed post-creation.
   
   There are scenarios where that would be very helpful though, for instance: 
Testing!
   
   One can imagine a user creating Trigger -> Rule -> Action, then inserting a 
testpayload to the trigger to, well, test everything through. Once she's happy 
with the behaviour, attach the feed to the trigger via an update and ? .
   
   It sounds reasonable to limit this only for **adding** feeds first (for 
simplicity).


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] lionelvillard commented on issue #745: inline function does not work

2018-02-16 Thread GitBox
lionelvillard commented on issue #745: inline function does not work
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/745#issuecomment-366253479
 
 
   Is this still the plan to implement this feature by first attempting to read 
the code from a file (locally or remotely) and upon failure deploy it as just 
code?   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] cbickel closed pull request #3296: Bump swift test-timeout to 2 minutes.

2018-02-16 Thread GitBox
cbickel closed pull request #3296: Bump swift test-timeout to 2 minutes.
URL: https://github.com/apache/incubator-openwhisk/pull/3296
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/tests/src/test/scala/common/WskTestHelpers.scala 
b/tests/src/test/scala/common/WskTestHelpers.scala
index 5784824366..c9073f60a6 100644
--- a/tests/src/test/scala/common/WskTestHelpers.scala
+++ b/tests/src/test/scala/common/WskTestHelpers.scala
@@ -223,16 +223,14 @@ trait WskTestHelpers extends Matchers {
  totalWait: Duration)(check: ActivationResult => 
Unit)(implicit wskprops: WskProps): Unit = {
 val id = activationId
 val activation = wsk.waitForActivation(id, initialWait, pollPeriod, 
totalWait)
-if (activation.isLeft) {
-  assert(false, s"error waiting for activation $id: 
${activation.left.get}")
-} else
-  try {
-check(activation.right.get.convertTo[ActivationResult])
-  } catch {
-case error: Throwable =>
-  println(s"check failed for activation $id: ${activation.right.get}")
-  throw error
-  }
+
+activation match {
+  case Left(reason) => fail(s"error waiting for activation $id for 
$totalWait: $reason")
+  case Right(result) =>
+withRethrowingPrint(s"check failed for activation $id: $result") {
+  check(result.convertTo[ActivationResult])
+}
+}
   }
 
   /**
@@ -282,6 +280,22 @@ trait WskTestHelpers extends Matchers {
 }
   }
 
+  /**
+   * Prints the given information iff the inner test fails. Rethrows the tests 
exception to get a meaningful
+   * stacktrace.
+   *
+   * @param information additional information to print
+   * @param test test to run
+   */
+  def withRethrowingPrint(information: String)(test: => Unit): Unit = {
+try test
+catch {
+  case error: Throwable =>
+println(information)
+throw error
+}
+  }
+
   def removeCLIHeader(response: String): String = {
 if (response.contains("\n")) response.substring(response.indexOf("\n")) 
else response
   }
diff --git a/tests/src/test/scala/whisk/core/cli/test/Swift311Tests.scala 
b/tests/src/test/scala/whisk/core/cli/test/Swift311Tests.scala
index b0b1fee50e..f43778f5e7 100644
--- a/tests/src/test/scala/whisk/core/cli/test/Swift311Tests.scala
+++ b/tests/src/test/scala/whisk/core/cli/test/Swift311Tests.scala
@@ -35,7 +35,7 @@ class Swift311Tests extends TestHelpers with WskTestHelpers 
with Matchers {
 
   implicit val wskprops = WskProps()
   val wsk = new WskRest
-  val activationPollDuration = 60 seconds
+  val activationPollDuration = 2.minutes
   val defaultJsAction = Some(TestUtils.getTestActionFilename("hello.js"))
 
   lazy val runtimeContainer = "swift:3.1.1"


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mdeuser commented on a change in pull request #223: Sync tests

2018-02-16 Thread GitBox
mdeuser commented on a change in pull request #223: Sync tests
URL: 
https://github.com/apache/incubator-openwhisk-cli/pull/223#discussion_r168759622
 
 

 ##
 File path: tests/src/test/scala/system/basic/WskBasicTests.scala
 ##
 @@ -464,34 +470,67 @@ class WskBasicTests extends TestHelpers with 
WskTestHelpers {
   behavior of "Wsk Trigger CLI"
 
   it should "create, update, get, fire and list trigger" in 
withAssetCleaner(wskprops) { (wp, assetHelper) =>
-val name = "listTriggers"
+val ruleName = withTimestamp("r1toa1")
+val triggerName = withTimestamp("t1tor1")
+val actionName = withTimestamp("a1")
 val params = Map("a" -> "A".toJson)
-assetHelper.withCleaner(wsk.trigger, name) { (trigger, _) =>
-  trigger.create(name, parameters = params)
-  trigger.create(name, update = true)
+val ns = wsk.namespace.whois()
+
+assetHelper.withCleaner(wsk.trigger, triggerName) { (trigger, _) =>
+  trigger.create(triggerName, parameters = params)
+  trigger.create(triggerName, update = true)
+}
+
+assetHelper.withCleaner(wsk.action, actionName) { (action, name) =>
+  action.create(name, defaultAction)
+}
+
+assetHelper.withCleaner(wsk.rule, ruleName) { (rule, name) =>
+  rule.create(name, trigger = triggerName, action = actionName)
 }
-val stdout = wsk.trigger.get(name).stdout
-stdout should include regex (key": "a)
-stdout should include regex (value": "A)
-stdout should include regex (publish": false""")
-stdout should include regex (version": "0.0.2)
+
+val trigger = wsk.trigger.get(triggerName)
+getJSONFromResponse(trigger.stdout, true).fields("parameters") shouldBe 
JsArray(JsObject("key" -> JsString("a"), "value" -> JsString("A")))
+getJSONFromResponse(trigger.stdout, true).fields("publish") shouldBe 
false.toJson
+getJSONFromResponse(trigger.stdout, true).fields("version") shouldBe 
"0.0.2".toJson
+
+val expectedRules = JsObject(
+  ns + "/" + ruleName -> JsObject(
+"action" -> JsObject("name" -> JsString(actionName), "path" -> 
JsString(ns)),
+"status" -> JsString("active")))
+
+// getJSONFromResponse(trigger.stdout, true).fields("rules") shouldBe 
expectedRules
 
 Review comment:
   @dubeejw - line 502 can be un-commented; the required backend change has 
been merged into the openwhisk repo.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] markusthoemmes commented on issue #3296: Bump swift test-timeout to 2 minutes.

2018-02-16 Thread GitBox
markusthoemmes commented on issue #3296: Bump swift test-timeout to 2 minutes.
URL: 
https://github.com/apache/incubator-openwhisk/pull/3296#issuecomment-366239076
 
 
   We definitly should, yes. @rabbah 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rabbah commented on issue #3293: Script to extract view functions as js files

2018-02-16 Thread GitBox
rabbah commented on issue #3293: Script to extract view functions as js files
URL: 
https://github.com/apache/incubator-openwhisk/pull/3293#issuecomment-366221798
 
 
   ?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rabbah commented on issue #3283: Add implicit ClassTag for entity type

2018-02-16 Thread GitBox
rabbah commented on issue #3283: Add implicit ClassTag for entity type
URL: 
https://github.com/apache/incubator-openwhisk/pull/3283#issuecomment-366221260
 
 
   LGTM. I think we?ll need to rethink the artifact store as we?ve made several 
singnifcant changes since initial conception and can simplify some of the 
generic typing which gets in the way; this led to a whole of code duplication 
in WhiskActionMetadata for example.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] csantanapr commented on issue #3290: Check all testfiles to actually contain the `RunWith` annotation.

2018-02-16 Thread GitBox
csantanapr commented on issue #3290: Check all testfiles to actually contain 
the `RunWith` annotation.
URL: 
https://github.com/apache/incubator-openwhisk/pull/3290#issuecomment-366216455
 
 
   Oh my ?  Good find @markusthoemmes @cbickel  ? 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] chetanmeh commented on issue #3283: Add implicit ClassTag for entity type

2018-02-16 Thread GitBox
chetanmeh commented on issue #3283: Add implicit ClassTag for entity type
URL: 
https://github.com/apache/incubator-openwhisk/pull/3283#issuecomment-366206638
 
 
   @markusthoemmes  @rabbah Does the approach looks fine here or some aspect 
needs to be improved?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] markusthoemmes opened a new pull request #3296: Bump swift test-timeout to 120 seconds.

2018-02-16 Thread GitBox
markusthoemmes opened a new pull request #3296: Bump swift test-timeout to 120 
seconds.
URL: https://github.com/apache/incubator-openwhisk/pull/3296
 
 
   - This test is prone to errors because compiling swift apparently is subject 
to a lot variance (seen up to 1 minute).
   - Refactor of some test helpers.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] markusthoemmes closed pull request #3266: Use always all available controllers.

2018-02-16 Thread GitBox
markusthoemmes closed pull request #3266: Use always all available controllers.
URL: https://github.com/apache/incubator-openwhisk/pull/3266
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ansible/group_vars/all b/ansible/group_vars/all
index 8f14ea60d3..23eeeac2c6 100644
--- a/ansible/group_vars/all
+++ b/ansible/group_vars/all
@@ -18,7 +18,7 @@ exclude_logs_from: []
 #   whisk_api_localhost_name_default (last)
 whisk_api_localhost_name_default: "localhost"
 
-hosts_dir: "{{ inventory_dir|?default(env_hosts_dir) }}" 
+hosts_dir: "{{ inventory_dir|?default(env_hosts_dir) }}"
 
 whisk:
   version:
@@ -54,8 +54,6 @@ controller:
   bindPort: 2551
   # at this moment all controllers are seed nodes
   seedNodes: "{{ groups['controllers'] | map('extract', hostvars, 
'ansible_host') | list }}"
-  # We recommend to enable HA for the controllers only, if bookkeeping data 
are shared too. (localBookkeeping: false)
-  ha: "{{ controller_enable_ha | default(True) and groups['controllers'] | 
length > 1 }}"
   loadbalancer:
 spi: "{{ controller_loadbalancer_spi | default('') }}"
   loglevel: "{{ controller_loglevel | default(whisk_loglevel) | 
default('INFO') }}"
diff --git a/ansible/roles/controller/tasks/deploy.yml 
b/ansible/roles/controller/tasks/deploy.yml
index 3fa07b5802..f07566400e 100644
--- a/ansible/roles/controller/tasks/deploy.yml
+++ b/ansible/roles/controller/tasks/deploy.yml
@@ -140,7 +140,6 @@
 
   "CONTROLLER_LOCALBOOKKEEPING": "{{ controller.localBookkeeping }}"
   "AKKA_CLUSTER_SEED_NODES": "{{seed_nodes_list | join(' ') }}"
-  "CONTROLLER_HA": "{{ controller.ha }}"
 
   "METRICS_KAMON": "{{ metrics.kamon.enabled }}"
   "METRICS_LOG": "{{ metrics.log.enabled }}"
diff --git a/ansible/roles/nginx/templates/nginx.conf.j2 
b/ansible/roles/nginx/templates/nginx.conf.j2
index e8e447bfe3..c31026cc66 100644
--- a/ansible/roles/nginx/templates/nginx.conf.j2
+++ b/ansible/roles/nginx/templates/nginx.conf.j2
@@ -29,11 +29,8 @@ http {
 # Otherwise, nginx would dispatch requests when the container is up, 
but the backend in the container not.
 # From the docs:
 # "normally, requests with a non-idempotent method (POST, LOCK, PATCH) 
are not passed to the next server if a request has been sent to an upstream 
server"
-server {{ hostvars[groups['controllers'] | first].ansible_host }}:{{ 
controller.basePort }} fail_timeout=60s;
-{% for ip in groups['controllers'] %}
-{% if groups['controllers'].index(ip) > 0 %}
-server {{ hostvars[ip].ansible_host }}:{{ controller.basePort + 
groups['controllers'].index(ip) }} {% if controller.ha %}fail_timeout=60s{% 
else %}backup{% endif %};
-{% endif %}
+{% for c in groups['controllers'] %}
+server {{ hostvars[c].ansible_host }}:{{ controller.basePort + 
groups['controllers'].index(c) }} fail_timeout=60s;
 {% endfor %}
 keepalive 512;
 }
diff --git a/ansible/templates/whisk.properties.j2 
b/ansible/templates/whisk.properties.j2
index 9096b9eaa5..f8d6a1bdde 100644
--- a/ansible/templates/whisk.properties.j2
+++ b/ansible/templates/whisk.properties.j2
@@ -56,7 +56,6 @@ invoker.hosts.basePort={{ invoker.port }}
 controller.hosts={{ groups["controllers"] | map('extract', hostvars, 
'ansible_host') | list | join(",") }}
 controller.host.basePort={{ controller.basePort }}
 controller.instances={{ controller.instances }}
-controller.ha={{ controller.ha }}
 
 invoker.container.network=bridge
 invoker.container.policy={{ invoker_container_policy_name | default()}}
diff --git a/common/scala/src/main/scala/whisk/core/WhiskConfig.scala 
b/common/scala/src/main/scala/whisk/core/WhiskConfig.scala
index c538d6ec56..cf66627ed0 100644
--- a/common/scala/src/main/scala/whisk/core/WhiskConfig.scala
+++ b/common/scala/src/main/scala/whisk/core/WhiskConfig.scala
@@ -97,7 +97,6 @@ class WhiskConfig(requiredProperties: Map[String, String],
   val actionSequenceLimit = this(WhiskConfig.actionSequenceMaxLimit)
   val controllerSeedNodes = this(WhiskConfig.controllerSeedNodes)
   val controllerLocalBookkeeping = 
getAsBoolean(WhiskConfig.controllerLocalBookkeeping, false)
-  val controllerHighAvailability = 
getAsBoolean(WhiskConfig.controllerHighAvailability, false)
 }
 
 object WhiskConfig {
@@ -231,7 +230,6 @@ object WhiskConfig {
   val triggerFirePerMinuteLimit = "limits.triggers.fires.perMinute"
   val controllerSeedNodes = "akka.cluster.seed.nodes"
   val controllerLocalBookkeeping = "controller.localBookkeeping"
-  val controllerHighAvailability = "controller.ha"
 }
 
 object ConfigKeys {
diff --git 
a/core/controller/src/main/scala/whisk/core/entitlement/Entitlement.scala 
b/core/controller/src/main/scala/whisk/core/entitlement/Entitlement.scala
index d148eb78fd..

[GitHub] cbickel closed pull request #3290: Check all testfiles to actually contain the `RunWith` annotation.

2018-02-16 Thread GitBox
cbickel closed pull request #3290: Check all testfiles to actually contain the 
`RunWith` annotation.
URL: https://github.com/apache/incubator-openwhisk/pull/3290
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/tests/src/test/scala/whisk/core/cli/test/JsonArgsForTests.scala 
b/tests/src/test/scala/whisk/core/cli/test/TestJsonArgs.scala
similarity index 99%
rename from tests/src/test/scala/whisk/core/cli/test/JsonArgsForTests.scala
rename to tests/src/test/scala/whisk/core/cli/test/TestJsonArgs.scala
index 9d8910ef7d..474e8209c1 100644
--- a/tests/src/test/scala/whisk/core/cli/test/JsonArgsForTests.scala
+++ b/tests/src/test/scala/whisk/core/cli/test/TestJsonArgs.scala
@@ -23,7 +23,7 @@ import spray.json.JsString
 import spray.json.JsNumber
 import spray.json.JsBoolean
 
-object JsonArgsForTests {
+object TestJsonArgs {
 
   def getInvalidJSONInput =
 Seq(
diff --git a/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala 
b/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
index 970d569ab1..925c098bcb 100644
--- a/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
+++ b/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
@@ -45,7 +45,7 @@ import whisk.core.entity.LogLimit._
 import whisk.core.entity.MemoryLimit._
 import whisk.core.entity.TimeLimit._
 import whisk.core.entity.size.SizeInt
-import JsonArgsForTests._
+import TestJsonArgs._
 import whisk.http.Messages
 
 /**
diff --git 
a/tests/src/test/scala/whisk/core/loadBalancer/test/LoadBalancerDataTests.scala 
b/tests/src/test/scala/whisk/core/loadBalancer/test/LoadBalancerDataTests.scala
index 9afa67f575..b60989aa0a 100644
--- 
a/tests/src/test/scala/whisk/core/loadBalancer/test/LoadBalancerDataTests.scala
+++ 
b/tests/src/test/scala/whisk/core/loadBalancer/test/LoadBalancerDataTests.scala
@@ -21,6 +21,8 @@ import akka.actor.ActorSystem
 import akka.actor.Cancellable
 import com.typesafe.config.{ConfigFactory, ConfigValueFactory}
 import common.StreamLogging
+import org.junit.runner.RunWith
+import org.scalatest.junit.JUnitRunner
 import org.scalatest.{FlatSpec, Matchers}
 import whisk.core.entity.{ActivationId, UUID, WhiskActivation}
 import whisk.core.loadBalancer.{ActivationEntry, DistributedLoadBalancerData, 
LocalLoadBalancerData}
@@ -30,6 +32,7 @@ import whisk.core.entity.InstanceId
 
 import scala.concurrent.duration._
 
+@RunWith(classOf[JUnitRunner])
 class LoadBalancerDataTests extends FlatSpec with Matchers with StreamLogging {
   final val emptyCancellable: Cancellable = new Cancellable {
 def isCancelled = false
diff --git 
a/tests/src/test/scala/whisk/core/loadBalancer/test/SeedNodesProviderTest.scala 
b/tests/src/test/scala/whisk/core/loadBalancer/test/SeedNodesProviderTests.scala
similarity index 91%
rename from 
tests/src/test/scala/whisk/core/loadBalancer/test/SeedNodesProviderTest.scala
rename to 
tests/src/test/scala/whisk/core/loadBalancer/test/SeedNodesProviderTests.scala
index 345c885a43..ef4ae850c0 100644
--- 
a/tests/src/test/scala/whisk/core/loadBalancer/test/SeedNodesProviderTest.scala
+++ 
b/tests/src/test/scala/whisk/core/loadBalancer/test/SeedNodesProviderTests.scala
@@ -18,10 +18,13 @@
 package whisk.core.loadBalancer.test
 
 import akka.actor.Address
+import org.junit.runner.RunWith
+import org.scalatest.junit.JUnitRunner
 import org.scalatest.{FlatSpec, Matchers}
-import whisk.core.loadBalancer.{StaticSeedNodesProvider}
+import whisk.core.loadBalancer.StaticSeedNodesProvider
 
-class SeedNodesProviderTest extends FlatSpec with Matchers {
+@RunWith(classOf[JUnitRunner])
+class SeedNodesProviderTests extends FlatSpec with Matchers {
 
   val actorSystemName = "controller-actor-system"
   val host = "192.168.99.100"
diff --git 
a/tests/src/test/scala/whisk/core/loadBalancer/test/SharedDataServiceTests.scala
 
b/tests/src/test/scala/whisk/core/loadBalancer/test/SharedDataServiceTests.scala
index 3961e539ca..b3b37a716c 100644
--- 
a/tests/src/test/scala/whisk/core/loadBalancer/test/SharedDataServiceTests.scala
+++ 
b/tests/src/test/scala/whisk/core/loadBalancer/test/SharedDataServiceTests.scala
@@ -20,27 +20,26 @@ package whisk.core.loadBalancer.test
 import akka.actor.ActorSystem
 import akka.testkit.{ImplicitSender, TestKit}
 import akka.util.Timeout
-import com.typesafe.config.ConfigValueFactory
-import com.typesafe.config.ConfigFactory
-import org.scalatest._
+import com.typesafe.config.{ConfigFactory, ConfigValueFactory}
+import org.junit.runner.RunWith
+import org.scalatest.{FlatSpecLike, _}
+import org.scalatest.junit.JUnitRunner
 import whisk.core.loadBalancer._
-import org.scalatest.FlatSpecLike
 
 import scala.concurrent.duration._
 
 // Define your test specific configuration here
 
 object TestKitConfig {
-  val

[GitHub] markusthoemmes commented on issue #3290: Check all testfiles to actually contain the `RunWith` annotation.

2018-02-16 Thread GitBox
markusthoemmes commented on issue #3290: Check all testfiles to actually 
contain the `RunWith` annotation.
URL: 
https://github.com/apache/incubator-openwhisk/pull/3290#issuecomment-366181205
 
 
   PG2 2823 ? 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services