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

Allow users to specify rule min/max treatment #689

Merged

Conversation

jiffyclub
Copy link
Contributor

Explain pull request

MDS does not currently specify whether Policy Rule minimum and maximum values are considered within bounds when evaluating whether something matches the rule (in other words, whether the rule bounds are a open, closed, or half-open interval). This PR adds new fields to Policy Rules that allow users to individually specify the treatment of the minimum and maximum values.

The new fields are called inclusive_minimum and inclusive_maximum. They are boolean fields that both default to true.

Is this a breaking change

  • No, not breaking

I don't think this is breaking, but it does define that by default rule minimum and maximum are considered within the rule bounds, which could potentially break interpretation of existing policy rules.

Impacted Spec

  • policy

Additional context

This is an alternative PR to #677, we should pick one or the other.

MDS does not currently specify whether Policy Rule minimum
and maximum values are considered within bounds when
evaluating whether something matches the rule
(in other words, whether the rule bounds are a open, closed,
or half-open interval). This PR adds new fields to Policy Rules
that allow users to individually specify the treatment of the
minimum and maximum values.

The new fields are called inclusive_minimum and inclusive_maximum.
They are boolean fields that both default to true.
@jiffyclub jiffyclub requested a review from a team as a code owner September 2, 2021 18:29
@schnuerle schnuerle added this to the 1.2.0 milestone Sep 7, 2021
@jiffyclub
Copy link
Contributor Author

jiffyclub commented Sep 9, 2021

On the MDS call today (2021-09-09) Zack Bouz (LADOT) raised the point that rule minimum and maximum are expected to be integers, per the spec. With the assumption that those values will always be integers it makes it easier to do something like #677, pick inclusive, and let people construct rules under that. I'll try to think of an example where it still would be nice to allow one or the other to be exclusive.

@jiffyclub
Copy link
Contributor Author

However, the question is really not whether the rule minimum and maximum are integers, but whether the values we're checking against the rules are integers. If they are ever floats I would still want this option, or we would need to define rounding behavior for converting floats to integers for this purpose.

@schnuerle
Copy link
Member

Per the working group action items, here is the schema template location for policy which needs to be updated. The templates generate the files during the release creation.

@jiffyclub
Copy link
Contributor Author

449a94f updates the policy schema template. Additionally, #688 now includes an example of these in practice.

@schnuerle schnuerle added the Policy Specific to the Policy API label Sep 17, 2021
@schnuerle schnuerle merged commit 8f35ac8 into openmobilityfoundation:dev Sep 17, 2021
@jiffyclub jiffyclub deleted the specify-min-max-inclusion branch January 11, 2022 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Policy Specific to the Policy API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants