Skip to content

[Subscriptions API] Multiple dialects in the filter object#803

Merged
duglin merged 3 commits into
cloudevents:masterfrom
slinkydeveloper:subscriptions-api-filter
May 24, 2021
Merged

[Subscriptions API] Multiple dialects in the filter object#803
duglin merged 3 commits into
cloudevents:masterfrom
slinkydeveloper:subscriptions-api-filter

Conversation

@slinkydeveloper
Copy link
Copy Markdown
Member

@slinkydeveloper slinkydeveloper commented Apr 6, 2021

This PR modifies the shape of the filter subscription request attribute to an array of filter expressions:

This:

filter:
  exact: ...

Becomes this:

filters:
  - exact: ...

The reason to introduce this change is to improve ergonomics of the filter usage in most use cases, where at the top level the user wants to do an and of several filters. In other words this:

filter:
  all:
    - exact: ...
    - prefix: ...

Can be written as:

filters:
  - exact: ...
  - prefix: ...

It also renames filter to filters, in order to be more consistent with the change itself.

The openapi schema change is going to be introduced in another PR.

Signed-off-by: Francesco Guardiani francescoguard@gmail.com

Comment thread subscriptions-api.md Outdated
@duglin
Copy link
Copy Markdown
Collaborator

duglin commented Apr 8, 2021

No strong opinion but I do suspect AND will be one of the more popular dialects.

@slinkydeveloper slinkydeveloper changed the title Subscriptions api multiple dialects in the filter object [Subscriptions api] multiple dialects in the filter object Apr 21, 2021
@slinkydeveloper slinkydeveloper changed the title [Subscriptions api] multiple dialects in the filter object [Subscriptions API] Multiple dialects in the filter object Apr 21, 2021
@duglin
Copy link
Copy Markdown
Collaborator

duglin commented Apr 29, 2021

rebase needed

@duglin
Copy link
Copy Markdown
Collaborator

duglin commented Apr 29, 2021

we'd need to change the schema too, from:

  "filter": { ?
    "[dialect name]": [dialect specific object] ?
  },

to

  "filter": { ?
    "[dialect name]": [dialect specific object] *
  },

right?

@slinkydeveloper slinkydeveloper force-pushed the subscriptions-api-filter branch from 9b9cd32 to 1172ab8 Compare April 29, 2021 07:46
@slinkydeveloper
Copy link
Copy Markdown
Member Author

Schema fixed

@duglin
Copy link
Copy Markdown
Collaborator

duglin commented Apr 29, 2021

@slinkydeveloper slinkydeveloper force-pushed the subscriptions-api-filter branch from 1172ab8 to aa0f787 Compare May 3, 2021 08:49
@slinkydeveloper
Copy link
Copy Markdown
Member Author

I've removed the openapi schema change as discussed during the meeting

Renamed filter to filters

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
@slinkydeveloper slinkydeveloper force-pushed the subscriptions-api-filter branch from aa0f787 to 531ca9b Compare May 4, 2021 08:01
@slinkydeveloper
Copy link
Copy Markdown
Member Author

After discussing with @clemensv, I've changed this PR completely. I've updated the description of the PR accordingly

Comment thread subscriptions-api.md Outdated
Comment thread subscriptions-api.md Outdated
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
@duglin
Copy link
Copy Markdown
Collaborator

duglin commented May 20, 2021

Just a few minor syntax questions, otherwise SGTM

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
@duglin
Copy link
Copy Markdown
Collaborator

duglin commented May 24, 2021

Approved on the 5/20 call

@duglin duglin merged commit d90d1d7 into cloudevents:master May 24, 2021
@slinkydeveloper slinkydeveloper deleted the subscriptions-api-filter branch May 26, 2021 14:00
@slinkydeveloper
Copy link
Copy Markdown
Member Author

I'm going to push the followup change to the openapi spec soon

slinkydeveloper added a commit to slinkydeveloper/spec that referenced this pull request Jun 1, 2021
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
duglin pushed a commit that referenced this pull request Jun 9, 2021
[Subscriptions API] Fix OpenAPI as followup of #803
pierDipi added a commit to pierDipi/spec that referenced this pull request Feb 21, 2022
To improve the usage of the API in the common case, like in
cloudevents#803, I'm removing
the restriction for `exact, `prefix` and `suffix` filters of only
containing exacly one attribute.

When multiple attributes are specified, all filter must match,
for example, these filters:

```yaml
filters:
  - all:
      suffix:
        type: "com.github.push"
  - all:
      suffix:
        subject: "https//github.com/cloudevents/spec"
```

can be written as:

```yaml
filters:
  - suffix:
      type: "com.github.push"
      subject: "https//github.com/cloudevents/spec"
```

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
pierDipi added a commit to pierDipi/spec that referenced this pull request Feb 21, 2022
To improve the usage of the API in the common case, like in
cloudevents#803, I'm removing
the restriction for `exact, `prefix` and `suffix` filters of only
containing exacly one attribute.

When multiple attributes are specified, all filter must match,
for example, these filters:

```yaml
filters:
  - suffix:
      type: "com.github.push"
  - suffix:
      subject: "https//github.com/cloudevents/spec"
```

can be written as:

```yaml
filters:
  - suffix:
      type: "com.github.push"
      subject: "https//github.com/cloudevents/spec"
```

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
pierDipi added a commit to pierDipi/spec that referenced this pull request Feb 21, 2022
To improve the usage of the API in the common case, I'm removing
the restriction for `exact, `prefix` and `suffix` filters of only
containing exacly one attribute.

When multiple attributes are specified, all filter must match (
like in [1]), for example, these filters:

```yaml
filters:
  - suffix:
      type: "com.github.push"
  - suffix:
      subject: "https//github.com/cloudevents/spec"
```

can be written as:

```yaml
filters:
  - suffix:
      type: "com.github.push"
      subject: "https//github.com/cloudevents/spec"
```

[1]: cloudevents#803

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
pierDipi added a commit to pierDipi/spec that referenced this pull request Feb 21, 2022
To improve the usage of the API in the common case, I'm removing
the restriction for `exact, `prefix` and `suffix` filters of only
containing exacly one attribute.

When multiple attributes are specified, all filter must match (
like in [1]), for example, these filters:

```yaml
filters:
  - suffix:
      type: "com.github.push"
  - suffix:
      subject: "https//github.com/cloudevents/spec"
```

can be written as:

```yaml
filters:
  - suffix:
      type: "com.github.push"
      subject: "https//github.com/cloudevents/spec"
```

[1]: cloudevents#803

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
pierDipi added a commit to pierDipi/spec that referenced this pull request Feb 21, 2022
To improve the usage of the API in the common case, I'm removing
the restriction for `exact`, `prefix` and `suffix` filters of only
containing exacly one attribute.

When multiple attributes are specified, all filter must match (
like in [1]), for example, these filters:

```yaml
filters:
  - suffix:
      type: "com.github.push"
  - suffix:
      subject: "https//github.com/cloudevents/spec"
```

can be written as:

```yaml
filters:
  - suffix:
      type: "com.github.push"
      subject: "https//github.com/cloudevents/spec"
```

[1]: cloudevents#803

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
pierDipi added a commit to pierDipi/spec that referenced this pull request Feb 21, 2022
To improve the usage of the API in the common case, I'm removing
the restriction for `exact`, `prefix` and `suffix` filters of only
containing exactly one attribute.

When multiple attributes are specified, all attributes must match (
like in [1]), for example, these filters:

```yaml
filters:
  - suffix:
      type: "com.github.push"
  - suffix:
      subject: "https//github.com/cloudevents/spec"
```

can be written as:

```yaml
filters:
  - suffix:
      type: "com.github.push"
      subject: "https//github.com/cloudevents/spec"
```

[1]: cloudevents#803

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
pierDipi added a commit to pierDipi/spec that referenced this pull request Feb 21, 2022
To improve the usage of the API in the common case, I'm removing
the restriction for `exact`, `prefix` and `suffix` filters of only
containing exactly one attribute.

When multiple attributes are specified, all attributes must match (
like in [1]), for example, these filters:

```yaml
filters:
  - suffix:
      type: "com.github.push"
  - suffix:
      subject: "https//github.com/cloudevents/spec"
```

can be written as:

```yaml
filters:
  - suffix:
      type: "com.github.push"
      subject: "https//github.com/cloudevents/spec"
```

[1]: cloudevents#803

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
duglin pushed a commit that referenced this pull request Feb 24, 2022
…efix and suffix filters (#957)

* Remove exactly one attribute restriction for exact, prefix and suffix

To improve the usage of the API in the common case, I'm removing
the restriction for `exact`, `prefix` and `suffix` filters of only
containing exactly one attribute.

When multiple attributes are specified, all attributes must match (
like in [1]), for example, these filters:

```yaml
filters:
  - suffix:
      type: "com.github.push"
  - suffix:
      subject: "https//github.com/cloudevents/spec"
```

can be written as:

```yaml
filters:
  - suffix:
      type: "com.github.push"
      subject: "https//github.com/cloudevents/spec"
```

[1]: #803

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Update subscription open API

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
clemensv pushed a commit to clemensv/spec that referenced this pull request Aug 19, 2022
…efix and suffix filters (cloudevents#957)

* Remove exactly one attribute restriction for exact, prefix and suffix

To improve the usage of the API in the common case, I'm removing
the restriction for `exact`, `prefix` and `suffix` filters of only
containing exactly one attribute.

When multiple attributes are specified, all attributes must match (
like in [1]), for example, these filters:

```yaml
filters:
  - suffix:
      type: "com.github.push"
  - suffix:
      subject: "https//github.com/cloudevents/spec"
```

can be written as:

```yaml
filters:
  - suffix:
      type: "com.github.push"
      subject: "https//github.com/cloudevents/spec"
```

[1]: cloudevents#803

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Update subscription open API

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants