You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2017/10/18 18:34:54 UTC

[GitHub] mrutkows opened a new issue #609: Annotations on Actions only work if "web export" exists

mrutkows opened a new issue #609: Annotations on Actions only work if "web export" exists
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/issues/609
 
 
   It appears at some point (perhaps when we added support for "web actions" that the ComposeActions() function has logic that ONLY creates Annotations on the wskAction IFF ```action.Webexport == "true"```. 
   
   To make matters more convoluted, even if "Webexport==true", the annotations are created as a "side effect" of calling ```utils.WebAction```; this is not good coding practice.
   
   ```		keyValArr = make(whisk.KeyValueArr, 0)
   		for name, value := range action.Annotations {
   			var keyVal whisk.KeyValue
   			keyVal.Key = name
   			keyVal.Value = utils.GetEnvVar(value)
   			keyValArr = append(keyValArr, keyVal)
   		}
   
   		// only set the webaction when the annotations are not empty.
   		if action.Webexport == "true" {
   			// TODO() why is this commented out?  we should now support annotations...
   			//wskaction.Annotations = keyValArr
   			wskaction.Annotations, errorParser = utils.WebAction("yes", keyValArr, action.Name, false)
   			if errorParser != nil {
   				return s1, errorParser
   			}
   		}
   ```
   
   we have NO testcases for Annotations on Actions (only for Triggers) and need several as part of fixing this issue.  The Annotations SHOULD work with or without "webExport==true" and NOT be a side effect.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services