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

Event Discovery: Add Variables to EventType V1Beta3 spec #7729

Open
Cali0707 opened this issue Feb 27, 2024 · 11 comments
Open

Event Discovery: Add Variables to EventType V1Beta3 spec #7729

Cali0707 opened this issue Feb 27, 2024 · 11 comments

Comments

@Cali0707
Copy link
Member

Cali0707 commented Feb 27, 2024

Problem
In the new v1beta3 api for eventtypes, we are allowing users to place "variables" into template strings for the various eventtype attributes. It would be good to allow users to give more information about what values are allowed for those variables.

To accomplish this, we can add a variables section to the spec like this:

apiVersion: eventing.knative.dev/v1beta3
kind: EventType
spec:
  reference:
    ...
  attributes:
    - name: "type"
      value: "event.{requestStatus}.foo"
      required: true
    ...
  variables:
    - name: "requestStatus"
      pattern: "req_est.%"
      example: "request.failed"
@Cali0707
Copy link
Member Author

cc @pierDipi @matzew @dsimansk

I'd love to get some feedback on this idea

@Cali0707
Copy link
Member Author

@pierDipi can we discuss this at the WG call this week? I need a decision on how we are planning to proceed here for #7883

@matzew
Copy link
Member

matzew commented Jun 25, 2024

Was there any outcome on that discussion?

@Cali0707
Copy link
Member Author

@matzew I think the decision was that we would aim to include this, as long as people were happy with the API. Any thoughts on the API proposed here/anything you would change?

@matzew
Copy link
Member

matzew commented Jun 25, 2024

Any thoughts on the API proposed here/anything you would change?

  attributes:
    - name: "type"
      value: "event.{requestStatus}.foo"
      required: true
    ...
  variables:
    - name: "requestStatus"
      regex: "[a-zA-Z]"
      example: "request.failed"

so for reconciling these, we would expect that if {variables} are used, it MUST have variables section, containing those that are specified. Otherwise: not getting to ready state.

For the implementation, I guess we could just rely on simple regex library? Should we prevent some parts? Expressions and templating always causes hell of problems. Does CE-SQL have something?

@Cali0707
Copy link
Member Author

so for reconciling these, we would expect that if {variables} are used, it MUST have variables section, containing those that are specified. Otherwise: not getting to ready state.

Yeah, I think that makes sense to me, we might also want to verify that the example in the variable is allowable based on the pattern for the variable

Does CE-SQL have something?

For CESQL, it doesn't support full regex matches instead it allows for a wildcard character % that matches any number of wildcard characters and another wildcard character _ that matches exactly one wildcard character. This would simplify the templating allowed for the variables a lot I think, which should make it easier to manage.

@matzew
Copy link
Member

matzew commented Jun 25, 2024

Yeah, I think that makes sense to me, we might also want to verify that the example in the variable is allowable based on the pattern for the variable

I agree, so we have a set of "scoped" rules

This would simplify the templating allowed for the variables a lot I think, which should make it easier to manage.

some reuse possible?

@Cali0707
Copy link
Member Author

Yeah I think the reuse would make this easier, and also would make implementing the event lineage matches easier too! I've updated the proposed API to have the pattern match the CESQL syntax, instead of being a regex. @matzew @pierDipi are we good to move forwards with this?

@Cali0707
Copy link
Member Author

@pierDipi quick ping here - are you good with moving forwards with the CESQL LIKE syntax here?

Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 28, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2024
@pierDipi pierDipi reopened this Nov 27, 2024
@pierDipi
Copy link
Member

/remove-lifecycle stale

@knative-prow knative-prow bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants