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

Metadata API: Add simple threshold validation #1450

Merged
merged 1 commit into from
Jun 16, 2021

Conversation

MVrachev
Copy link
Collaborator

@MVrachev MVrachev commented Jun 15, 2021

Fixes #1439

Description of the changes being introduced by the pull request:

Probably there could be future API calls that modify "threshold"
to a new value, but the problem is we don't have a clear idea
if they would exist and what exactly they will do.
That's why it makes sense to validate against the potential problems
we can imagine - in this case, is passing a threshold below 1.

Signed-off-by: Martin Vrachev [email protected]

Please verify and check that the pull request fulfills the following
requirements
:

  • The code follows the Code Style Guidelines
  • Tests have been added for the bug fix or new feature
  • Docs have been added for the bug fix or new feature

Probably there could be future API calls that modify "threshold"
to a new value, but the problem is we don't have a clear idea
if they would exist and what exactly they will do.
That's why it makes sense to validate against the potential problems
we can imagine - in this case, is passing a threshold below 1.

Signed-off-by: Martin Vrachev <[email protected]>
Copy link
Member

@jku jku left a comment

Choose a reason for hiding this comment

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

looks reasonable to me (spec doesn't very explicitly make this requirement but it seem logical). Doing a value check like this also implicitly checks that we have a type we can compare with <>. This seems like good enough typing to me.

@jku jku merged commit 6c4e2be into theupdateframework:develop Jun 16, 2021
@MVrachev MVrachev deleted the threshold-validation branch July 19, 2021 13:36
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.

Metadata Attribute research: Threshold
2 participants