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 2019/09/10 16:24:22 UTC

[openwhisk-wskdeploy] branch master updated: Support Description field in corresponding entities (#1057)

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 8c8d6f5  Support Description field in corresponding entities (#1057)
8c8d6f5 is described below

commit 8c8d6f5de40d9faea4c69a5e1b4a37c7d21b1855
Author: Alvaro Lopez Garcia <al...@ifca.unican.es>
AuthorDate: Tue Sep 10 18:24:16 2019 +0200

    Support Description field in corresponding entities (#1057)
    
    The Description field should be supported across all entities, as it is
    included in the "Shared Entity Schema".
    
    Fixes: #548
---
 parsers/yamlparser.go                                        | 4 ++++
 tests/dat/manifest_validate_package_grammar.yaml             | 1 +
 tests/dat/manifest_validate_package_grammar_env_var.yaml     | 1 +
 tests/dat/manifest_validate_trigger_action_rule_grammar.yaml | 4 ++++
 4 files changed, 10 insertions(+)

diff --git a/parsers/yamlparser.go b/parsers/yamlparser.go
index 85864b8..b46ed98 100644
--- a/parsers/yamlparser.go
+++ b/parsers/yamlparser.go
@@ -113,6 +113,7 @@ type Action struct {
 	Limits      *Limits                `yaml:"limits"`
 	Inputs      map[string]Parameter   `yaml:"inputs"`
 	Outputs     map[string]Parameter   `yaml:"outputs"`
+	Description string                 `yaml:"description,omitempty"`
 	Annotations map[string]interface{} `yaml:"annotations,omitempty"`
 	Include     [][]string             `yaml:"include,omitempty"`
 	Exclude     []string               `yaml:"exclude,omitempty"`
@@ -159,6 +160,7 @@ type Trigger struct {
 	Credential  string               `yaml:"credential"`
 	Inputs      map[string]Parameter `yaml:"inputs"`
 	Name        string
+	Description string                 `yaml:"description,omitempty"`
 	Annotations map[string]interface{} `yaml:"annotations,omitempty"`
 	// TODO() this is propoagated from package to trigger within that package
 	//Parameters  map[string]interface{} `yaml:parameters`
@@ -185,6 +187,7 @@ type Rule struct {
 	Rule   string `yaml:"rule"`   //used in manifest.yaml
 	//mapping to wsk.Rule.Name
 	Name        string
+	Description string                 `yaml:"description,omitempty"`
 	Annotations map[string]interface{} `yaml:"annotations,omitempty"`
 }
 
@@ -216,6 +219,7 @@ type Package struct {
 	Rules            map[string]Rule                                               `yaml:"rules"`
 	Inputs           map[string]Parameter                                          `yaml:"inputs"`
 	Sequences        map[string]Sequence                                           `yaml:"sequences"`
+	Description      string                                                        `yaml:"description,omitempty"`
 	Annotations      map[string]interface{}                                        `yaml:"annotations,omitempty"`
 	Apis             map[string]map[string]map[string]map[string]APIMethodResponse `yaml:"apis"`
 }
diff --git a/tests/dat/manifest_validate_package_grammar.yaml b/tests/dat/manifest_validate_package_grammar.yaml
index ff9a047..c400d4f 100644
--- a/tests/dat/manifest_validate_package_grammar.yaml
+++ b/tests/dat/manifest_validate_package_grammar.yaml
@@ -20,3 +20,4 @@ packages:
   helloworld:
     version: 1.0
     license: Apache-2.0
+    description: Foo Bar
diff --git a/tests/dat/manifest_validate_package_grammar_env_var.yaml b/tests/dat/manifest_validate_package_grammar_env_var.yaml
index e439114..05769f7 100644
--- a/tests/dat/manifest_validate_package_grammar_env_var.yaml
+++ b/tests/dat/manifest_validate_package_grammar_env_var.yaml
@@ -20,6 +20,7 @@ packages:
   $package_name:
     version: 1.0
     license: Apache-2.0
+    description: Foo Bar
   $package_name_second:
     version: 1.0
     license: Apache-2.0
diff --git a/tests/dat/manifest_validate_trigger_action_rule_grammar.yaml b/tests/dat/manifest_validate_trigger_action_rule_grammar.yaml
index b0cbb13..bee6ef3 100644
--- a/tests/dat/manifest_validate_trigger_action_rule_grammar.yaml
+++ b/tests/dat/manifest_validate_trigger_action_rule_grammar.yaml
@@ -22,8 +22,10 @@ packages:
         license: Apache-2.0
         actions:
             first_action:
+                description: Foo Bar 1
                 function: actions/dump_params.js
             second_action:
+                description: Foo Bar 2
                 function: actions/dump_params.js
             third_action:
                 function: actions/dump_params.js
@@ -32,9 +34,11 @@ packages:
             trigger2:
         rules:
             rule1:
+                description: Foo Bar 1
                 trigger: trigger1
                 action: first_action
             rule3:
+                description: Foo Bar 2
                 trigger: trigger2
                 action: second_action
             rule2: