-
Notifications
You must be signed in to change notification settings - Fork 12
Metadata support for property and argument bounds info #104
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
base: main
Are you sure you want to change the base?
Metadata support for property and argument bounds info #104
Conversation
tools/markup-generators-plugin/templates/msdocs/script/module_changelog.mustache
Outdated
Show resolved
Hide resolved
…e and max value changes
…pertyAndArgumentBoundsInfo
SBLMikeDemone
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a few unnecessary changes and some mild confusion around the new argument comments
...-generator-test-snapshots/test/changelog_diffing/__snapshots__/changelogDiffing.spec.ts.snap
Outdated
Show resolved
Hide resolved
...-generator-test-snapshots/test/changelog_diffing/__snapshots__/changelogDiffing.spec.ts.snap
Outdated
Show resolved
Hide resolved
tools/markup-generators-plugin/templates/msdocs/script/module_changelog.mustache
Outdated
Show resolved
Hide resolved
| } | ||
| } | ||
| },{ | ||
| "has_max": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we drop the has_min/has_max flags and just rely on the min/max being present?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. By default, our bounds are set to a Type's numeric limits, (the absolute minimum and maximum values). Because of that, min/max will almost always be present. The has_min and has_max flag distinguish whether the min_value and max_value provided are different from the numeric limits of the Type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{
...
"has_max": true,
"has_min": false,
"max_value": 255,
"min_value": -2147483648, // Can we remove automatically added limits like this?
"type": {
...
"valid_range": {
"max": 2147483647,
"min": -2147483648
}
}
}I wonder if we should change that. Types already have a "valid range" right? Is there a reason that we always stamp down "min_value" and "max_value" even if a binding doesn't specifically add limits?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah we chatted about this, the valid range is wrong, it's hardcoded to int min/max. We were gonna do a follow up that fixes that and then gets rid of has_max/has_min.
Alternatively, I find it weird that "type" even has a "valid_range". The generator could just have a map of type -> valid range and that'd get rid of quite a lot of metadata.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made follow up here: Task 1527387: [Infra] [Scripting] Calculate has_min and has_max value in metadata
@BrandonChanSkybox We'll need to validate this change works in MC and then merge it into MC, and it may make more sense to just do all this in 1 PR after you're back in vacation. It'll result in less metadata changes over time and less updates to the generator. What do you think?
| min_added: Optional(Boolean), | ||
| min_changed: Optional(Boolean), | ||
| min_removed: Optional(Boolean), | ||
| max_added: Optional(Boolean), | ||
| max_changed: Optional(Boolean), | ||
| max_removed: Optional(Boolean), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zachcampbellskyboxlabs is there any way to specify these types should only show up in the changelog?
SBLMikeDemone
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me, just 2 small nits.
Adds Metadata support for Property and Argument Minimum and Maximum bounds info