THRIFT-6108: implemented exception documentation generation - #3666
THRIFT-6108: implemented exception documentation generation#3666SLAVONchick wants to merge 1 commit into
Conversation
| t_field* e = *e_iter; | ||
| std::string namespace_str = e->get_type()->get_program()->get_namespace(lang); | ||
|
|
||
| if (static_cast<std::string>(lang).compare("cpp") == 0) { |
There was a problem hiding this comment.
No, really, don't. We have OOP these days, like in "t_oop_generator", so we can use virtual methods to do such stuff.
PS: Pun intended - SCNR 🤣
There was a problem hiding this comment.
Totally agree, my bad. Fixed.
|
I like the idea. Would be glad to see this move forward. |
| #ifndef T_OOP_GENERATOR_H | ||
| #define T_OOP_GENERATOR_H | ||
|
|
||
| #include <boost/algorithm/string/replace.hpp> |
There was a problem hiding this comment.
IIRC we don't use boost in the compiler. Can this be replaced by sth else?
There was a problem hiding this comment.
Found identical implementations in several generators and left only one in base t_oop_generator.
Hi! Thank you for the review! I'm really looking forward to finish this work. |
| auto config = std::make_shared<TConfiguration>(TConfiguration::DEFAULT_MAX_MESSAGE_SIZE, kMaxFrameSize); | ||
| const int kMaxMessageSize = TConfiguration::DEFAULT_MAX_MESSAGE_SIZE; | ||
| auto config = std::make_shared<TConfiguration>(kMaxMessageSize, kMaxFrameSize); | ||
|
|
There was a problem hiding this comment.
Not sure how related that change is?
There was a problem hiding this comment.
Otherwise I get an error during compilation:
[ 48%] Linking CXX executable ../../../bin/TTransportFactoryConfigTest
/usr/bin/x86_64-linux-gnu-ld.bfd: CMakeFiles/TTransportFactoryConfigTest.dir/TTransportFactoryConfigTest.cpp.o: in function `test_framed_transport_factory_enforces_custom_max_frame_size::test_method()':
/home/slavonchick/repos/cpp/thrift-fork/lib/cpp/test/TTransportFactoryConfigTest.cpp:107:(.text+0x3959): undefined reference to `apache::thrift::TConfiguration::DEFAULT_MAX_MESSAGE_SIZE'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/cpp/test/CMakeFiles/TTransportFactoryConfigTest.dir/build.make:112: bin/TTransportFactoryConfigTest] Error 1
make[1]: *** [CMakeFiles/Makefile2:2415: lib/cpp/test/CMakeFiles/TTransportFactoryConfigTest.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
Although it works for me, I can delete this fix if necessary.
Code reviewFound 5 issues:
thrift/compiler/cpp/src/thrift/generate/t_javame_generator.cc Lines 188 to 192 in b3754d4 Worth fixing together with this: javame's
thrift/compiler/cpp/src/thrift/generate/t_oop_generator.h Lines 112 to 121 in b3754d4
thrift/compiler/cpp/src/thrift/generate/t_py_generator.cc Lines 2774 to 2780 in b3754d4
thrift/compiler/cpp/src/thrift/generate/t_oop_generator.h Lines 118 to 122 in b3754d4
thrift/lib/cpp/test/TTransportFactoryConfigTest.cpp Lines 106 to 109 in b3754d4 On the design, separately from the defects above: thrift/compiler/cpp/src/thrift/generate/t_oop_generator.h Lines 39 to 45 in b3754d4 Making it pure virtual obliges all 18 The bigger issue is that the abstraction doesn't fit its users: four of the six That string also already exists in the compiler, in one place. thrift/compiler/cpp/src/thrift/generate/t_generator_registry.h Lines 96 to 104 in b3754d4 and thrift/compiler/cpp/src/thrift/parse/t_program.h Lines 297 to 306 in b3754d4 Keeping 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
8f2772e to
b80a146
Compare
Code reviewThe Found 4 issues:
thrift/compiler/cpp/src/thrift/generate/t_oop_generator.h Lines 117 to 119 in b80a146
thrift/compiler/cpp/src/thrift/generate/t_oop_generator.h Lines 39 to 43 in b80a146
thrift/compiler/cpp/src/thrift/generate/t_oop_generator.h Lines 112 to 119 in b80a146
thrift/compiler/cpp/src/thrift/generate/t_py_generator.cc Lines 2734 to 2737 in b80a146 thrift/compiler/cpp/src/thrift/generate/t_py_generator.cc Lines 2774 to 2778 in b80a146 Three suggestions, below the bar for the list above but verified:
thrift/compiler/cpp/src/thrift/generate/t_javame_generator.cc Lines 3059 to 3062 in b80a146
thrift/compiler/cpp/src/thrift/generate/t_kotlin_generator.cc Lines 176 to 185 in b80a146
thrift/compiler/cpp/src/thrift/generate/t_py_generator.cc Lines 2775 to 2778 in b80a146 One design observation, no action needed for this PR: a base default that reads 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
|
FYI I extracted the |
Yeah, thanks! Really appreciate that. |
Client: cpp,haxe,java,javame,kotlin,netstd,py
Client: cpp,haxe,java,javame,kotlin,netstd,py
In this PR I've implemented the documentation generation of the exceptions thrown in the service methods.
I skipped the clients where there is no documentation is generated at all, so it only touched cpp,haxe,java,netstd,py.
[skip ci]anywhere in the commit message to free up build resources. - Does involve code.