From a0ca5d4dd4e45bb6c5a1cae17c9ced8c6990c5f1 Mon Sep 17 00:00:00 2001 From: Gregory Wlodarek Date: Tue, 21 Dec 2021 14:20:50 +0000 Subject: SERVER-62187 Add a way to ignore API changes for released fields in earlier versions that are behind a disabled feature flag --- buildscripts/idl/idl_check_compatibility.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/buildscripts/idl/idl_check_compatibility.py b/buildscripts/idl/idl_check_compatibility.py index d62fa30c3d4..7cd8a7c1324 100644 --- a/buildscripts/idl/idl_check_compatibility.py +++ b/buildscripts/idl/idl_check_compatibility.py @@ -160,6 +160,14 @@ ALLOW_ANY_TYPE_LIST: List[str] = [ 'getMore-reply-invalidated', ] +# Do not add user visible fields already released in earlier versions. +IGNORE_UNSTABLE_LIST: List[str] = [ + # The 'originalSpec' field was introduced in v5.1 behind a disabled feature flag and is not user + # visible. This is part of the listIndexes output when executed against system.bucket.* + # collections, which users should avoid doing. + 'listIndexes-reply-originalSpec', +] + SKIPPED_FILES = ["unittest.idl"] @@ -474,7 +482,8 @@ def check_reply_field(ctxt: IDLCompatibilityContext, old_field: syntax.Field, """Check compatibility between old and new reply field.""" # pylint: disable=too-many-arguments if not old_field.unstable: - if new_field.unstable: + field_name: str = cmd_name + "-reply-" + new_field.name + if new_field.unstable and field_name not in IGNORE_UNSTABLE_LIST: ctxt.add_new_reply_field_unstable_error(cmd_name, new_field.name, new_idl_file_path) if new_field.optional and not old_field.optional: ctxt.add_new_reply_field_optional_error(cmd_name, new_field.name, new_idl_file_path) -- cgit v1.2.1