Type check parameters in IDL compatibility checker script

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • Fully Compatible
    • Repl 2021-02-08, Repl 2021-02-22, Repl 2021-03-08
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      We should check that the type of each parameter in the new command is a superset of the type in the old command. This corresponds to the following pseudocode:

      old_type := old_param's type
      new_type := new_param's type
          
      assert old_type.bson_serialization_type != "any"
      assert new_type.bson_serialization_type != "any"
      
      # Assert new_type ⊇ old_type.
      if old_type is enum:
          assert new_type is enum
          assert new_type's values ⊇ old_type's values
      elif old_type is struct:
          assert new_type is struct
      else:
          assert new_type.bson_serialization_type ⊇ old_type.bson_serialization_type
      

            Assignee:
            Ali Mir
            Reporter:
            Samyukta Lanka
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: