adobe-apiplatform / openwhisk-github-deployer

Deploy to OpenWhisk from GitHub
4 stars 3 forks source link

Add support for specifying default parameters #4

Open ddragosd opened 7 years ago

ddragosd commented 7 years ago

When defining the webhook it would be nice to have a way to allow developers to specify default parameters.

One way to achieve this would be to use the query params and translate them to default parameters for actions. For example if the webhook for github is exposed from a vanity URL like /github/webhook?param1=value1&param2=value2

then automatically add param1 and param2 as default parameters to the action that gets created or updated.

trieloff commented 7 years ago

While playing with the functionality, I noticed that there is the potential of running into naming collisions. A possible alternative would be to inject these parameters as environment variables. This avoids naming conflicts, provides a clearer separation between system-provided configuration and user input and is compatible with 12-factor-app principles.

ddragosd commented 7 years ago

@trieloff if we use final parameters that are supported by OW, would this work as well ?

final: Applies only to an action. It makes all of the action parameters that are already defined immutable. A parameter of an action carrying the annotation may not be overridden by invoke-time parameters once the parameter has a value defined through its enclosing package or the action definition.

trieloff commented 7 years ago

Yes.