Repository: argoproj/argo-events

Issue #733: Eliminate the code dependency on argo workflow
Created: 2020-07-09T18:10:03Z
Is your feature request related to a problem? Please describe.
argo-events currently has 2 dependencies on argo-workflow:

argo binary in sensor Dockerfile
github.com/argoproj/argo import in source code, this is mainly used in https://github.com/argoproj/argo-events/blob/master/sensors/triggers/argo-workflow/argo-workflow.go.

Every time when argo-workflow releases new features, both of these 2 places need to be upgraded.
Considering CLI won't have changes frequently, frequency of upgrading CLI version could unfollow argo release frequency. But the code dependency sometimes makes big differences. For example, if there's a new field in workflow spec, if we don't upgrade, the new field will not be recognized by argo-events, thus the submitted workflow will not be the same as user provides.
Describe the solution you'd like
Eliminate the code dependency on argo-workflow.
Don't convert the workflow spec provided by the user to a workflow object.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.

Duplicate issue #716: ArgoWorkflowTrigger with retryStrategy failing to Unmarshal.
Created: 2020-06-23T23:17:51Z
Describe the bug
When using the argoWorkflow trigger together with retryStrategy like the following config. I get an error in the sensor Failed to parse workflow: error unmarshaling JSON: while decoding JSON: json: unknown field "backoff".
The configuration retryStrategy was added in Argo v2.5.0, I saw that there are some changes from the version I'm now in argo events, currently 0.16 and I'm on 0.14. Nevertheless, I'm waiting for the helm chart be updated
Workflow configuration took from https://argoproj.github.io/docs/argo/examples/readme.html#retrying-failed-or-errored-steps
triggers:
    - template:
        [...]
        argoWorkflow:
          group: argoproj.io
          version: v1alpha1
          resource: workflows
          operation: submit
          source:
            resource:
              apiVersion: argoproj.io/v1alpha1
              kind: Workflow
              metadata:
                [...]
              spec:
                parallelism: 1
                entrypoint: process
                arguments:
                  parameters:
                    - name: tuple
                      value:
                templates:
                  - name: process
                    serviceAccountName: workflows
                    inputs:
                      parameters:
                        [...]
                    retryStrategy:
                      limit: 10
                      retryPolicy: "Always"
                      backoff:
                        duration: "10"
                        factor: 2
                        maxDuration: "5m"
                    container:
                      image: "image"
                      imagePullPolicy: Always
                      command: [/app/dag]
                      args:
                        [...]
                      env:
                        [...]

To Reproduce
Steps to reproduce the behavior:

Using the above configuration or any template and adding the following configuration to the templates will throw the error.

               retryStrategy:
                      limit: 10
                      retryPolicy: "Always"
                      backoff:
                        duration: "10"
                        factor: 2
                        maxDuration: "5m"

Expected behavior
Marshaling JSON should be fine.
Environment (please complete the following information):

Version Argo 2.5.0
Version Argo Events 0.14.0

I appreciate any help.
Thanks in advance.

Closing comment (2020-07-15T18:22:44Z): should be related to #733