-
Notifications
You must be signed in to change notification settings - Fork 292
Add new check for new parameters' default value #5784
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 new check for new parameters' default value #5784
Conversation
02d0b9f
to
0bc1c71
Compare
checking parameters with newer releases does not work well as there are existing | ||
parameters with new releases but no default. *) | ||
let _ = | ||
let new_param_has_default obj_name msg_name ps = |
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 think the "new parameter" could be defined as the ones whose release is larger than the release of its message/call.
Initially, the parameters (may be empty) of a message don't have default value defined as they are created with the message together. After that, adding new parameters will make all parameters as versioned_params
. To distinguish them, the version of the new parameters must be larger than the message itself.
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.
Yes, I totally agree that should be the proper way. But there are existing params that violate this way of checking, such as tunnel-create....
7ac6b2c
to
0416e2a
Compare
Also move the last function to Xapi_stdext. Signed-off-by: Vincent Liu <[email protected]>
Note we are only checking for default of new parameters in messages that already have default parameters. It lacks checks for new parameters added to messages with no default parameters, but there is no easy way to achieve that because the generator cannot tell what is new and what is not, moreover, there are existing messages with non-default parameters introduced in different releases. Signed-off-by: Vincent Liu <[email protected]>
Add new check for new parameters' default value
Note we are only checking for default of new parameters in messages
that already have default parameters.
It lacks checks for new parameters added to messages with no default
parameters, but there is no easy way to achieve that because the generator
cannot tell what is new and what is not, moreover, there are existing
messages with non-default parameters introduced in different releases.