Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add top level boolean logic operator for signals #12

Closed
VaibhavPage opened this issue Jun 1, 2018 · 3 comments
Closed

Add top level boolean logic operator for signals #12

VaibhavPage opened this issue Jun 1, 2018 · 3 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@VaibhavPage
Copy link
Contributor

VaibhavPage commented Jun 1, 2018

Is your feature request related to a problem? Please describe.
With current Sensor spec, user can only use AND operator for multiple signals and it lacks support for complex signals circuiting.

Describe the solution you'd like
Use "--" for OR operator and "-" for AND operator.

Example-

signals:
   -- name: time
      calender:
        interval: 10s
    - name: minioS3
      artifact:
        s3:
          bucket: hello
          endpoint: artifacts-minio.default:9000
          insecure: true
          accessKey:
            key: accesskey
            name: artifacts-minio
          secretKey:
            key: secretkey
            name: artifacts-minio
          event: s3:ObjectCreated:Put
          arn:
            partition: minio
            service: sqs
            region: us-east-1
            accountID: "1"
            resource: nats
        stream:
          nats:
            url: nats://example-nats-cluster:4222
            subject: bucketevents
   -- name: worklow-1
       resource:
         namespace: default
         group: "argoproj.io"
         version: "v1alpha1"
         kind: "Workflow"
         filter:
           prefix: scripts-bash
           labels:
             workflows.argoproj.io/phase: Succeeded 
      
@VaibhavPage VaibhavPage added the enhancement New feature or request label Jun 1, 2018
@VaibhavPage VaibhavPage changed the title Add OR support for signals Add OR operator for signals Jun 1, 2018
@magaldima
Copy link
Contributor

magaldima commented Jun 1, 2018

I have thought about this in terms of implementing the basic buildings blocks of binary logic as in circuit AND and OR logic gates. This does make sense to me and would be a valuable feature for signals, however I think there has to be a more evident and transparent way to define AND/OR logic in the signal specification than using - vs --.

@magaldima magaldima changed the title Add OR operator for signals Add top level boolean logic operator for signals Jun 1, 2018
@magaldima magaldima self-assigned this Jun 4, 2018
@magaldima magaldima added the help wanted Extra attention is needed label Jun 20, 2018
@magaldima magaldima added stalled and removed help wanted Extra attention is needed needs investigation labels Jul 24, 2018
@magaldima magaldima removed their assignment Jul 30, 2018
@VaibhavPage
Copy link
Contributor Author

VaibhavPage commented Sep 19, 2018

I feel this feature is essential to make framework easy to use. Basically, without support for OR operator, you end up writing multiple sensors that trigger same workflow. e.g. consider your gateway is generating 4 different configuration, and for each event we want to create same workflow, then adding these 4 signals in one sensor will cause sensor to wait on all 4 signals, definitely what we wanted.

@VaibhavPage VaibhavPage added the help wanted Extra attention is needed label Jan 15, 2019
@VaibhavPage
Copy link
Contributor Author

https://github.com/Knetic/govaluate does the job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants