Giter VIP home page Giter VIP logo

contrib's People

Contributors

abhijitwakchaure avatar andyhamp avatar awakchau-tibco avatar debovema avatar dependabot[bot] avatar fcastill avatar ganitagya avatar ihadeed avatar jezrsmith avatar lixingwang avatar masterclock avatar mellistibco avatar philippe-lavoie avatar pointlander avatar skothari-tibco avatar snagarajugari avatar vijaynalawade avatar vnalawad-tibco avatar ymoreiratiti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

contrib's Issues

Rest Trigger and Files

Currently the rest trigger does not handle requests containing files. Should we add that feature in the main Rest trigger? Or should we have a different trigger to handle files ? @fm-tibco @mellistibco @abramvandergeest can you share your thoughts on this?

Currently, https://github.com/skothari-tibco/contrib/tree/rest_image/trigger/rest supports a single file. We can change it to handle multiple files.

Changes to the current trigger will include. Adding file setting in handler settings. And the type of the content would be map[multipart.FileHeader]multipat.File. We can also discuss on the format of output.

file setting in the handler setting will be the key which contains the files in the Http request.The Http request should of type multipart/form-data
The reason there is multipart.FileHeader as a part of output because it contains the name, type and size of the file. Getting this information form the multipart.File only would not be possible.

Should all contributions have their own go.mod file ?

Context

In Flogo, when we want to install a contribution (github.com/project-flogo/contrib/activity/log for instance) in an application we run:

flogo install github.com/project-flogo/contrib/activity/log

Currently, this command does a go get -u github.com/project-flogo/contrib/activity/log (see https://github.com/project-flogo/cli/blob/99f31dabada136e9cddc2e5202d97011a7a315bc/util/mod.go#L80).

By design, go get cannot fetch a specific revision (tag or branch), but only HEAD (master).

Hence we cannot do something like:

flogo install github.com/project-flogo/contrib/activity/[email protected]

Instead we could use go mod edit in the flogo install command instead of go get:

go mod edit -require github.com/project-flogo/contrib/activity/[email protected]

as tried at https://github.com/square-it/cli/blob/1e044ca3c17e14913e3914700aa4210e55c4292d/util/mod.go#L82.

Issue

However this will lead to this error:

go: finding github.com/project-flogo/contrib/activity/log v0.9.0
go: errors parsing go.mod:
/workspaces/flogo/simple-app/src/go.mod:4: invalid module version "v0.9.0": missing github.com/project-flogo/contrib/activity/log/go.mod at revision 680ebf186e58

That's logic since the go.mod file for this contributions repository lives at github.com/project-flogo/contrib, not at github.com/project-flogo/contrib/activity/log

Solutions

1. use separate contribution import path and contribution module import path

Using a more verbose commands such as:

flogo install github.com/project-flogo/[email protected] github.com/project-flogo/contrib/activity/log

flogo install -module github.com/project-flogo/[email protected] -contrib github.com/project-flogo/contrib/activity/log

the Flogo CLI could use the module import in go.mod and the contribution import path in imports.go.

another more compact representation allowing multiple contributions installation at once

flogo install github.com/project-flogo/[email protected]/activity/log github.com/project-flogo/[email protected]/activity/rest

2. make all contribution (activities, triggers, ...) have their own go.mod file

If we don't want to modify the CLI behaviour, we can also require that any contribution must have its own go.mod file. For instance, go.mod for the github.com/project-flogo/contrib/activity/log activity would look like:

module github.com/project-flogo/contrib/activity/log

require (
	...
)

3. Create a new syntax for Flogo imports

Described in PR project-flogo/cli#32

Depends on PRs:

new function for array

Consider adding more array functions.

  • Array.sum
  • Array.merge
  • array.reverse
  • array.slice

Please add more if you think it is valuable.

Return activity is missing the property "return: true"

WebUI decides if the activity is the last executable type of task based on the property return set to true in its descriptor JSON. With the new contribution installed into web ui, adding a Return activity to the flow is allowing the user to add further activities.

image

REST Invoke - Path and Query Params not working

Below is the Rest Invoke Activity definition. I changed the key for security.

I am getting below error when I try to run it.

2019-11-27T16:14:26.909-0500    INFO    [flogo.activity.log] -  404 -> {"Code":"404","Message":"Not found","Reference":"/currentconditions/v1?apikey=95df38db964c4236936b1e894ad2232f","Exception":null}

The same mapping is working fine when I use in logger and getting json logged.

Mapping: "=string.concat('{\"zipC\": \"', $flow.CityCode_Input, '\"}')"

Log Entry: 2019-11-27T16:14:26.722-0500 INFO [flogo.activity.log] - '{"zipC": "70604"}' - HostID [3758ec316bc59a057d4364336a20b3bc], HostName [Lambda_GET_WeatherLimit_POC], Activity [Log_Request]

{
            "id": "rest_3",
            "name": "AccuWeather_GET_RESTInvoke",
            "description": "Invokes a REST Service",
            "activity": {
              "ref": "#rest",
              "input": {
                "pathParams": "=string.concat('{\"zipC\": \"', $flow.CityCode_Input, '\"}')",
                "queryParams": "=string.concat('{\"apikey\": \"', 'N1KaG63pxFWtIQRcZuKX9', '\"}')"
              },
              "settings": {
                "uri": "http://dataservice.accuweather.com/currentconditions/v1/:zipC?",
                "method": "GET"
              }
            }
          }

cli trigger build fails

Building an app that include a CLI trigger fails with the following error:

Building executable [Name:ProcessStarter, OS:linux, Arch:amd64] for the TCI app with Id [fisqswzm7ch2k2qvg6mlx5wl3enago73]
› CLIBaseError: Build executable error: Build debugger engine binary build error [exit status 2], details # engine
› src/engine/shim_support.go:15:7: flogoJSON redeclared in this block
› src/engine/embeddedapp.go:10:7: other declaration of flogoJSON
› src/engine/shim_support.go:63:15: undefined: NewManagement

Path parameter seems to be ignore when Query parameters are added

I am new to flogo and I started to use it with the Flogo Web UI.

I tried creating an application with a Receive HTTP Message Trigger and in the path definition I wrote the following:
/flightbooking/:class?firstName=first&lastName=last

When I test it through the browser, it seems like the path parameter is ignored and only the query parameters are considered.
The response I receive is the following:
{"Class":"","Cost":468,"DepartureDate":"02/03/2023","DeparturePoint":"PAR","Destination":"SFO","FirstName":"first","Id":533,"LastName":"last"}

But then I tried creating another Flow action in the same App, also with a Receive HTTP Message Trigger, but this time with the following path:
/hello/:name

And then the path parameter is not ignored, because I receive it in the response:
{"Hello":"Test"}

In both cases I am mapping the Trigger Output to the Flow input in the same way:
$.pathParams.class
$.pathParams.name

Can you help with this issue? Is there something that I need to be doing differently?

If you need more info on other parts of the flow, just let me know!

Installing trigger cli fails with repository not found

flogo install github.com/project-flogo/trigger/cli

Error in installing 'github.com/project-flogo/trigger/cli'
Error installing contribution/dependency: go get github.com/project-flogo/trigger/cli@latest: module github.com/project-flogo/trigger/cli: git ls-remote -q origin in /Users/mmussett/src/go/pkg/mod/cache/vcs/d2184ee5c3f75ba69f657d9e271de453da32be2d5f29a09c6632ea84faa465e4: exit status 128:
remote: Repository not found.
fatal: repository 'https://github.com/project-flogo/trigger/' not found

Install contrib not working

Try to execute
fritz@ubuntu:~$ flogo install github.com/project-flogo/contrib/activity/log
Error validating project: not a valid flogo app project directory, missing 'src' diretory

Seems to be same for all addons.

Use env variable on setting of kafka producer

I am trying to put the list of brokers and topics from environment variable with "$env [KAFKA_BROKER_URLS]" and when I run it I get the following error:

Failed to create engine: unable to create stage 'github.com/project-flogo/contrib/activity/kafka' : BrokerUrl [=$env[KAFKA_BROKER_URLS]] format invalid for reason: [BrokerUrl must be composed of sections like "host:port"]

Re-consider the varArgs for function description

Today, the varArgs is function level field, take concat function as an example here:

{
      "name": "concat",
      "description": "concatenate a set of string",
      "example": "string.concat(\"Hello\",' ', \"World\") => Hello World",
      "varArgs": true,
      "args": [
        {
          "name": "str",
          "type": "string"
        }
      ],
      "return": {
        "type": "string"
      }
    }

But actually the varArgs should be an argument level fields. from go perspective, the varArgs can be only the last argument and there still can be more different type arguments before that.

For concat case, it makes more sense only when the arguments more than 2. so change the descript to below seems more reasonable.

{
  "name": "concat",
  "description": "concatenate a set of string",
  "example": "string.concat(\"Hello\",' ', \"World\") => Hello World",
  "args": [
    {
      "name": "str",
      "type": "string",
      "required": true
    },
    {
      "name": "str2",
      "type": "string",
      "required": true
    },
    {
      "name": "str3",
      "type": "string",
      "varArgs": true
    }
  ],
  "return": {
    "type": "string"
  }
}

@fm-tibco @mellistibco Please give your thoughts.

rest invoke output name mismatch in descriptor.json and runtime metadata

Descriptor json defines as result:

  "output": [
    {
      "name": "status",
      "type": "int",
      "description" : "The HTTP status code"
    },
    {
      "name": "result",
      "type": "any",
      "description" : "The HTTP response data"
    }
  ]

But runtime metadata define as data

type Output struct {
	Status int         `md:"status"` // The HTTP status code
	Data   interface{} `md:"data"`   // The HTTP response data
}

flogo build fails with runaction contribution

When trying to build my flogo project with github.com/project-flogo/contrib/activity/runactioncontribution installed, I get the following errror:

flogo build

Error building project: go: finding github.com/project-flogo/core/runner latest
C:\Users\ppaidi\goworkspace\pkg\mod\github.com\project-flogo\contrib\activity\[email protected]\activity.go:12:2: unknown import path "github.com/project-flogo/core/runner": cannot find module providing package github.com/project-flogo/core/runner

http function not working

There are some HTTP functions not working which has NPE exception.

Such as:

  • http.reqCookieToParams
  • http.resCookieToObject
  • http.resCookiesToObjectMap

we should add test cases for all functions

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.