[SERVER-40426] Unable to add validators for fields of type `array` Created: 01/Apr/19  Updated: 29/Oct/23  Resolved: 18/Apr/19

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 4.1.11

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Mark Benvenuto
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Dev Tools 2019-04-22
Participants:

 Description   

Adding a validator to this type leads to the following error from the IDL compiler:

E:\workspace\mongo>ninja build\ninja\mongo\db\s\transaction_coordinator_test.exe
[1/12] C:\Python27\python.exe buildscripts/idl/idlc.py --include src --base_dir build/ninja --target_arch x86_64 --header build\ninja\mongo...d\ninja\mongo\db\commands\txn_two_phase_commit_cmds_gen.cpp src\mongo\db\commands\txn_two_phase_commit_cmds.idl --write-dependencies-inline
FAILED: build/ninja/mongo/db/commands/txn_two_phase_commit_cmds_gen.h
C:\Python27\python.exe buildscripts/idl/idlc.py --include src --base_dir build/ninja --target_arch x86_64 --header build\ninja\mongo\db\commands\txn_two_phase_commit_cmds_gen.h --output build\ninja\mongo\db\commands\txn_two_phase_commit_cmds_gen.cpp src\mongo\db\commands\txn_two_phase_commit_cmds.idl --write-dependencies-inline
Traceback (most recent call last):
  File "buildscripts/idl/idlc.py", line 99, in <module>
    main()
  File "buildscripts/idl/idlc.py", line 92, in main
    success = idl.compiler.compile_idl(compiler_args)
  File "E:\workspace\mongo\buildscripts\idl\idl\compiler.py", line 221, in compile_idl
    header_file_name, source_file_name)
  File "E:\workspace\mongo\buildscripts\idl\idl\generator.py", line 2368, in generate_code
    _generate_header(spec, header_file_name)
  File "E:\workspace\mongo\buildscripts\idl\idl\generator.py", line 2334, in _generate_header
    str_value = generate_header_str(spec)
  File "E:\workspace\mongo\buildscripts\idl\idl\generator.py", line 2325, in generate_header_str
    header.generate(spec)
  File "E:\workspace\mongo\buildscripts\idl\idl\generator.py", line 1009, in generate
    self.gen_validators(field)
  File "E:\workspace\mongo\buildscripts\idl\idl\generator.py", line 633, in gen_validators
    if not cpp_types.is_primitive_type(param_type):
  File "E:\workspace\mongo\buildscripts\idl\idl\cpp_types.py", line 75, in is_primitive_type
    cpp_type = cpp_type.replace(' ', '')
AttributeError: 'NoneType' object has no attribute 'replace'
[2/12] Checking error codes and waiting for next compile to finish
ninja: build stopped: subcommand failed.



 Comments   
Comment by Githook User [ 18/Apr/19 ]

Author:

{'name': 'Mark Benvenuto', 'username': 'markbenvenuto', 'email': 'mark.benvenuto@mongodb.com'}

Message: SERVER-40426 Extend IDL Validators for more types and structs
Branch: master
https://github.com/mongodb/mongo/commit/063d5ff4589aba211f7c6eaea2b180f29a752cd2

Comment by Gregory McKeon (Inactive) [ 02/Apr/19 ]

mark.benvenuto

Generated at Thu Feb 08 04:54:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.