You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by mr...@apache.org on 2020/04/30 14:03:15 UTC
[openwhisk-wskdeploy] branch master updated: Remove misleading
web-export key (#1092)
This is an automated email from the ASF dual-hosted git repository.
mrutkowski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk-wskdeploy.git
The following commit(s) were added to refs/heads/master by this push:
new 5073943 Remove misleading web-export key (#1092)
5073943 is described below
commit 507394340d77f8bbdefcbab16aa3c1da77809f71
Author: Dominic Kim <st...@gmail.com>
AuthorDate: Thu Apr 30 23:03:04 2020 +0900
Remove misleading web-export key (#1092)
* Remove misleading web-export key
* Support the top-level web-export field.
* Revert changes on test data to keep the sanity check for the top-level web-export field.
---
docs/examples/manifest_hello_world_apigateway.yaml | 3 +-
.../manifest_hello_world_apigateway_http.yaml | 6 +-
...ifest_hello_world_apigateway_open_api_spec.yaml | 1 +
docs/export.md | 4 +-
docs/wskdeploy_apigateway_helloworld.md | 5 +-
docs/wskdeploy_apigateway_open_api_spec.md | 1 +
parsers/yamlparser.go | 2 +-
specification/html/spec_actions.md | 4 +-
specification/html/spec_apis.md | 3 +-
...ifest_data_compose_actions_for_invalid_web.yaml | 3 +-
.../dat/manifest_data_compose_actions_for_web.yaml | 1 +
...ata_compose_actions_for_web_and_web_export.yaml | 12 ++--
tests/dat/manifest_data_compose_api_records.yaml | 3 +-
tests/src/integration/apigateway/manifest.yml | 3 +-
.../defaultpackage/manifest-with-project.yaml | 6 +-
tests/src/integration/defaultpackage/manifest.yaml | 6 +-
tests/src/integration/export/manifest_apiexp.yaml | 3 +-
tests/src/integration/flagstests/manifest.yaml | 3 +-
tests/src/integration/flagstests/manifest.yml | 3 +-
tests/src/integration/runtimetests/manifest.yaml | 78 ++++++++++++++--------
tests/src/integration/webaction/manifest.yml | 15 +++--
21 files changed, 109 insertions(+), 56 deletions(-)
diff --git a/docs/examples/manifest_hello_world_apigateway.yaml b/docs/examples/manifest_hello_world_apigateway.yaml
index 44e49ca..1861a78 100644
--- a/docs/examples/manifest_hello_world_apigateway.yaml
+++ b/docs/examples/manifest_hello_world_apigateway.yaml
@@ -23,7 +23,8 @@ packages:
actions:
hello_world:
function: src/hello.js
- web-export: true
+ annotations:
+ web-export: true
apis:
hello-world:
hello:
diff --git a/docs/examples/manifest_hello_world_apigateway_http.yaml b/docs/examples/manifest_hello_world_apigateway_http.yaml
index afe96a4..c690021 100644
--- a/docs/examples/manifest_hello_world_apigateway_http.yaml
+++ b/docs/examples/manifest_hello_world_apigateway_http.yaml
@@ -23,10 +23,12 @@ packages:
actions:
hello_world:
function: src/hello_http.js
- web-export: true
+ annotations:
+ web-export: true
hello_world_promise:
function: src/hello_http_promise.js
- web-export: true
+ annotations:
+ web-export: true
apis:
hello-world:
hello:
diff --git a/docs/examples/manifest_hello_world_apigateway_open_api_spec.yaml b/docs/examples/manifest_hello_world_apigateway_open_api_spec.yaml
index 26826e9..31a0171 100644
--- a/docs/examples/manifest_hello_world_apigateway_open_api_spec.yaml
+++ b/docs/examples/manifest_hello_world_apigateway_open_api_spec.yaml
@@ -25,4 +25,5 @@ project:
actions:
hello_world:
function: src/hello.js
+ annotations:
web-export: true
diff --git a/docs/export.md b/docs/export.md
index 296ae7d..a06c252 100644
--- a/docs/export.md
+++ b/docs/export.md
@@ -191,13 +191,13 @@ packages:
namespace: your_namespace/lib1_package
credential: ""
exposedUrl: ""
- web-export: ""
main: ""
limits: null
inputs: {}
outputs: {}
annotations:
exec: nodejs:default
+ web-export: ""
lib1_greeting2:
name: lib1_greeting2
location: ""
@@ -208,13 +208,13 @@ packages:
namespace: your_namespace/lib1_package
credential: ""
exposedUrl: ""
- web-export: ""
main: ""
limits: null
inputs: {}
outputs: {}
annotations:
exec: nodejs:default
+ web-export: ""
lib1_greeting3:
name: lib1_greeting3
location: ""
diff --git a/docs/wskdeploy_apigateway_helloworld.md b/docs/wskdeploy_apigateway_helloworld.md
index 4bcefe9..19ceaa7 100644
--- a/docs/wskdeploy_apigateway_helloworld.md
+++ b/docs/wskdeploy_apigateway_helloworld.md
@@ -37,7 +37,8 @@ packages:
actions:
hello_world:
function: src/hello.js
- web-export: true
+ annotations:
+ web-export: true
apis:
hello-world:
hello:
@@ -47,7 +48,7 @@ packages:
```
There are two key changes to this file:
-- the `hello_world` action now has the `web-export` flag set to `true`.
+- the `hello_world` action now has the `web-export` annotation set to `true`.
- a new `apis` block has been created.
The `apis` block contains a number of groups of API endpoint. Each endpoint is then defined by the hierarchy. In this case, we are creating the `hello/world` endpoint. The leaf in the structure specifies the action to trigger when the given HTTP verb is sent to that endpoint, in this case, when the HTTP verb `GET` is used on the `hello/world` endpoint, trigger the `hello_world` action.
diff --git a/docs/wskdeploy_apigateway_open_api_spec.md b/docs/wskdeploy_apigateway_open_api_spec.md
index 4942ed2..b7f8341 100644
--- a/docs/wskdeploy_apigateway_open_api_spec.md
+++ b/docs/wskdeploy_apigateway_open_api_spec.md
@@ -39,6 +39,7 @@ project:
actions:
hello_world:
function: src/hello.js
+ annotations:
web-export: true
```
### Open API Specification
diff --git a/parsers/yamlparser.go b/parsers/yamlparser.go
index 7b29ab9..770bac6 100644
--- a/parsers/yamlparser.go
+++ b/parsers/yamlparser.go
@@ -109,7 +109,7 @@ type Action struct {
Main string `yaml:"main"`
Docker string `yaml:"docker,omitempty"`
Native bool `yaml:"native,omitempty"`
- Conductor bool `yaml:"conductor,omitempty"`
+ Conductor bool `yaml:"conductor,omitempty"`
Limits *Limits `yaml:"limits"`
Inputs map[string]Parameter `yaml:"inputs"`
Outputs map[string]Parameter `yaml:"outputs"`
diff --git a/specification/html/spec_actions.md b/specification/html/spec_actions.md
index 66502aa..56920c6 100644
--- a/specification/html/spec_actions.md
+++ b/specification/html/spec_actions.md
@@ -42,7 +42,7 @@ The Action entity schema contains the necessary information to deploy an OpenWhi
| outputs | no | list of [parameter](spec_parameters.md) | N/A | The optional outputs from the Action. |
| limits | no | map of [limit keys and values](#valid-limit-keys) | N/A | Optional map of limit keys and their values.</br>See section "[Valid limit keys](#valid-limit-keys)" (below) for a listing of recognized keys and values. |
| feed | no | boolean | false | Optional indicator that the Action supports the required parameters (and operations) to be run as a Feed Action. |
-| web | web-export | no | string | true | false | yes | no | raw | The optional flag that makes the action accessible to REST calls without authentication.<p>For details on all types of Web Actions, see: [Web Actions](https://github.com/apache/openwhisk/blob/master/docs/webactions.md).</p>|
+| web | no | string | true | false | yes | no | raw | The optional flag that makes the action accessible to REST calls without authentication.<p>For details on all types of Web Actions, see: [Web Actions](https://github.com/apache/openwhisk/blob/master/docs/webactions.md).</p>|
| raw-http | no | boolean | false | The optional flag (annotation) to indicate if a Web Action is able to consume the raw contents within the body of an HTTP request.<p><b>Note</b>: this option is ONLY valid if <em>"web"</em> or <em>"web-export"</em> is set to <em>‘true’</em>.<p> |
| docker | no | string | N/A | The optional key that references a Docker image (e.g., openwhisk/skeleton). |
| native | no | boolean | false | The optional key (flag) that indicates the Action is should use the Docker skeleton image for OpenWhisk (i.e., short-form for docker: openwhisk/skeleton). |
@@ -78,7 +78,7 @@ The following annotations have special meanings for Actions:
- When the `code` key-value is specified, the `runtime` **SHALL** be a required field.
#### Annotation requirements
-- The annotation `require-whisk-auth` **SHALL** only be valid for web actions (i.e., if the `web` or `web-export` key (or `web-export` annotation) is set to `true`).
+- The annotation `require-whisk-auth` **SHALL** only be valid for web actions (i.e., if the `web` key or `web-export` annotation is set to `true`).
- If the value of the `require-whisk-auth` annotation is an `integer` its value **MUST** be a positive integer less than or equal to the `MAX_INT` value of `9007199254740991`.
- When the `web` or `web-export` key is present and set to `true` the web action's **MUST** also be marked `final`. This happens automatically when the `web` or `web-export` keys are present and set to `true`.
diff --git a/specification/html/spec_apis.md b/specification/html/spec_apis.md
index 2873d56..b26d02c 100644
--- a/specification/html/spec_apis.md
+++ b/specification/html/spec_apis.md
@@ -79,7 +79,8 @@ packages:
actions:
hello_world:
function: src/hello.js
- web-export: true
+ annotations:
+ web-export: true
apis:
hello-world:
hello:
diff --git a/tests/dat/manifest_data_compose_actions_for_invalid_web.yaml b/tests/dat/manifest_data_compose_actions_for_invalid_web.yaml
index 368731a..4c0b4e9 100644
--- a/tests/dat/manifest_data_compose_actions_for_invalid_web.yaml
+++ b/tests/dat/manifest_data_compose_actions_for_invalid_web.yaml
@@ -20,4 +20,5 @@ packages:
actions:
hello:
function: ../tests/src/integration/helloworld/actions/hello.js
- web-export: raw123
+ annotations:
+ web-export: raw123
diff --git a/tests/dat/manifest_data_compose_actions_for_web.yaml b/tests/dat/manifest_data_compose_actions_for_web.yaml
index 94607a8..9ecb95b 100644
--- a/tests/dat/manifest_data_compose_actions_for_web.yaml
+++ b/tests/dat/manifest_data_compose_actions_for_web.yaml
@@ -33,3 +33,4 @@ packages:
hello5:
function: ../src/integration/helloworld/actions/hello.js
web-export: no
+
diff --git a/tests/dat/manifest_data_compose_actions_for_web_and_web_export.yaml b/tests/dat/manifest_data_compose_actions_for_web_and_web_export.yaml
index 2145eb9..7adbcda 100644
--- a/tests/dat/manifest_data_compose_actions_for_web_and_web_export.yaml
+++ b/tests/dat/manifest_data_compose_actions_for_web_and_web_export.yaml
@@ -22,19 +22,23 @@ packages:
function: ../src/integration/helloworld/actions/hello.js
runtime: nodejs
web: true
- web-export: true
+ annotations:
+ web-export: true
hello2:
function: ../src/integration/helloworld/actions/hello.js
runtime: nodejs
web: true
- web-export: false
+ annotations:
+ web-export: false
hello3:
function: ../src/integration/helloworld/actions/hello.js
runtime: nodejs
web: false
- web-export: true
+ annotations:
+ web-export: true
hello4:
function: ../src/integration/helloworld/actions/hello.js
runtime: nodejs
web: raw
- web-export: true
+ annotations:
+ web-export: true
diff --git a/tests/dat/manifest_data_compose_api_records.yaml b/tests/dat/manifest_data_compose_api_records.yaml
index 14f95de..e75d3c7 100644
--- a/tests/dat/manifest_data_compose_api_records.yaml
+++ b/tests/dat/manifest_data_compose_api_records.yaml
@@ -20,7 +20,8 @@ packages:
actions:
putBooks:
function: ../tests/src/integration/helloworld/actions/hello.js
- web-export: true
+ annotations:
+ web-export: true
deleteBooks:
function: ../tests/src/integration/helloworld/actions/hello.js
listMembers:
diff --git a/tests/src/integration/apigateway/manifest.yml b/tests/src/integration/apigateway/manifest.yml
index dba6e31..5026504 100644
--- a/tests/src/integration/apigateway/manifest.yml
+++ b/tests/src/integration/apigateway/manifest.yml
@@ -21,7 +21,8 @@ packages:
license: Apache-2.0
actions:
greeting:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/greeting.js
runtime: nodejs:default
diff --git a/tests/src/integration/defaultpackage/manifest-with-project.yaml b/tests/src/integration/defaultpackage/manifest-with-project.yaml
index b420979..40fe2b1 100644
--- a/tests/src/integration/defaultpackage/manifest-with-project.yaml
+++ b/tests/src/integration/defaultpackage/manifest-with-project.yaml
@@ -23,7 +23,8 @@ project:
helloInDefaultPackage:
function: actions/hello.js
runtime: nodejs:default
- web-export: true
+ annotations:
+ web-export: true
inputs:
name:
type: string
@@ -82,7 +83,8 @@ project:
greetingInsidePackage:
function: actions/hello.js
runtime: nodejs:default
- web-export: true
+ annotations:
+ web-export: true
inputs:
name:
type: string
diff --git a/tests/src/integration/defaultpackage/manifest.yaml b/tests/src/integration/defaultpackage/manifest.yaml
index d0c2429..2831233 100644
--- a/tests/src/integration/defaultpackage/manifest.yaml
+++ b/tests/src/integration/defaultpackage/manifest.yaml
@@ -21,7 +21,8 @@ packages:
helloInDefaultPackage:
function: actions/hello.js
runtime: nodejs:default
- web-export: true
+ annotations:
+ web-export: true
inputs:
name:
type: string
@@ -80,7 +81,8 @@ packages:
greetingInsidePackage:
function: actions/hello.js
runtime: nodejs:default
- web-export: true
+ annotations:
+ web-export: true
inputs:
name:
type: string
diff --git a/tests/src/integration/export/manifest_apiexp.yaml b/tests/src/integration/export/manifest_apiexp.yaml
index b377b9a..53b0441 100644
--- a/tests/src/integration/export/manifest_apiexp.yaml
+++ b/tests/src/integration/export/manifest_apiexp.yaml
@@ -21,7 +21,8 @@ packages:
license: Apache-2.0
actions:
greeting:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/greeting.js
runtime: nodejs:default
diff --git a/tests/src/integration/flagstests/manifest.yaml b/tests/src/integration/flagstests/manifest.yaml
index caabdc5..eff2125 100644
--- a/tests/src/integration/flagstests/manifest.yaml
+++ b/tests/src/integration/flagstests/manifest.yaml
@@ -21,7 +21,8 @@ packages:
license: Apache-2.0
actions:
greeting:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/greeting.js
runtime: nodejs:default
diff --git a/tests/src/integration/flagstests/manifest.yml b/tests/src/integration/flagstests/manifest.yml
index 25b7c17..b14a79f 100644
--- a/tests/src/integration/flagstests/manifest.yml
+++ b/tests/src/integration/flagstests/manifest.yml
@@ -21,7 +21,8 @@ packages:
license: Apache-2.0
actions:
greeting:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/greeting.js
runtime: nodejs:default
diff --git a/tests/src/integration/runtimetests/manifest.yaml b/tests/src/integration/runtimetests/manifest.yaml
index 8c65d48..7cbf189 100644
--- a/tests/src/integration/runtimetests/manifest.yaml
+++ b/tests/src/integration/runtimetests/manifest.yaml
@@ -21,7 +21,8 @@ packages:
license: Apache-1.0
actions:
greetingnodejs6-with-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/greeting.js
runtime: nodejs:default
@@ -31,7 +32,8 @@ packages:
outputs:
payload: string
greetingnodejs8-with-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/greeting.js
runtime: nodejs:8
@@ -41,7 +43,8 @@ packages:
outputs:
payload: string
greetingnodejs10-with-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/greeting.js
runtime: nodejs:10
@@ -51,7 +54,8 @@ packages:
outputs:
payload: string
greetingphp71-with-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.php
runtime: php:7.1
@@ -61,7 +65,8 @@ packages:
outputs:
payload: string
greetingphp72-with-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.php
runtime: php:7.2
@@ -71,7 +76,8 @@ packages:
outputs:
payload: string
greetingphp73-with-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.php
runtime: php:7.3
@@ -81,7 +87,8 @@ packages:
outputs:
payload: string
greetingpython-with-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.py
runtime: python
@@ -91,7 +98,8 @@ packages:
outputs:
payload: string
greetingpython2-with-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.py
runtime: python:2
@@ -101,7 +109,8 @@ packages:
outputs:
payload: string
greetingpython3-with-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.py
runtime: python:3
@@ -111,7 +120,8 @@ packages:
outputs:
payload: string
greetingruby25-with-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.rb
runtime: ruby:2.5
@@ -121,7 +131,8 @@ packages:
outputs:
payload: string
greetingswift42-with-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.swift
runtime: swift:4.2
@@ -149,7 +160,8 @@ packages:
TestImplicitRuntimes:
actions:
greetingnodejs-without-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/greeting.js
inputs:
@@ -158,7 +170,8 @@ packages:
outputs:
payload: string
greetingphp-without-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.php
inputs:
@@ -167,7 +180,8 @@ packages:
outputs:
payload: string
greetingpython-without-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.py
inputs:
@@ -176,7 +190,8 @@ packages:
outputs:
payload: string
greetingruby-without-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.rb
inputs:
@@ -185,7 +200,8 @@ packages:
outputs:
payload: string
greetingswift-without-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.swift
inputs:
@@ -199,7 +215,8 @@ packages:
TestInvalidExplicitRuntimes:
actions:
greetingnodejs-with-java-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/greeting.js
runtime: java
@@ -209,7 +226,8 @@ packages:
outputs:
payload: string
greetingnodejs-with-random-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/greeting.js
runtime: random
@@ -219,7 +237,8 @@ packages:
outputs:
payload: string
greetingphp-with-nodejs-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.php
runtime: nodejs:default
@@ -229,7 +248,8 @@ packages:
outputs:
payload: string
greetingphp-with-random-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.php
runtime: random
@@ -239,7 +259,8 @@ packages:
outputs:
payload: string
greetingpython-with-php-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.py
runtime: php
@@ -249,7 +270,8 @@ packages:
outputs:
payload: string
greetingpython-with-random-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.py
runtime: random
@@ -259,7 +281,8 @@ packages:
outputs:
payload: string
greetingruby-with-php-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.rb
runtime: php
@@ -269,7 +292,8 @@ packages:
outputs:
payload: string
greetingruby-with-random-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.rb
runtime: random
@@ -279,7 +303,8 @@ packages:
outputs:
payload: string
greetingswift-with-nodejs-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.swift
runtime: nodejs:default
@@ -289,7 +314,8 @@ packages:
outputs:
payload: string
greetingswift-with-random-explicit-runtime:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/hello.swift
runtime: random
diff --git a/tests/src/integration/webaction/manifest.yml b/tests/src/integration/webaction/manifest.yml
index 395e382..7c6c550 100644
--- a/tests/src/integration/webaction/manifest.yml
+++ b/tests/src/integration/webaction/manifest.yml
@@ -20,7 +20,8 @@ packages:
IntegrationTestWebAction:
actions:
greeting-web-action:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/greeting.js
runtime: nodejs:default
@@ -30,7 +31,8 @@ packages:
outputs:
payload: string
greeting-web-action-1:
- web-export: yes
+ annotations:
+ web-export: yes
version: 1.0
function: src/greeting.js
runtime: nodejs:default
@@ -40,19 +42,22 @@ packages:
outputs:
payload: string
greeting-with-raw-http:
- web-export: raw
+ annotations:
+ web-export: raw
version: 1.0
function: src/greeting.js
runtime: nodejs:default
greeting-web-action-final:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/greeting.js
runtime: nodejs:default
annotations:
final: true
greeting-web-action-with-custom-options:
- web-export: true
+ annotations:
+ web-export: true
version: 1.0
function: src/greeting.js
runtime: nodejs:default