Git Product home page Git Product logo

Comments (2)

daisy-ycguo avatar daisy-ycguo commented on June 1, 2024

A feed has an associated trigger, whose URL is registered to a call back in the feed action. I'm not clear how to handle that logic of trigger. I think there are two options:

  1. Following the existing logic of OpenWhisk, when creating a trigger, "--feed" option can be used to associate the trigger with a feed action. An implicit "feed action" invocation will happen, passing the parameter of triggerName and lifecycleEvent to the "feed action".

Sample manifest.yml deployment.yml

I think the implementation logic should be like this:

  1. After parsing manifest.yml, the program knows there is a trigger, a feed and an action.
  2. The program will create the action.
  3. When the program is creating the trigger, it will get the parameters of feed from deployment.yml, and invoke a command like:
    wsk trigger create webhook-trigger --feed guest/webhook -p username daisy-ycguo -p repository https://github.com/openwhisk/wsktool.git ...

Please notice the value of "--feed" is guest/webhook, which is feed action, not the feed guest/webhook-feed, because the previous command line should invoke the feed action "webhook" implicitly. We cannot pass the exact feed name to "--feed" parameter.

  1. Do not follow the existing logic of OpenWhisk, since we have clearly separate feed and action in the manifest.yml, we can define explicitly that a parameter "triggerName" will be passed to feed action.

Sample manifest.yml deployment.yml

I think the implementation logic should be like this:

  1. After parsing manifest.yml, the program knows there is a trigger, a feed and an action.
  2. The program will create the action and the trigger.
  3. When the program is creating feed, it will get the parameters of feed from deployment.yml, and invoke a command like:
    wsk action invoke guest/webhook -p lifecycleEvent CREATE -p triggerName guest/webhook-trigger -p username daisy-ycguo -p repository https://github.com/openwhisk/wsktool.git ...

Both of these two options have a problem: there is no feed "guest/webhook-feed" created in OpenWhisk. Will that cause any potential issues?

I prefer the first one, because it aligns with OW logic. But the second option is more clear, I think it will be more understandable in complicated cases.

@mrutkows @paulcastro please tell me which option you prefer.

from openwhisk-wskdeploy.

daisy-ycguo avatar daisy-ycguo commented on June 1, 2024

David and I decided to use the first option. Because it's much easier for the editor of the yaml files.

from openwhisk-wskdeploy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.