summaryrefslogtreecommitdiff
path: root/buildscripts/idl/idl_compatibility_errors.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildscripts/idl/idl_compatibility_errors.py')
-rw-r--r--buildscripts/idl/idl_compatibility_errors.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/buildscripts/idl/idl_compatibility_errors.py b/buildscripts/idl/idl_compatibility_errors.py
index 94b63ab7466..da19af30328 100644
--- a/buildscripts/idl/idl_compatibility_errors.py
+++ b/buildscripts/idl/idl_compatibility_errors.py
@@ -66,6 +66,8 @@ ERROR_ID_NEW_COMMAND_TYPE_NOT_STRUCT = "ID0022"
ERROR_ID_NEW_COMMAND_TYPE_NOT_ENUM = "ID0023"
ERROR_ID_NEW_COMMAND_TYPE_ENUM_OR_STRUCT = "ID0024"
ERROR_ID_MISSING_ERROR_REPLY_STRUCT = "ID0025"
+ERROR_ID_NEW_REPLY_FIELD_VARIANT_TYPE = "ID0026"
+ERROR_ID_NEW_REPLY_FIELD_VARIANT_TYPE_NOT_SUBSET = "ID0027"
class IDLCompatibilityCheckerError(Exception):
@@ -361,6 +363,25 @@ class IDLCompatibilityContext(object):
"'%s' has an unstable reply field '%s' that was stable in the old command." %
(command_name, field_name), file)
+ def add_new_reply_field_variant_type_error(self, command_name: str, field_name: str,
+ new_field_type: str, old_field_type: str,
+ file: str) -> None:
+ # pylint: disable=too-many-arguments
+ """Add an error about the new reply field type being variant when the old one is not."""
+ self._add_error(
+ ERROR_ID_NEW_REPLY_FIELD_VARIANT_TYPE, command_name,
+ ("'%s' has a reply field '%s' of type '%s' that is variant while the corresponding "
+ "old reply field type '%s' is not.") % (command_name, field_name, new_field_type,
+ old_field_type), file)
+
+ def add_new_reply_field_variant_type_not_subset_error(self, command_name: str, field_name: str,
+ type_name: str, file: str) -> None:
+ # pylint: disable=too-many-arguments
+ """Add an error about the new reply field variant types not being a subset of the old variant types."""
+ self._add_error(ERROR_ID_NEW_REPLY_FIELD_VARIANT_TYPE_NOT_SUBSET, command_name, (
+ "'%s' has a reply field '%s' with variant alternative type '%s' that is not a subset of the corresponding "
+ "old reply field type") % (command_name, field_name, type_name), file)
+
def add_old_command_type_bson_any_error(self, command_name: str, old_type: str,
file: str) -> None:
"""Add an error about the old command type's bson serialization type being of type "any"."""