Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-56387

Check optionalBool-typed IDL fields for backward compatibility

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.3.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible

      Followup to the "API Version Testing" epic, and to SERVER-55899. There are circumstances in which the "optionalBool" IDL type is preferable to the "bool" type with optional: true, for example in basic_types.idl:

      types:
          optionalBool:
              bson_serialization_type: any
              cpp_type: "mongo::OptionalBool"
              default: "mongo::OptionalBool()"
              deserializer: "mongo::OptionalBool::parseFromBSON"
              serializer: "mongo::OptionalBool::serializeToBSON"
      structs:
          Collation:
              fields:
                  backwards:
                      type: optionalBool 

      The bson_serialization_type for optionalBool is "any" in IDL, which disables a lot of idl_check_compatibility.py's semantic checks.

      Consider promoting optionalBool from a custom-defined IDL type to a first-class IDL type with well-known semantics, and update idl_check_compatibility.py to understand this type as well as it understands the "bool" type with optional: true.

      This work can be done after the Versioned API is released in 5.0. Past IDL definitions should still be valid and our backward compatibility rules will still apply, we'll just start interpreting IDL files differently when we check them.

            Assignee:
            romans.kasperovics@mongodb.com Romans Kasperovics
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: