[incubator-openwhisk-wskdeploy] branch mrutkows-patch-2 deleted (was 1eb1a7f)

2017-08-30 Thread mrutkowski
This is an automated email from the ASF dual-hosted git repository.

mrutkowski pushed a change to branch mrutkows-patch-2
in repository 
https://gitbox.apache.org/repos/asf/incubator-openwhisk-wskdeploy.git.


 was 1eb1a7f  Add files via upload

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" '].


[incubator-openwhisk] branch master updated: Pretty print webaction JSON response. (#2643)

2017-08-30 Thread csantanapr
This is an automated email from the ASF dual-hosted git repository.

csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
 new cfd34c0  Pretty print webaction JSON response. (#2643)
cfd34c0 is described below

commit cfd34c084bcd995876a3672ee715b7c814459cd4
Author: rodric rabbah 
AuthorDate: Wed Aug 30 23:16:52 2017 -0400

Pretty print webaction JSON response. (#2643)

* Pretty print webaction JSON response.

Add pretty/compact printers in singleton common to controller, and use it 
for error responses, API response and webactions.

* Tidy up a match.

* Remove extra space.
---
 .../main/scala/whisk/core/entity/WhiskAction.scala |  7 +++---
 .../src/main/scala/whisk/http/ErrorResponse.scala  |  6 +++--
 .../main/scala/whisk/core/controller/Actions.scala |  4 
 .../scala/whisk/core/controller/Activations.scala  |  3 +++
 .../scala/whisk/core/controller/ApiUtils.scala |  6 +
 .../controller/AuthorizedRouteDispatcher.scala |  4 
 .../scala/whisk/core/controller/Entities.scala | 19 +++
 .../scala/whisk/core/controller/Namespaces.scala   |  3 +++
 .../scala/whisk/core/controller/Packages.scala |  3 +++
 .../scala/whisk/core/controller/RestAPIs.scala | 11 +++--
 .../main/scala/whisk/core/controller/Rules.scala   |  3 +++
 .../scala/whisk/core/controller/Triggers.scala |  3 +++
 .../scala/whisk/core/controller/WebActions.scala   | 17 +++---
 .../scala/whisk/core/invoker/InvokerReactive.scala |  2 +-
 .../core/controller/test/WebActionsApiTests.scala  | 27 --
 15 files changed, 74 insertions(+), 44 deletions(-)

diff --git a/common/scala/src/main/scala/whisk/core/entity/WhiskAction.scala 
b/common/scala/src/main/scala/whisk/core/entity/WhiskAction.scala
index 0e01369..c4e90f4 100644
--- a/common/scala/src/main/scala/whisk/core/entity/WhiskAction.scala
+++ b/common/scala/src/main/scala/whisk/core/entity/WhiskAction.scala
@@ -256,16 +256,15 @@ object WhiskAction
 
 implicit val ec = db.executionContext
 
-val fa = super.get(db, doc, rev, fromCache = fromCache)
+val fa = super.get(db, doc, rev, fromCache)
 
 fa.flatMap { action =>
 action.exec match {
-case exec @ CodeExecAsAttachment(_, Attached(_, _), _) =>
+case exec @ CodeExecAsAttachment(_, Attached(attachmentName, 
_), _) =>
 val boas = new ByteArrayOutputStream()
 val b64s = Base64.getEncoder().wrap(boas)
-val manifest = exec.manifest.attached.get
 
-getAttachment[A](db, action.docinfo, 
manifest.attachmentName, b64s).map { _ =>
+getAttachment[A](db, action.docinfo, attachmentName, 
b64s).map { _ =>
 b64s.close()
 val newAction = action.copy(exec = 
exec.inline(boas.toByteArray))
 newAction.revision(action.rev)
diff --git a/common/scala/src/main/scala/whisk/http/ErrorResponse.scala 
b/common/scala/src/main/scala/whisk/http/ErrorResponse.scala
index 1687630..85f39b6 100644
--- a/common/scala/src/main/scala/whisk/http/ErrorResponse.scala
+++ b/common/scala/src/main/scala/whisk/http/ErrorResponse.scala
@@ -169,13 +169,15 @@ case class ErrorResponse(error: String, code: 
TransactionId)
 
 object ErrorResponse extends Directives with DefaultJsonProtocol {
 
-def terminate(status: StatusCode, error: String)(implicit transid: 
TransactionId): StandardRoute = {
+def terminate(status: StatusCode, error: String)(
+implicit transid: TransactionId, jsonPrinter: JsonPrinter): 
StandardRoute = {
 terminate(status, Option(error) filter { _.trim.nonEmpty } map {
 e => Some(ErrorResponse(e.trim, transid))
 } getOrElse None)
 }
 
-def terminate(status: StatusCode, error: Option[ErrorResponse] = None, 
asJson: Boolean = true)(implicit transid: TransactionId): StandardRoute = {
+def terminate(status: StatusCode, error: Option[ErrorResponse] = None, 
asJson: Boolean = true)(
+implicit transid: TransactionId, jsonPrinter: JsonPrinter): 
StandardRoute = {
 val errorResponse = error getOrElse response(status)
 if (asJson) {
 complete(status, errorResponse)
diff --git a/core/controller/src/main/scala/whisk/core/controller/Actions.scala 
b/core/controller/src/main/scala/whisk/core/controller/Actions.scala
index fc042a7..ba74de8 100644
--- a/core/controller/src/main/scala/whisk/core/controller/Actions.scala
+++ b/core/controller/src/main/scala/whisk/core/controller/Actions.scala
@@ -87,8 +87,12 @@ trait WhiskActionsApi
 /** Database service to get activations. */
 protected val activationStore: ActivationStore
 
+/** Entity normalizer to JSON object. */
 import RestApiCommons.emptyEnti

[incubator-openwhisk-wskdeploy] branch master updated: Adding deprecation warning for using package in deployment file (#418)

2017-08-30 Thread lz1982
This is an automated email from the ASF dual-hosted git repository.

lz1982 pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-openwhisk-wskdeploy.git


The following commit(s) were added to refs/heads/master by this push:
 new b429552  Adding deprecation warning for using package in deployment 
file (#418)
b429552 is described below

commit b42955299142fb89e2dfef7fbed989954430575b
Author: Priti Desai 
AuthorDate: Wed Aug 30 18:34:26 2017 -0700

Adding deprecation warning for using package in deployment file (#418)

* Adding deprecation warning for using package in deployment file

* Converting array of packages to map

* updating integration tests deployment files

* binding input values instead of param struct

* Adding integration tests

* git is forcing to rename integration tests as previous commit created some
discrepancy
---
 deployers/deploymentreader.go  | 59 ++
 deployers/deploymentreader_test.go |  2 +-
 parsers/yamlparser.go  |  2 +-
 tests/dat/deployment.yaml  |  2 +-
 tests/src/integration/flagstests/deployment.yml|  6 +--
 tests/src/integration/flagstests/manifest.yml  |  2 +-
 tests/src/integration/triggerrule/deployment.yml   |  6 +--
 .../actions/helloworld.js  | 11 
 .../validatePackageInDeployment/deployment.yaml|  9 
 .../validatePackageInDeployment/manifest.yaml  | 12 +
 .../validatePackageInDeployment_test.go| 42 +++
 .../actions/helloworld.js  | 11 
 .../validatePackagesInDeployment/deployment.yaml   |  9 
 .../validatePackagesInDeployment/manifest.yaml | 12 +
 .../validatePackagesInDeployment_test.go   | 42 +++
 tests/src/integration/zipaction/deployment.yml |  4 +-
 tests/usecases/alarmtrigger/deployment.yaml|  4 +-
 tests/usecases/badyaml/deployment.yaml |  6 +--
 tests/usecases/data-processing-app/deployment.yaml |  2 +-
 .../usecases/defaulttest-bindings/deployment.yaml  |  2 +-
 tests/usecases/openstack/deployment.yaml   |  4 +-
 tests/usecases/triggerrule/deployment.yml  |  2 +-
 tests/usecases/whiskbot/deployment.yaml|  2 +-
 23 files changed, 207 insertions(+), 46 deletions(-)

diff --git a/deployers/deploymentreader.go b/deployers/deploymentreader.go
index 967916a..42db43d 100644
--- a/deployers/deploymentreader.go
+++ b/deployers/deploymentreader.go
@@ -23,6 +23,7 @@ import (
"github.com/apache/incubator-openwhisk-client-go/whisk"
"github.com/apache/incubator-openwhisk-wskdeploy/parsers"
"github.com/apache/incubator-openwhisk-wskdeploy/utils"
+   "log"
 )
 
 type DeploymentReader struct {
@@ -63,18 +64,27 @@ func (reader *DeploymentReader) BindAssets() error {
 
 func (reader *DeploymentReader) bindPackageInputsAndAnnotations() {
 
-   packArray := make([]parsers.Package, 0)
+   packMap := make(map[string]parsers.Package)
 
if reader.DeploymentDescriptor.Application.Packages == nil {
-   packArray = append(packArray, 
reader.DeploymentDescriptor.Application.Package)
+   // a single package is specified in deployment YAML file with 
"package" key
+   
packMap[reader.DeploymentDescriptor.Application.Package.Packagename] = 
reader.DeploymentDescriptor.Application.Package
+   log.Println("WARNING: The package YAML key in deployment file 
will soon be deprecated. Please use packages instead as described in 
specifications.")
} else {
-   for _, depPacks := range 
reader.DeploymentDescriptor.Application.Packages {
-   packArray = append(packArray, depPacks)
+   for packName, depPacks := range 
reader.DeploymentDescriptor.Application.Packages {
+   depPacks.Packagename = packName
+   packMap[packName] = depPacks
}
}
 
-   for _, pack := range packArray {
-   serviceDeployPack := 
reader.serviceDeployer.Deployment.Packages[pack.Packagename]
+   for packName, pack := range packMap {
+
+   serviceDeployPack := 
reader.serviceDeployer.Deployment.Packages[packName]
+
+   if serviceDeployPack == nil {
+   log.Println("WARNING: Package name in deployment file " 
+ packName + " does not match with manifest file.")
+   break
+   }
 
keyValArr := make(whisk.KeyValueArr, 0)
 
@@ -84,7 +94,7 @@ func (reader *DeploymentReader) 
bindPackageInputsAndAnnotations() {
 
keyVal.Key = name
 
-   keyVal.Value = utils.GetEnvVar(input)
+   keyVal.Value = utils.GetEnvVar(input.Value)
 
 

[incubator-openwhisk] branch master updated: remove experimental web actions support

2017-08-30 Thread rabbah
This is an automated email from the ASF dual-hosted git repository.

rabbah pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
 new 5891f21  remove experimental web actions support
5891f21 is described below

commit 5891f21435e8868a00806d4ecaeb01810545de74
Author: David Cariello 
AuthorDate: Wed Aug 30 19:17:11 2017 -0500

remove experimental web actions support
---
 .../scala/whisk/core/controller/RestAPIs.scala |   8 +-
 .../scala/whisk/core/controller/WebActions.scala   |  20 +--
 tests/src/test/scala/common/Wsk.scala  |  93 
 .../whisk/core/cli/test/WskWebActionsTests.scala   | 163 +
 .../core/controller/test/WebActionsApiTests.scala  |  25 +---
 5 files changed, 80 insertions(+), 229 deletions(-)

diff --git 
a/core/controller/src/main/scala/whisk/core/controller/RestAPIs.scala 
b/core/controller/src/main/scala/whisk/core/controller/RestAPIs.scala
index 5d4fc74..57b03ea 100644
--- a/core/controller/src/main/scala/whisk/core/controller/RestAPIs.scala
+++ b/core/controller/src/main/scala/whisk/core/controller/RestAPIs.scala
@@ -178,9 +178,9 @@ class RestAPIVersion(config: WhiskConfig, apiPath: String, 
apiVersion: String)(
 // web actions are distinct to separate the cors header
 // and allow the actions themselves to respond to options
 basicAuth(validateCredentials) { user =>
-web.routes(user) ~ webexp.routes(user)
+web.routes(user)
 } ~ {
-web.routes() ~ webexp.routes()
+web.routes()
 } ~ options {
 sendCorsHeaders {
 complete(OK)
@@ -197,8 +197,8 @@ class RestAPIVersion(config: WhiskConfig, apiPath: String, 
apiVersion: String)(
 private val triggers = new TriggersApi(apiPath, apiVersion)
 private val activations = new ActivationsApi(apiPath, apiVersion)
 private val rules = new RulesApi(apiPath, apiVersion)
-private val webexp = new WebActionsApi(Seq("experimental", "web"), 
WebApiDirectives.exp)
-private val web = new WebActionsApi(Seq("web"), WebApiDirectives.web)
+private val WebApiDirectives = new WebApiDirectives()
+private val web = new WebActionsApi(Seq("web"), this.WebApiDirectives)
 
 class NamespacesApi(
val apiPath: String,
diff --git 
a/core/controller/src/main/scala/whisk/core/controller/WebActions.scala 
b/core/controller/src/main/scala/whisk/core/controller/WebActions.scala
index c963863..e527e8b 100644
--- a/core/controller/src/main/scala/whisk/core/controller/WebActions.scala
+++ b/core/controller/src/main/scala/whisk/core/controller/WebActions.scala
@@ -59,7 +59,7 @@ import whisk.http.ErrorResponse.terminate
 import whisk.http.Messages
 import whisk.utils.JsHelpers._
 
-protected[controller] sealed class WebApiDirectives private (prefix: String) {
+protected[controller] sealed class WebApiDirectives (prefix: String = "__ow_") 
{
 // enforce the presence of an extension (e.g., .http) in the URI path
 val enforceExtension = false
 
@@ -78,20 +78,6 @@ protected[controller] sealed class WebApiDirectives private 
(prefix: String) {
 protected final def fields(f: String) = s"$prefix$f"
 }
 
-// field names for /web with raw-http action
-protected[controller] object WebApiDirectives {
-// field names for /web
-val web = new WebApiDirectives("__ow_")
-
-// field names used for /experimental/web
-val exp = new WebApiDirectives("__ow_meta_") {
-override val enforceExtension = true
-override val method = fields("verb")
-override val namespace = fields("namespace")
-override val statusCode = "code"
-}
-}
-
 private case class Context(
 propertyMap: WebApiDirectives,
 method: HttpMethod,
@@ -372,7 +358,7 @@ trait WhiskWebActionsApi
 /**
  * Adds route to web based activations. Actions invoked this way are 
anonymous in that the
  * caller is not authenticated. The intended action must be named in the 
path as a fully qualified
- * name as in /experimental/web/some-namespace/some-package/some-action. 
The package is optional
+ * name as in /web/some-namespace/some-package/some-action. The package is 
optional
  * in that the action may be in the default package, in which case, the 
string "default" must be used.
  * If the action doesn't exist (or the namespace is not valid) NotFound is 
generated. Following the
  * action name, an "extension" is required to specify the desired content 
type for the response. This
@@ -380,7 +366,7 @@ trait WhiskWebActionsApi
  * an text/html response.
  *
  * Optionally, the result form the action may be projected based on a 
named property. As in
- * 
/experimental/web/some-namespace/some-package/some-action/some-property.

[incubator-openwhisk-wskdeploy] branch master updated: Add files via upload

2017-08-30 Thread houshengbo
This is an automated email from the ASF dual-hosted git repository.

houshengbo pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-openwhisk-wskdeploy.git


The following commit(s) were added to refs/heads/master by this push:
 new 47889c8  Add files via upload
47889c8 is described below

commit 47889c8497cd7e0ba39ae0664b939acc2175a890
Author: Matt Rutkowski 
AuthorDate: Wed Aug 30 14:48:17 2017 -0500

Add files via upload
---
 specification/openwhisk_v0.8.8.pdf | Bin 0 -> 1450606 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/specification/openwhisk_v0.8.8.pdf 
b/specification/openwhisk_v0.8.8.pdf
new file mode 100644
index 000..1914b5f
Binary files /dev/null and b/specification/openwhisk_v0.8.8.pdf differ

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" '].


[incubator-openwhisk-wskdeploy] branch mrutkows-patch-2 created (now 6953714)

2017-08-30 Thread mrutkowski
This is an automated email from the ASF dual-hosted git repository.

mrutkowski pushed a change to branch mrutkows-patch-2
in repository 
https://gitbox.apache.org/repos/asf/incubator-openwhisk-wskdeploy.git.


  at 6953714  deploy sequences separately other than combining with actions 
(#396)

No new revisions were added by this update.

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" '].


[incubator-openwhisk-wskdeploy] branch mrutkows-patch-2 updated: Add files via upload

2017-08-30 Thread mrutkowski
This is an automated email from the ASF dual-hosted git repository.

mrutkowski pushed a commit to branch mrutkows-patch-2
in repository 
https://gitbox.apache.org/repos/asf/incubator-openwhisk-wskdeploy.git


The following commit(s) were added to refs/heads/mrutkows-patch-2 by this push:
 new 1eb1a7f  Add files via upload
1eb1a7f is described below

commit 1eb1a7f682abe91c66ea169486cf961d365af3a2
Author: Matt Rutkowski 
AuthorDate: Wed Aug 30 14:48:17 2017 -0500

Add files via upload
---
 specification/openwhisk_v0.8.8.pdf | Bin 0 -> 1450606 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/specification/openwhisk_v0.8.8.pdf 
b/specification/openwhisk_v0.8.8.pdf
new file mode 100644
index 000..1914b5f
Binary files /dev/null and b/specification/openwhisk_v0.8.8.pdf differ

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" '].