[SERVER-60349] Make IDL compatibility checker allow addition of fields with type 'optionalBool' Created: 30/Sep/21 Updated: 29/Oct/23 Resolved: 10/Jan/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.3.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Arun Banala | Assignee: | Romans Kasperovics |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
The IDL compatibility checker currently disallows addition of new mandatory fields to API version 1 commands. The compatibility checker seemed to assume that 'optionalBool' is a mandatory field because we don't specify 'optional:true' in the field specification. But the 'optionalBool' as the name suggests is not a mandatory field and can be allowed. |
| Comments |
| Comment by Githook User [ 06/Jan/22 ] | |||
|
Author: {'name': 'Romans Kasperovics', 'email': 'romans.kasperovics@mongodb.com', 'username': 'romanskas'}Message: | |||
| Comment by Romans Kasperovics [ 22/Dec/21 ] | |||
|
Just a general observation: optionalBool is a bit controversial and confusing, because of the existence of the "optional" field in the IDL. In theory one can specify
If my understanding is correct, the main problem optionalBool is trying to solve is that the C++ representation of bool(optional) is still bool, which has only 2 value options. IMHO a more consistent alternative would be to automatically adding optional<...> to all C++ representations for optional: true and without default. | |||
| Comment by Kyle Suarez [ 19/Oct/21 ] | |||
|
According to sebastien.mendez, if we do |