711 Commits

Author SHA1 Message Date
yuanweiz
20d4f1b233 [bzlmod] Avoid hard-coding workspace name so C++ DNS tests can build. (#41355)
Adapted from PR #40420

The original author left team and the PR couldn't be merged due to CLA check.
<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #41355

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/41355 from yuanweiz:workspace adb60674979a5d722f45e13e7c75291f22722f41
PiperOrigin-RevId: 853745450
2026-01-08 08:07:55 -08:00
Rishesh Agarwal
09218ae889 Adding layering_check and parse_headers in test files (#41226)
Closes #41226

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/41226 from rishesh007:layering_test 02e735767f22e934850d5e150c5e3d577bdfbecb
PiperOrigin-RevId: 844606259
2025-12-14 23:05:28 -08:00
Atan Bhardwaj
8070efca37 Refactor proto_reflection_descriptor_database in util to use absl::flat_hash_map and absl::flat_hash_set instead of std::unordered_map and std::unordered_set for potential performance improvements. This also involves including the necessary absl headers and updating the BUILD file.
Replace `.insert()` with `.emplace()` for `missing_symbols_` in
`proto_reflection_descriptor_database.cc.`

PiperOrigin-RevId: 831644658
2025-11-12 19:35:44 -08:00
Craig Tiller
339906443b [clang-format] Match include file ordering to internal clang-format (#40905)
gRPC is currently getting formatted with two different clang-format implementations, and due to some weirdness they have different include file orderings. This change introduces clang-format configuration to ensure that the two systems align - it's *highly* expected that this will need some maintenance going forward as the two systems evolve.

Closes #40905

PiperOrigin-RevId: 819606209
2025-10-15 00:24:11 -07:00
Rishesh Agarwal
ecb1d4a9b7 This PR adds the missing dependencies src/core:grpc_check and :channel_arg_names to the relevant parts of the codebase
PiperOrigin-RevId: 814622149
2025-10-03 03:29:30 -07:00
Craig Tiller
17d3a0540c Cleanup visibility
PiperOrigin-RevId: 814347756
2025-10-02 12:54:14 -07:00
Yousuk Seung
6dc7ff1d0f Internal change
PiperOrigin-RevId: 813969629
2025-10-02 19:21:18 +00:00
Yousuk Seung
238bcb0690 Internal change
PiperOrigin-RevId: 813931069
2025-10-02 19:19:55 +00:00
Adam Heller
f5ffef4d6b [test] Add PostMortem dumps on CHECK failures in test builds (#39945)
See `grpc_check.h`. This code  redefines the abseil `CHECK*` macros using custom gRPC macros when building tests. In `bazel test ...` builds, on check failure, `PostMortemEmit()` will dump state to the log before crashing.

Caveat: to prevent circular dependencies, code that `postmortem` relies on cannot use the custom gRPC CHECK macros. This is not much code, ~50 source files. grep for the `absl/log:check` bazel dependency.

Closes #39945

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/39945 from drfloob:grpc_check ca8e46718f2021e0df79aa67a3a0b0c751b3ce44
PiperOrigin-RevId: 807452496
2025-09-15 17:43:19 -07:00
Rishesh Agarwal
ed7eaa5e54 update deps for eventmanager's build
PiperOrigin-RevId: 802499797
2025-09-03 04:40:04 -07:00
Rishesh Agarwal
931969b868 Update microbenchmarks, cpp/util deps for layering_check and parse_headers
PiperOrigin-RevId: 802413253
2025-09-02 23:00:40 -07:00
Rishesh Agarwal
1b5bbc31f2 [build] Add Missing Dependencies for channel_stack_test, minimal_stack_is_minimal_test, server_call_tracer_factory_test, channelz_test, channelz_registry_test, channel_trace_fuzzer, data_test, entity_test, channel_trace_proto_helper in Preparation for Enabling layering_check
PiperOrigin-RevId: 798130475
2025-08-22 02:48:51 -07:00
Rishesh Agarwal
e2640c46d1 [build] Add Missing Dependencies for test/cpp/interop, test/cpp/server, test/cpp/thread_manager, test/cpp/util in Preparation for Enabling layering_check
PiperOrigin-RevId: 797690724
2025-08-21 03:36:51 -07:00
Rishesh Agarwal
b0df7636da [build] Add Missing Dependencies for grpcpp_status, generic_stub_internal, grpc++_codegen_proto, grpc++_base in Preparation for Enabling layering_check
PiperOrigin-RevId: 797686218
2025-08-21 03:20:00 -07:00
Rishesh Agarwal
d88bb5ecda [build] Add Missing Dependencies for grpc_cli_utils in Preparation for Enabling layering_check
PiperOrigin-RevId: 797271223
2025-08-20 05:23:18 -07:00
Rishesh Agarwal
7d6ee34879 [build] Add Missing Dependencies for oauth2_utils, timer, server, fake_stats_plugin, fail_first_call_filter, interceptors_util, test_util in Preparation for Enabling layering_check
PiperOrigin-RevId: 796732408
2025-08-18 23:44:17 -07:00
Rishesh Agarwal
89fbd793f3 Update gmock include paths in gRPC tests.
PiperOrigin-RevId: 796378960
2025-08-18 05:17:50 -07:00
gRPC Team Bot
7a3bd01aab Add #include <memory> to BoringSSL headers to make them work with Windows SDK.
PiperOrigin-RevId: 788089515
2025-07-28 11:31:37 -07:00
Craig Tiller
c675ef8859 Automated rollback of commit a9796dbe6f.
PiperOrigin-RevId: 786454401
2025-07-24 15:15:36 +00:00
gRPC Team Bot
a9796dbe6f Rollback channelz v2tov1 related changes due to multiple breakages
PiperOrigin-RevId: 786098574
2025-07-22 19:55:52 -07:00
Craig Tiller
f8a881fa6c Reland channelz v2tov1 features
Includes:
- An experiment for the v1 service, start using only the v2 api from channelz, and downgrade using the conversion library.
- An experiment to move the C APIs that wrapped languages can use to implement channelz v1.
PiperOrigin-RevId: 786039931
2025-07-22 19:54:03 -07:00
Craig Tiller
9ad02e32d8 Rollback channelz v2tov1 related changes
PiperOrigin-RevId: 784242817
2025-07-17 11:02:35 -07:00
Craig Tiller
608e516b60 [channelz] Move legacy apis to use v2->v1
We have a set of C APIs that wrapped languages can use to implement channelz v1.
Migrate these to use the conversion library, and isolate them into a new file.

An experiment is added so we can do a gradual rollout.

PiperOrigin-RevId: 783581214
2025-07-15 20:48:27 -07:00
Craig Tiller
e99ffb02ac [channelz] Update channelz v1 to be just one proto rule
The prior change I made leads to a bunch of ODR problems

PiperOrigin-RevId: 783540046
2025-07-15 18:08:46 -07:00
Craig Tiller
db6ed7f460 Automated rollback of commit b511685341.
PiperOrigin-RevId: 777624736
2025-06-30 10:26:28 -07:00
Craig Tiller
b511685341 Add #include <memory> to BoringSSL headers to make them work with Windows SDK.
PiperOrigin-RevId: 776832412
2025-06-27 21:24:36 -07:00
Eugene Ostroukhov
cad1d0eef7 [event_engine] Event engine fork support (#38980)
Closes #38980

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38980 from eugeneo:fork/11-can-tests-pass e17cafed76c0068029c666f260d59f9d7dd50dd5
PiperOrigin-RevId: 766759188
2025-06-03 11:53:50 -07:00
Craig Tiller
5be83a23f3 [channelz] List v1 channel stack filters (#39360)
Closes #39360

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/39360 from ctiller:ch 07c1ffcff759273728075fd6f3373a84b83772fd
PiperOrigin-RevId: 751244641
2025-04-24 20:19:56 -07:00
Craig Tiller
536094c533 Update visibility system to use package groups
PiperOrigin-RevId: 742299420
2025-03-31 09:55:04 -07:00
Craig Tiller
a9ab859b4b Internal change
PiperOrigin-RevId: 733593119
2025-03-04 22:48:27 -08:00
Craig Tiller
66a137f1d7 [sanity] Restore it (#38869)
Closes #38869

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38869 from ctiller:nubbins 972d734cdf45a4786de53c51b2ce8cf97a3d38ff
PiperOrigin-RevId: 731570368
2025-02-26 21:26:56 -08:00
Craig Tiller
07188632f4 Tiny formatting cleanups for portability
PiperOrigin-RevId: 731512282
2025-02-26 17:22:27 -08:00
Mark D. Roth
076d5076c6 [reorg] move security base APIs and credential code to new locations (#38825)
This includes the following moves from src/core/lib/security:
- certificate_provider/* → src/core/credentials/transport/tls/
- context/* → split between src/core/call/security_context* and src/core/transport/auth_context*
- credentials/
  - composite/ → split between src/core/credentials/call/composite/ and src/core/credentials/transport/composite/
  - alts, google_default, insecure, local, ssl, tls, xds → src/core/credentials/transport/
  - fake/ → split between test/core/test_util/test_call_creds* and src/core/credentials/transport/fake
  - external, iam, jwt, oauth2, plugin, token_fetcher → src/core/credentials/call/
  - call_creds_utils.* → src/core/credentials/call/
  - channel_creds_registry* → src/core/credentials/transport/
  - credentials.* → split between src/core/credentials/call/call_credentials.* and src/core/credentials/transport/transport_credentials.*
- security_connector/
  - alts, fake, insecure, local, ssl, tls → src/core/credentials/transport/
  - security_connector* → src/core/credentials/transport/
  - ssl_utils*, load_system_roots* → src/core/credentials/transport/tls/
- transport/ → src/core/filter/auth/
- util/* → src/core/credentials/call/

The only thing left in src/core/lib/security is the authz code, which I will move in a separate PR.

I have also moved the tests from test/core/security into a similar structure.  Some specific notes:
- I have removed print_google_default_creds_token.cc, since it does not appear in any build file and appears to be completely unused.
- I moved secure_endpoint_test.cc to test/core/handshaker, to match where the implementation lives in the tree.

Closes #38825

PiperOrigin-RevId: 731487339
2025-02-26 16:01:37 -08:00
Craig Tiller
bc69c776b6 Tag some internal build state
PiperOrigin-RevId: 731470686
2025-02-26 15:15:27 -08:00
Craig Tiller
aebdfbe6ea Tag some internal build state
PiperOrigin-RevId: 731469858
2025-02-26 15:09:58 -08:00
Craig Tiller
684662351a Tag some internal build state
PiperOrigin-RevId: 731469422
2025-02-26 15:08:31 -08:00
Craig Tiller
36c1414200 Internal change
PiperOrigin-RevId: 731468523
2025-02-26 15:04:15 -08:00
Yash Tibrewal
c637de558a [Cleanup] Avoid std::make_pair (#38636)
Maybe in some of these cases, `{}` would work instead of `std::pair`, but I'm just doing a simple find and replace here.

Closes #38636

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38636 from yashykt:NoMakePair d819f6a74be2fb2859083436297f79ed3139a1b7
PiperOrigin-RevId: 722772621
2025-02-03 13:19:08 -08:00
Craig Tiller
725d1eea73 [build] Remove language tag from BUILD files (#38501)
This is only ever set to C++, so removing it from bazel.

There are remnants left in cmakefile generation that I'm not planning on cleaning up (looked like some of the yaml/python pieces still use this)

Closes #38501

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38501 from ctiller:language c8aee06a01a449483b7585a367ff793fde47f68a
PiperOrigin-RevId: 718198572
2025-01-21 21:13:44 -08:00
AJ Heller
478b4c0fba [C++17] Replace absl::optional with std::optional (#38420)
Closes #38420

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38420 from drfloob:cpp17-optional 7f276aaa3c493a2ea7f4f1766da975e083914a5b
PiperOrigin-RevId: 715081837
2025-01-13 13:13:38 -08:00
Esun Kim
2aa4aa2b9c [Test] Fix error_details_test (#38233)
This test incorrectly assumes that a gRPC status of OK can include Status-Details.  However, according to https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md, Status-Details are not permitted when the Status is OK. To align this test with the specification, we should remove the test case that checks for Status-Details with an OK status.  

Closes #38233

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38233 from veblush:status-details 706693f91a848f7bf58770d3b9cdd083f366af28
PiperOrigin-RevId: 704453063
2024-12-09 16:18:48 -08:00
Mark D. Roth
d60ebf710b [xDS e2e tests] use real xDS protos
This removes all xDS protos except for 5 of them that have services.  We still have some limitations in our internal build system that make it hard to use the real xDS protos for those files, but we're now using the real xDS protos for the rest.

(Note: discovery.proto is actually a special case.  While it does have services, we don't actually use those services, so that's not the reason we need a copy of this file.  Unfortunately, the xDS BUILD files group discovery.proto into the same build target as ads.proto, which has services that we actually use, thus requiring us to have our own copy.  This means that depending on the real discovery.proto causes us to also depend on the real ads.proto, which causes a conflict in the protobuf registry by linking two copies of ads.proto.  However, we *are* using the real discovery.proto in unit tests, which do not depend on ads.proto.)

PiperOrigin-RevId: 693907782
2024-11-06 16:46:20 -08:00
Esun Kim
6a0c483bea [CI] Upgraded clang to 19 for sanity tests (#38070)
This change upgrades the sanity test to use Clang 19, including clang-format and clang-tidy. (It's a partial implementation of the changes proposed in #38038)

Key updates:
- Docker images now utilize Clang 19.
- Code has been reformatted using the updated clang-format.
- Resolved `readability-math-missing-parentheses` warnings raised by clang-tidy.

Note that the other part of the clang-19 upgrade, "using clang-19 for C++ test" will be done once opentelemetry-cpp fixes the clang-19 build error.

Closes #38070

PiperOrigin-RevId: 693833548
2024-11-06 13:04:41 -08:00
Mark D. Roth
5011420f16 [proto] revert to old-style BUILD rules for channelz and reflection
PiperOrigin-RevId: 693522142
2024-11-05 16:53:45 -08:00
Lev Kandel
dfdda9eb9d Prepare code for breaking change in Protobuf C++ API.
Protobuf 6.30.0 will change the return types of Descriptor::name() and other methods to absl::string_view. This makes the code work both before and after such a change.

PiperOrigin-RevId: 692216341
2024-11-01 10:14:11 -07:00
Mark D. Roth
55b1ae9700 [build] replace grpc_proto_library rules with separate proto_library/cc_proto_library/cc_grpc_library rules (#37943)
Closes #37943

PiperOrigin-RevId: 691538475
2024-10-30 13:45:41 -07:00
Nathan Baulch
b2a05bebe0 [maintenance] Fix cpp typos (#37755)
Continuation of #37541 but focused on C++.

Closes #37755

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37755 from NathanBaulch:typos-cpp 9a7fd9d65fa97a689d529772534df1a501031e9f
PiperOrigin-RevId: 684600898
2024-10-10 15:37:18 -07:00
Craig Tiller
dbb5164ac7 [clang-format] Remove custom clang-format rules for include ordering (#37820)
Closes #37820

PiperOrigin-RevId: 682352913
2024-10-04 09:44:20 -07:00
Mark D. Roth
f6c57b6384 [reorg] move a bunch of stuff to src/core/util (#36792)
The following files have been moved:
- src/core/lib/avl/*
- src/core/lib/backoff/*
- src/core/lib/debug/event_log*
- src/core/lib/iomgr/gethostname*
- src/core/lib/iomgr/grpc_if_nametoindex*
- src/core/lib/matchers/*
- src/core/lib/uri/* (renamed from uri_parser.* to uri.*)
- src/core/lib/gprpp/* (existing src/core/util/time.cc was renamed to gpr_time.cc to avoid conflict)

Closes #36792

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36792 from markdroth:reorg_util d4e8996f481c611ffbb06a8b04924ff81bc1bc2b
PiperOrigin-RevId: 676947640
2024-09-20 13:19:02 -07:00
Nathan Baulch
bdf52dd4ad Fix more minor typos (#37541)
Just thought I'd contribute some more typo fixes I've stumbled upon. This is a followup on #37450.

Use the following command to get a quick and dirty summary of the specific corrections made:
```shell
git diff HEAD^! --word-diff-regex='\w+' -U0 \
  | grep -E '\[\-.*\-\]\{\+.*\+\}' \
  | sed -r 's/.*\[\-(.*)\-\]\{\+(.*)\+\}.*/\1 \2/' \
  | sort | uniq -c | sort -n
```

FWIW, the top typos are:
* compressable (134)
* existant (82)
* unparseable (49)
* occured (24)
* replys (18)
* validing (17)
* writter (16)
* vaidate (9)
* directoty (8)
* convertabl (8)
* atrributes (8)
* indxes (8)
* transfered (7)
* exchage (7)
* descedent (6)
* enpoint (6)
* nonexistant (6)
* matadata (6)
* addtional (5)
* callack (5)
* experenced (5)
* wil (5)

Closes #37541

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37541 from NathanBaulch:typos 7cbfc121ed0bb5ac75e2dba3ade0d9a62c39c93d
PiperOrigin-RevId: 675772876
2024-09-17 17:46:13 -07:00