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 event_property_is and event_property_contains props to PushConditions #1673

Merged
merged 3 commits into from Nov 16, 2023

Conversation

tusooa
Copy link
Contributor

@tusooa tusooa commented Nov 13, 2023

…ions

Signed-off-by: tusooa <tusooa@kazv.moe>
@tusooa tusooa requested a review from a team as a code owner November 13, 2023 01:40
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

Does this relate to a particular MSC? If so, please could you link it?

Also, please be aware that, as per CONTRIBUTING.rst, we require sign-off from a legally recognised name. If you'd prefer to keep this contribution anonymous, please follow the instructions there for private sign-off.

@clokep
Copy link
Contributor

clokep commented Nov 14, 2023

For cross-linking: seems I missed this in #1464?

@tusooa
Copy link
Contributor Author

tusooa commented Nov 14, 2023

Thanks for the contribution!

Does this relate to a particular MSC? If so, please could you link it?

Also, please be aware that, as per CONTRIBUTING.rst, we require sign-off from a legally recognised name. If you'd prefer to keep this contribution anonymous, please follow the instructions there for private sign-off.

The creator of DCO clarified that requiring a "legal name" is not an intention. https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=d4563201f33a022fc0353033d9dfeb1606a88330

I recognize that Matrix may have different intentions on this matter, but I will NOT provide a "legal name" to anyone just for the sake of ME contributing code to others, even if it is done privately. Requiring me to provide "legal name" is a great way to ensure that I will NEVER contribute code to any matrix-org repositories again.

If desired, please close this one and all other PRs I have made against any matrix-org repo, and roll back #1671 .

@joshsimmons
Copy link
Member

@tusooa Thank you so much for your contribution and your feedback on the DCO!

The team here will follow up with you about this PR in the next couple of days, but I wanted to jump in as the Managing Director of the Foundation to speak to the policy. Coincidentally, I was just discussing the specifics of our policy with the team last week! We are broadly on the same page about the issues with real name/legal name policies and are looking at amending our policy accordingly :) Not clear on timeline yet – got a lot of plates we're spinning – but I thought you deserved to know.

@richvdh
Copy link
Member

richvdh commented Nov 16, 2023

Hi @tusooa, thanks for your patience on this. I've checked in with our legal team and although our policy is currently still that we prefer to have a legal name, we're prepared to grant exceptions in cases where sharing a real name is a particular concern. And as @joshsimmons already said, he and the legal team are working on making the DCO process more inclusive generally.

On that basis, your existing sign-off is sufficient, thank you!

@richvdh
Copy link
Member

richvdh commented Nov 16, 2023

For cross-linking: seems I missed this in #1464?

Right. So these properties were added in matrix-org/matrix-spec-proposals#3758 and matrix-org/matrix-spec-proposals#3966.

richvdh
richvdh previously approved these changes Nov 16, 2023
@@ -43,5 +43,11 @@ properties:
optionally prefixed by one of, ==, <, >, >= or <=. A prefix of < matches
rooms where the member count is strictly less than the given number and
so forth. If no prefix is present, this parameter defaults to ==.
value:
type: ["string", "integer", "boolean", "null"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm. The spec displays this in a way that implies it should be an array. It looks like https://github.com/matrix-org/matrix-spec/blob/main/layouts/partials/openapi/render-object-table.html needs an update to handle this case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait. According to https://swagger.io/docs/specification/data-models/data-types/, this is not valid. "type as a list is not valid in OpenAPI (even though it is valid in JSON Schema)".

However, it is definitely a pattern we use elsewhere, such as here.

@KitsuneRal or @zecakeh, as people who know a lot more about OpenAPI than me: can you comment on this? Should we be updating the render-object-table to support multi-valued types? Or should we be using oneOf here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was not valid in OpenAPI 3.0, it is valid in OpenAPI 3.1, which is fully compatible with JSON Schema.

From "Migrating from OpenAPI 3.0 to 3.1.0":

In line with JSON Schema, the type keyword can now define multiple types for a schema with an array.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, thanks for the clarification; that's very helpful.

In that case I guess we should merge this and file a separate issue to fix the template.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changelogs/client_server/newsfragments/1673.clarification Outdated Show resolved Hide resolved
Comment on lines +49 to +51
Required for `event_property_is` and `event_property_contains` conditions.
A non-compound [canonical JSON](/appendices#canonical-json) value to match
against.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the record:

I don't find the wording "a non-compound canonical JSON value" particularly clear, but it does match the existing wording in the Conditions section, so let's go with it.

@richvdh richvdh dismissed their stale review November 16, 2023 12:38

not sure about multiple types

@richvdh richvdh merged commit 25a9157 into matrix-org:main Nov 16, 2023
12 checks passed
@richvdh
Copy link
Member

richvdh commented Nov 16, 2023

Thanks again for the contribution @tusooa !

@zecakeh zecakeh mentioned this pull request Nov 30, 2023
17 tasks
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.

None yet

5 participants