- Notifications
You must be signed in to change notification settings - Fork 14
refactor: Migrate away from grpc_utils namespace #1266
Conversation
| database_admin_->CreateDatabase(&client_context, request, &response); | ||
| if (!status.ok()) { | ||
| return google::cloud::grpc_utils::MakeStatusFromRpcError(status); | ||
| return MakeStatusFromRpcError(status); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, these unqualified calls to MakeStatusFromRpcError() will use ADL. That may be OK. but qualifying them with google::cloud:: would avoid the ADL and make their location clear. It was previously not using ADL. Not a huge deal either way.
I'll let you decide if you'd like to change anything.
Codecov Report
@@ Coverage Diff @@ ## master #1266 +/- ## ========================================== - Coverage 94.85% 94.85% -0.01% ========================================== Files 181 181 Lines 13794 13793 -1 ========================================== - Hits 13084 13083 -1 Misses 710 710
Continue to review full report at Codecov.
|
| google/cloud/spanner/internal/database_admin_stub.cc, line 49 at r1 (raw file): Previously, devjgm (Greg Miller) wrote…
Blah. I'm happy to go either way as long as we're consistent - LMK what you think. Some calls (in other files) were already using |
devjgm left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 13 files reviewed, all discussions resolved (waiting on @coryan and @devbww)
google/cloud/spanner/internal/database_admin_stub.cc, line 49 at r1 (raw file):
Previously, mr-salty (Todd Derr) wrote…
Blah. I'm happy to go either way as long as we're consistent - LMK what you think.
Some calls (in other files) were already using
grpc_utils::MakeStatusFromRpcError()which turned into an unqualified call in this CL, so I decided to make them all look the same - but I didn't consider ADL, I was only thinking about the enclosing namespace::google::cloud.
I'm happy with whatever you decide. I don't know if we have or need a hard rule for this. In general, I think the heuristic that I tend to use is that an unqualified function call is likely defined in the same file or at least the same namespace as what I'm calling. But if the function is in some other namespace, I'd expect some namespace qualification. I would probably perl -p -i -e 's,MakeStatusFromRpcError,google::cloud::MakeStatusFromRpcError,g' **.{h,cc} in this case. But if that makes things too inconsistent with other things we're doing, then I'm happy to go w/ consistency until we decide otherwise.
Up to you. Whatever LGTM.
| google/cloud/spanner/internal/database_admin_stub.cc, line 49 at r1 (raw file): Previously, devjgm (Greg Miller) wrote…
Having been bitten before by ADL with make_unique<>, I'll change it. I think we should have a guideline, just for the sake of consisistency - in the old code we were mixing the two, even within the same file. Of course without a clang-tidy it's going to be easy to do that again. I don't see a clang-tidy about ADL, I wonder if such a thing would be feasible to do and useful, or if it would have too many false positives - it would probably have to be disabled for operators at least. |
…-cloud-cpp-spanner#1266) * refactor: Migrate away from `grpc_utils` namespace * qualify uses of `MakeStatusFromRpcError`
Fixes #1261
This change is