fix: Restore clang-tidy change to section name in config - #7091
Conversation
There was a problem hiding this comment.
Pull request overview
This PR restores the expected configuration key name used by the gRPC server’s [port_grpc] config parsing, reverting a prior clang-tidy-driven rename from secure_gateway to secureGateway.
Changes:
- Update gRPC config parsing to read
secure_gateway(snake_case) instead ofsecureGateway(camelCase).
Comments suppressed due to low confidence (1)
src/xrpld/app/main/GRPCServer.cpp:390
Section::get()does an exact key lookup (no aliasing/normalization). Switching this tosecure_gatewaywill break existing configs/tests that setsecureGateway(e.g. envconfig adds(*cfg)[SECTION_PORT_GRPC].set("secureGateway", ...)). Consider accepting both keys (e.g. look upsecure_gatewaythen fall back tosecureGateway, or vice-versa with a deprecation path) to preserve backward compatibility. Also the error/log strings below still refer to the "secureGateway section" even though the config key is nowsecure_gateway.
auto const optSecureGateway = section.get("secure_gateway");
if (optSecureGateway)
{
try
{
std::stringstream ss{*optSecureGateway};
std::string ip;
while (std::getline(ss, ip, ','))
{
boost::algorithm::trim(ip);
auto const addr = boost::asio::ip::make_address(ip);
if (addr.is_unspecified())
{
JLOG(journal_.error()) << "Can't pass unspecified IP in "
<< "secureGateway section of port_grpc";
Throw<std::runtime_error>("Unspecified IP in secureGateway section");
}
secureGatewayIPs_.emplace_back(addr);
}
}
catch (std::exception const&)
{
JLOG(journal_.error()) << "Error parsing secure gateway IPs for grpc server";
Throw<std::runtime_error>("Error parsing secureGateway section");
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #7091 +/- ##
=========================================
- Coverage 82.1% 82.1% -0.0%
=========================================
Files 1010 1010
Lines 76023 76023
Branches 7372 7368 -4
=========================================
- Hits 62403 62400 -3
- Misses 13620 13623 +3
🚀 New features to boost your workflow:
|
Tests should have caught most things and AI did a good job finding those too during the rename PR. We will make sure nothing bad remains before these changes go into release 👍 |
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
High Level Overview of Change
This change restores a bad clang-tidy change in a config section.
Context of Change
In #6571 the config section get call was changed from
secure_gatewaytosecureGateway. This PR restores the name.