-
Notifications
You must be signed in to change notification settings - Fork 10
deps: update protobuf to 30.2 and grpc to 1.72.0 #303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deps: update protobuf to 30.2 and grpc to 1.72.0 #303
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThis update comprehensively regenerates all protobuf-generated C++ code and headers in the project to align with Protobuf C++ runtime version 6.30.2. The changes modernize code style, memory management, thread-safety annotations, arena allocation, internal APIs, and metadata/reflection support. Numerous files also add gRPC port definition includes for platform compatibility. Additionally, minor fixes were made in Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant gRPC_Server
participant ProtobufMessage
Client->>gRPC_Server: Send request with ProtobufMessage
gRPC_Server->>ProtobufMessage: Deserialize message (arena-aware)
ProtobufMessage-->>gRPC_Server: Message object with presence bits, reflection, etc.
gRPC_Server->>ProtobufMessage: Serialize response (arena-aware)
ProtobufMessage-->>gRPC_Server: Serialized bytes
gRPC_Server-->>Client: Send response
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
3685f5c to
1d8bbe4
Compare
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.
Actionable comments posted: 5
♻️ Duplicate comments (3)
agents/grpc/src/proto/metrics.pb.cc (1)
2-4: Generated code committed – verify consistency with build processSame banner/policy mismatch as in
nsolid_service.pb.cc. Before this lands onmain, please clarify whether the project now intends to vendor generated protobuf C++ sources. If not, drop the commit or move code-gen to the CI pipeline.Duplicated reasoning as above.
agents/grpc/src/proto/packages.pb.cc (1)
2-4: Generated.pb.ccis checked in despite “NO CHECKED-IN PROTOBUF GENCODE”Confirm that committing these files is deliberate. If accidental, regenerate during the build instead and keep the repository lean. Otherwise, strip the banner to avoid confusing future contributors.
agents/grpc/src/proto/metrics.pb.h (1)
2-4: Large generated header checked in – same policy concernSame as for
command.pb.cc: the guard comment forbids committing generated code. Unless there is a clear, documented reason, treat these files as build artefacts.If they must stay, add them to
.gitattributeswith:*.pb.h linguist-generated *.pb.cc linguist-generatedto silence code-review tooling.
🧹 Nitpick comments (8)
agents/grpc/src/proto/common.pb.cc (2)
2-5: *Consider omitting generated .pb.cc from VCS.The header comment still reads “NO CHECKED-IN PROTOBUF GENCODE”, yet the file is committed.
Keeping several megabytes of generated artefacts in the repo can:
• Inflate repository size.
• Create noisy diffs every time protoc is re-run.
• Create merge conflicts when multiple branches regenerate code with different plugin versions.If distribution of generated code is strictly required (e.g., to avoid requiring
protocin consumer environments), please add a short note toCONTRIBUTING.mdexplaining the rationale and the exact protoc/grpc/protobuf versions so future contributors regenerate with the same tool-chain.
175-184: Descriptor blob size jumped – confirm size-related warnings.The literal descriptor array grew to ~250 bytes. Some tool-chains warn when string literals exceed certain limits in a single translation unit (rare on modern compilers but happens in embedded builds).
If your targets include very small devices, consider moving large descriptor blobs to a dedicated.cccompiled with relaxed warnings, or enable--descriptor_set_out+reflection-less builds.agents/grpc/src/proto/nsolid_service.pb.cc (1)
2-4: Commit contradicts in-file banner – confirm policy for generated codeThe header still states
// NO CHECKED-IN PROTOBUF GENCODE, yet the file is being committed. If your repository’s policy is to rebuild.pb.cc/.pb.hduring the build, checking-in generated artefacts can cause merge noise, stale code, and version skew with the tool-chain (protobuf 6.30.2 vs future regenerations).Consider either
- removing the banner and intentionally version-controlling generated code, or
- adding these files to
.gitignore/CMakeListsso they are produced at build-time only.Feel free to ping me if you want a sample CMake rule that regenerates the sources.
agents/grpc/src/proto/common.pb.h (1)
6-7: Include-guard name collides with previous generator output
#define common_2eproto_2epb_2ehis identical to the guard produced by the older generator.
If any previously-generated header with the same name but different content still exists in the include-path, the first one wins silently, leading to ODR/ABI mismatches.Consider adding a per-generator timestamp or out-of-tree include path (e.g.,
generated/v6_30_2/...) to avoid collisions.agents/grpc/src/proto/metrics.pb.h (1)
14-19: Hard version pinning may break downstream package managersPinning to an exact micro-version (
6030002) means any patch release of protobuf will break your build. If reproducibility is the goal, lock the compiler via CI tooling rather than pre-processor guards, or relax the check to the major/minor pair:-#if PROTOBUF_VERSION != 6030002 +#if PROTOBUF_VERSION / 100 != 60300 /* accept 6.30.x */agents/grpc/src/proto/asset.pb.h (1)
2-4: Generated code contradicts the “NO CHECKED-IN PROTOBUF GENCODE” bannerThe header explicitly says no protobuf gencode should be checked-in, yet the file is committed. Keeping generated artifacts in VCS bloats the repo, clutters reviews, and often falls out of sync with the
.protosources.Consider adding the
agents/grpc/src/proto/*.pb.{h,cc}patterns to.gitignoreand generating them in the build pipeline instead.agents/grpc/src/proto/exit.pb.h (1)
2-4: Same concern: generated gencode committed despite bannerAs with
asset.pb.h, the header says “NO CHECKED-IN PROTOBUF GENCODE” yet lives in the repo. Please confirm that committing generated sources is intentional and documented, or move generation to the build step.agents/grpc/src/proto/asset.pb.cc (1)
2-4: Large amount of regenerated code checked inThe
.ccfile is ~4 k LOC of generated output. Storing this in VCS:
- Inflates repository size & pull-requests
- Creates noisy diffs like this one
- Requires developers to remember to regenerate after every
.protoeditUnless your deployment flow requires shipping generated C++ sources (e.g., non-Bazel consumers), consider removing them from the repo and generating during the build (CMake
protobuf_generate, Bazel rules, etc.).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (22)
agents/grpc/src/proto/asset.grpc.pb.h(1 hunks)agents/grpc/src/proto/asset.pb.cc(2 hunks)agents/grpc/src/proto/asset.pb.h(2 hunks)agents/grpc/src/proto/blocked_loop.grpc.pb.h(1 hunks)agents/grpc/src/proto/command.grpc.pb.h(1 hunks)agents/grpc/src/proto/command.pb.cc(5 hunks)agents/grpc/src/proto/command.pb.h(8 hunks)agents/grpc/src/proto/common.grpc.pb.h(1 hunks)agents/grpc/src/proto/common.pb.cc(4 hunks)agents/grpc/src/proto/common.pb.h(2 hunks)agents/grpc/src/proto/exit.grpc.pb.h(1 hunks)agents/grpc/src/proto/exit.pb.cc(4 hunks)agents/grpc/src/proto/exit.pb.h(3 hunks)agents/grpc/src/proto/info.grpc.pb.h(1 hunks)agents/grpc/src/proto/metrics.grpc.pb.h(1 hunks)agents/grpc/src/proto/metrics.pb.cc(3 hunks)agents/grpc/src/proto/metrics.pb.h(1 hunks)agents/grpc/src/proto/nsolid_service.grpc.pb.h(2 hunks)agents/grpc/src/proto/nsolid_service.pb.cc(2 hunks)agents/grpc/src/proto/nsolid_service.pb.h(2 hunks)agents/grpc/src/proto/packages.grpc.pb.h(1 hunks)agents/grpc/src/proto/packages.pb.cc(4 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
agents/grpc/src/proto/nsolid_service.pb.cc (2)
agents/grpc/src/proto/asset.pb.cc (20)
Impl_(29-41)Impl_(29-30)Impl_(165-168)Impl_(203-205)Message(160-164)Message(179-202)_instance(53-53)_impl_(50-51)MergeImpl(550-614)MergeImpl(550-550)ByteSizeLong(480-643)ByteSizeLong(480-480)ByteSizeLong(483-548)ByteSizeLong(483-483)_InternalSerialize(391-477)_InternalSerialize(391-393)void(355-383)Clear(355-355)GetMetadata(639-641)GetMetadata(639-639)agents/grpc/src/proto/asset.pb.h (34)
Impl_(338-338)Impl_(339-341)Impl_(342-345)_impl_(185-185)_internal_metadata_(108-111)PROTOBUF_NONNULL(82-85)PROTOBUF_NONNULL(82-82)PROTOBUF_NONNULL(132-139)PROTOBUF_NONNULL(132-132)PROTOBUF_NONNULL(140-144)PROTOBUF_NONNULL(140-140)PROTOBUF_NONNULL(190-190)PROTOBUF_NULLABLE(188-188)PROTOBUF_NULLABLE(234-234)PROTOBUF_NULLABLE(248-248)PROTOBUF_NULLABLE(249-249)PROTOBUF_NULLABLE(263-263)PROTOBUF_NULLABLE(264-264)from(94-97)from(94-94)from(98-106)from(98-98)from(152-152)from(154-154)from(154-154)ByteSizeLong(173-173)_InternalSerialize(168-170)_InternalSerialize(174-178)_InternalSerialize(181-183)GetClassData(204-204)void(602-607)to_msg(157-158)swap(131-131)swap(131-131)
agents/grpc/src/proto/asset.pb.h (1)
agents/grpc/src/proto/asset.pb.cc (17)
Asset(44-44)Asset(218-221)Asset(232-236)Asset(232-234)Asset(268-272)Asset(268-268)Asset(386-388)SharedDtor(222-230)SharedDtor(222-222)CopyFrom(616-621)CopyFrom(616-616)MergeImpl(550-614)MergeImpl(550-550)void(355-383)_InternalSerialize(391-477)_InternalSerialize(391-393)_impl_(50-51)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: test-tarball-linux
- GitHub Check: test-linux (ubuntu-24.04-arm)
- GitHub Check: test-linux (ubuntu-24.04)
- GitHub Check: test-macOS
- GitHub Check: coverage-linux
- GitHub Check: coverage-linux-without-intl
- GitHub Check: coverage-windows
🔇 Additional comments (16)
agents/grpc/src/proto/command.grpc.pb.h (1)
33-33: Wrap generated gRPC code with port macros
The inclusion of<grpcpp/ports_def.inc>before the namespace (line 33) and<grpcpp/ports_undef.inc>after the namespace (line 40) correctly scopes platform/compiler-specific macros around the generated code, aligning with gRPC best practices and matching the updates in other service headers.Also applies to: 40-40
agents/grpc/src/proto/blocked_loop.grpc.pb.h (1)
33-33: Apply consistent port macro wrapping
Adding<grpcpp/ports_def.inc>at line 33 and<grpcpp/ports_undef.inc>at line 40 properly encapsulates the generated content to manage macro definitions, ensuring cross-platform consistency and mirroring changes in other gRPC headers.Also applies to: 40-40
agents/grpc/src/proto/info.grpc.pb.h (1)
27-27: Encapsulate includes with gRPC port macros
The newly added<grpcpp/ports_def.inc>(line 27) and<grpcpp/ports_undef.inc>(line 34) correctly bracket the generated code, standardizing compiler/OS macros across all gRPC headers.Also applies to: 34-34
agents/grpc/src/proto/metrics.grpc.pb.h (1)
27-27: Standardize macro definitions around generated code
Wrapping the gRPC-generated content with<grpcpp/ports_def.inc>at line 27 and<grpcpp/ports_undef.inc>at line 34 ensures consistent macro handling and aligns this file with the rest of the gRPC headers.Also applies to: 34-34
agents/grpc/src/proto/nsolid_service.grpc.pb.h (1)
27-27: Bracket gRPC service definitions with port macros
Inserting<grpcpp/ports_def.inc>at line 27 and<grpcpp/ports_undef.inc>at line 1886 correctly wraps the extensive generated service declarations, providing platform/compiler macro isolation consistent with other updated headers.Also applies to: 1886-1886
agents/grpc/src/proto/common.grpc.pb.h (1)
27-28: Ports wrappers are correctly placed – no action needed.
grpcpp/ports_def.incandgrpcpp/ports_undef.incmust wrap all public gRPC headers after v1.71 to guarantee the right platform‐specific symbol visibility.
Placement (immediately after the<grpcpp/support/...>include set and just before the closing#endif) is correct and matches upstream templates.
Nothing to change here.Also applies to: 34-34
agents/grpc/src/proto/packages.grpc.pb.h (1)
33-34: Consistent port-macro wrapping – looks good.Same observation as in
common.grpc.pb.h: wrappers are in the canonical spots, ensuring the file compiles on all supported platforms.Also applies to: 40-40
agents/grpc/src/proto/exit.grpc.pb.h (1)
27-28: No issues spotted – inclusion pattern is correct.The newly added port headers are positioned exactly as upstream gRPC expects.
Also applies to: 34-34
agents/grpc/src/proto/asset.grpc.pb.h (1)
27-28: Ports headers added correctly.Nothing else was touched; the change is minimal and safe.
Also applies to: 34-34
agents/grpc/src/proto/common.pb.cc (1)
22-27: Compile-time dependency bump – verify tool-chain flags.The regenerated code now relies on C++17 features (
std::is_constant_evaluated, inlineconstexprctors, etc.) that sneak in via<type_traits>and protobuf’s 6.x internals.
Please make sure:
- The project’s build system passes at least
-std=c++17(or the MSVC equivalent).- Older compilers (e.g., GCC 7 or Clang 5) are no longer in your supported matrix.
Otherwise this code will fail to compile in downstream environments.
agents/grpc/src/proto/common.pb.h (1)
2-7:Details
❓ Verification inconclusive
Mismatch risk between compiled runtime and generated headers
The header enforces
PROTOBUF_VERSION == 6030002. Ensure that:
- The build images (Dockerfile, CI, local dev) install protobuf 6.30.2 exactly.
- No transitive dependency (e.g., gRPC v1.72 vendored copy) pulls a different minor version of
libprotobufat link-time.Otherwise you will hit hard-to-diagnose ODR violations or compilation errors.
🏁 Script executed:
#!/bin/bash # Quick sanity-check: locate libprotobuf versions on the build host ldconfig -p | grep libprotobuf || trueLength of output: 138
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "=== protoc version ===" if command -v protoc >/dev/null 2>&1; then protoc --version else echo "protoc: not found" fi echo echo "=== pkg-config protobuf version ===" if command -v pkg-config >/dev/null 2>&1; then pkg-config --modversion protobuf || echo "pkg-config protobuf: no metadata" else echo "pkg-config: not found" fi echo echo "=== Locate libprotobuf in filesystem ===" find /usr /lib -type f -name 'libprotobuf.so*' 2>/dev/null || echo "no libprotobuf found"Length of output: 453
🏁 Script executed:
#!/usr/bin/env bash set -euo pipefail echo "=== Searching for Dockerfiles ===" fd -HI -t f 'Dockerfile*' || echo "No Dockerfiles found" echo echo "=== Inspecting Dockerfiles for protobuf install commands ===" rg -nE 'apt(-get)? install.*protobuf|yum install.*protobuf|brew install.*protobuf|protobuf-compiler' --glob 'Dockerfile*' || echo "No protobuf install lines in Dockerfiles" echo echo "=== Scanning GitHub Actions workflows for protobuf references ===" rg -n 'protobuf' --glob '.github/workflows/*.yml' || echo "No protobuf references in workflows"Length of output: 1978
Ensure Protobuf 6.30.2 matches generated headers
The generated header in agents/grpc/src/proto/common.pb.h (enforced by
#if PROTOBUF_VERSION != 6030002) requires your build and link-time runtime to use exactly protobuf 6.30.2. No explicit protobuf installs or version pins were found in your Dockerfiles or GitHub workflows, so please:
- Pin protobuf to 6.30.2 in all build images and dev containers
• e.g. deps/opentelemetry-cpp/.devcontainer/Dockerfile.dev
• any deps/grpc/…/Dockerfile used by your CI or local builds- Add version-pinned installs in your CI pipelines (.github/workflows/*.yml)
- Verify local dev scripts or documentation install protobuf-compiler==6.30.2
- Audit transitive dependencies (e.g. vendored gRPC) to ensure they don’t pull a different libprotobuf minor version at link time
Without these pins you risk ODR violations or runtime/compile errors due to mismatched protobuf versions.
agents/grpc/src/proto/exit.pb.cc (1)
21-23: Include ordering: keep port headers last
port_def.incmust be the very last protobuf include, but new code occasionally appends extra includes later during manual edits. Double-check that no further#includelines are added after line 23 by future manual modifications.agents/grpc/src/proto/nsolid_service.pb.h (1)
14-19: Runtime version guard – verify availability of protobuf 6.30.2As with
command.pb.h, ensure CI images and release tooling provide the exact protobuf runtime that matches this header.agents/grpc/src/proto/asset.pb.h (1)
14-19: Build may fail if the runtime uses a different protobuf patch-levelThe hard check
#if PROTOBUF_VERSION != 6030002 #error … #endifwill break compilation when the system protobuf runtime is even one patch ahead/behind 6.30.2. If your CI or distro tool-chain upgrades protobuf, the whole build will be red-flagged.
If reproducible builds are required, pinning a vendored protobuf or using CMake’s
FetchContentto pull the exact version is safer than relying on the system install.agents/grpc/src/proto/exit.pb.h (1)
14-19: Strict version guard risks accidental build breakageThe
#if PROTOBUF_VERSION != 6030002check enforces an exact patch-level. Evaluate whether you want== 6030***(major.minor) instead, or pin the runtime in your tool-chain to avoid surprise build failures.agents/grpc/src/proto/asset.pb.cc (1)
24-27: Namespace aliases_pb,_pbi,_flleak into the global TUThese aliases are introduced at file scope:
namespace _pb = ::google::protobuf; namespace _pbi = ::google::protobuf::internal; namespace _fl = ::google::protobuf::internal::field_layout;While harmless in generated code, they could clash if another TU #includes this
.ccindirectly or defines the same aliases. Normally a generated.ccis compiled as a standalone translation unit, so it’s fine; just ensure the build never#includes a generated.cc.
| // NO CHECKED-IN PROTOBUF GENCODE | ||
| // source: command.proto |
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.
💡 Verification agent
🧩 Analysis chain
Generated sources are being committed despite “NO CHECKED-IN PROTOBUF GENCODE” guard
Lines 2–3 explicitly state that protobuf-generated artefacts should not be checked into VCS, yet the file is present in the PR. Keeping large generated files in the repo:
- contradicts the documented policy,
- dramatically inflates repository size / diff noise,
- risks merge conflicts whenever someone regenerates with a slightly different
protoc/clang-formatversion.
If these files must be present for your build system, consider:
-// NO CHECKED-IN PROTOBUF GENCODE
+// NOTE: Generated code intentionally checked in – see docs/GENERATED_CODE.md…and add a short rationale in the proposed doc. Otherwise, delete the whole agents/grpc/src/proto/*.pb.{h,cc} directory and build them during CI.
🏁 Script executed:
#!/bin/bash
# List all committed files still containing the guard comment
rg --line-number --fixed-strings "NO CHECKED-IN PROTOBUF GENCODE" agents/grpc/src/protoLength of output: 1984
Generated protobuf artifacts still checked in despite guard
All files under agents/grpc/src/proto/*.pb.{h,cc} still contain the
// NO CHECKED-IN PROTOBUF GENCODE
guard comment, which contradicts the documented policy. You must choose one of two paths:
-
If these protobuf-generated sources are required in the repo for your build system, update their header comment and provide a rationale:
-// NO CHECKED-IN PROTOBUF GENCODE +// NOTE: Generated code intentionally checked in – see docs/GENERATED_CODE.md
• Create
docs/GENERATED_CODE.mdand explain why checked-in code is necessary (tooling constraints, CI performance, etc.). -
Otherwise, remove the entire directory of generated files and adjust CI/configuration to run
protocat build time:
• Deleteagents/grpc/src/proto/*.pb.hand*.pb.cc.
• Add a CI step (e.g., in your Makefile or pipeline) to regenerate these files before compilation.
Please apply one of these solutions to keep your codebase consistent and avoid merge conflicts.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // NO CHECKED-IN PROTOBUF GENCODE | |
| // source: command.proto | |
| // NOTE: Generated code intentionally checked in – see docs/GENERATED_CODE.md | |
| // source: command.proto |
| // NO CHECKED-IN PROTOBUF GENCODE | ||
| // source: command.proto |
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.
Generated code is being committed despite the “NO CHECKED-IN PROTOBUF GENCODE” banner
Both lines 2-3 explicitly state that protobuf output should not be checked into VCS. Keeping ~25 000 lines of generated C++ will add maintenance overhead, inflate the repo, and create merge noise on every regen.
Unless the project policy has changed, please drop the generated files from the PR and let the build system regenerate them (e.g. via protoc in the CI or make proto).
If the policy did change, please update the contributor guide and remove the banner from the template used by protoc.
| // NO CHECKED-IN PROTOBUF GENCODE | ||
| // source: nsolid_service.proto |
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.
Generated header should not be version-controlled
Same rationale as the previous two files – please remove or justify inclusion of generated sources.
1d8bbe4 to
1ff0b06
Compare
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.
Actionable comments posted: 2
♻️ Duplicate comments (5)
agents/grpc/src/proto/common.pb.cc (1)
2-2: Generated protobuf artifacts still checked in despite guard comment.This file contains the guard comment
// NO CHECKED-IN PROTOBUF GENCODEbut is still being checked into the repository as part of the dependency update to protobuf 30.2.agents/grpc/src/proto/packages.pb.cc (1)
2-2: Generated protobuf artifacts still checked in despite guard comment.This file contains the guard comment
// NO CHECKED-IN PROTOBUF GENCODEbut is still being checked into the repository as part of the dependency update to protobuf 30.2.agents/grpc/src/proto/command.pb.cc (1)
2-2: Generated protobuf artifacts still checked in despite guard comment.This file contains the guard comment
// NO CHECKED-IN PROTOBUF GENCODEbut is still being checked into the repository as part of the dependency update to protobuf 30.2.agents/grpc/src/proto/exit.pb.cc (1)
2-2: Same banner → same concern: remove checked-in generated codeThe "NO CHECKED-IN PROTOBUF GENCODE" notice appears here as well. This file contains automatically generated code that according to the notice should not be checked into the repository.
agents/grpc/src/proto/command.pb.h (1)
2-2: Same banner issue applies to all generated protobuf filesThe "NO CHECKED-IN PROTOBUF GENCODE" notice appears in this file too, contradicting the fact that it's being committed to the repository.
🧹 Nitpick comments (2)
agents/grpc/src/proto/command.pb.cc (1)
1-4: Project-wide recommendation for protobuf-generated code strategyAll protobuf-generated files (.pb.cc and .pb.h) in this PR contain a warning comment about not checking them in, yet they're being maintained in the repository. This creates a contradiction in the project's practices.
You should either:
- Remove the "NO CHECKED-IN PROTOBUF GENCODE" comments and document why generated files are kept in the repository, or
- Remove these files from version control and add appropriate build steps to generate them during the build process
This approach should be applied consistently across all protobuf-generated files in the project.
agents/grpc/src/proto/common.pb.h (1)
14-19: Version coupling could impact CI/CD and developer environmentsThe hard dependency on protobuf version 6.30.2 can cause build failures if the exact version isn't available. This tight coupling affects build reproducibility across different environments.
Consider documenting this dependency clearly in the project's README or build instructions to ensure all developers and CI/CD systems use the correct version. Additionally, you might want to provide a containerized build environment with the exact dependencies pre-installed.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (22)
agents/grpc/src/proto/asset.grpc.pb.h(1 hunks)agents/grpc/src/proto/asset.pb.cc(2 hunks)agents/grpc/src/proto/asset.pb.h(2 hunks)agents/grpc/src/proto/blocked_loop.grpc.pb.h(1 hunks)agents/grpc/src/proto/command.grpc.pb.h(1 hunks)agents/grpc/src/proto/command.pb.cc(5 hunks)agents/grpc/src/proto/command.pb.h(8 hunks)agents/grpc/src/proto/common.grpc.pb.h(1 hunks)agents/grpc/src/proto/common.pb.cc(4 hunks)agents/grpc/src/proto/common.pb.h(2 hunks)agents/grpc/src/proto/exit.grpc.pb.h(1 hunks)agents/grpc/src/proto/exit.pb.cc(4 hunks)agents/grpc/src/proto/exit.pb.h(3 hunks)agents/grpc/src/proto/info.grpc.pb.h(1 hunks)agents/grpc/src/proto/metrics.grpc.pb.h(1 hunks)agents/grpc/src/proto/metrics.pb.cc(3 hunks)agents/grpc/src/proto/metrics.pb.h(1 hunks)agents/grpc/src/proto/nsolid_service.grpc.pb.h(2 hunks)agents/grpc/src/proto/nsolid_service.pb.cc(2 hunks)agents/grpc/src/proto/nsolid_service.pb.h(2 hunks)agents/grpc/src/proto/packages.grpc.pb.h(1 hunks)agents/grpc/src/proto/packages.pb.cc(4 hunks)
✅ Files skipped from review due to trivial changes (1)
- agents/grpc/src/proto/exit.grpc.pb.h
🚧 Files skipped from review as they are similar to previous changes (9)
- agents/grpc/src/proto/info.grpc.pb.h
- agents/grpc/src/proto/metrics.grpc.pb.h
- agents/grpc/src/proto/packages.grpc.pb.h
- agents/grpc/src/proto/blocked_loop.grpc.pb.h
- agents/grpc/src/proto/common.grpc.pb.h
- agents/grpc/src/proto/command.grpc.pb.h
- agents/grpc/src/proto/nsolid_service.grpc.pb.h
- agents/grpc/src/proto/asset.grpc.pb.h
- agents/grpc/src/proto/nsolid_service.pb.h
🧰 Additional context used
🧬 Code Graph Analysis (1)
agents/grpc/src/proto/asset.pb.cc (2)
agents/grpc/src/proto/asset.pb.h (50)
Impl_(338-338)Impl_(339-341)Impl_(342-345)Asset(78-78)Asset(78-78)Asset(79-79)Asset(89-89)Asset(91-91)Asset(91-91)Asset(92-93)Asset(92-92)Asset(197-197)Asset(198-198)Asset(199-203)Asset(409-427)Asset(409-409)Asset(428-436)Asset(428-428)Asset(437-444)_impl_(185-185)PROTOBUF_NONNULL(82-85)PROTOBUF_NONNULL(82-82)PROTOBUF_NONNULL(132-139)PROTOBUF_NONNULL(132-132)PROTOBUF_NONNULL(140-144)PROTOBUF_NONNULL(140-140)PROTOBUF_NONNULL(190-190)PROTOBUF_NULLABLE(188-188)PROTOBUF_NULLABLE(234-234)PROTOBUF_NULLABLE(248-248)PROTOBUF_NULLABLE(249-249)PROTOBUF_NULLABLE(263-263)PROTOBUF_NULLABLE(264-264)from(94-97)from(94-94)from(98-106)from(98-98)from(152-152)from(154-154)from(154-154)self(189-189)PlacementNew_(205-207)ByteSizeLong(173-173)_InternalSerialize(168-170)_InternalSerialize(174-178)_InternalSerialize(181-183)GetClassData(204-204)void(602-607)swap(131-131)swap(131-131)agents/grpc/src/proto/nsolid_service.pb.cc (32)
Impl_(29-34)Impl_(29-30)Impl_(164-167)Impl_(188-190)Message(159-163)Message(178-187)_impl_(43-44)SharedCtor(194-196)SharedCtor(194-194)SharedDtor(201-207)SharedDtor(201-201)PlacementNew_(209-213)PlacementNew_(209-211)InternalNewImpl_(214-217)InternalNewImpl_(214-214)InternalGenerateClassData_(218-239)InternalGenerateClassData_(218-218)MergeImpl(364-384)MergeImpl(364-364)ByteSizeLong(337-407)ByteSizeLong(337-337)ByteSizeLong(340-362)ByteSizeLong(340-340)_InternalSerialize(303-305)_InternalSerialize(308-334)_InternalSerialize(308-310)GetClassData(245-249)GetClassData(245-245)void(287-300)Clear(287-287)GetMetadata(403-405)GetMetadata(403-403)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: test-tarball-linux
- GitHub Check: test-macOS
- GitHub Check: coverage-linux-without-intl
- GitHub Check: coverage-linux
- GitHub Check: test-linux (ubuntu-24.04-arm)
- GitHub Check: test-linux (ubuntu-24.04)
- GitHub Check: coverage-windows
🔇 Additional comments (71)
agents/grpc/src/proto/command.pb.h (1)
14-19:Details
❓ Verification inconclusive
Ensure consistent protobuf runtime availability for all build environments
The strict version requirement (protobuf 6.30.2) could lead to build failures in different environments where this exact version isn't available.
Run this script to check if you have the correct version in CI/CD environments:
🏁 Script executed:
#!/bin/bash # Check if the exact required version is available # Print the protobuf version that will be used echo "Checking for Protobuf version in include paths..." for path in $(cpp -v 2>&1 | grep "^ /" | grep -v "framework"); do if [ -f "$path/google/protobuf/runtime_version.h" ]; then echo "Found in $path:" grep "define PROTOBUF_VERSION" "$path/google/protobuf/runtime_version.h" || echo " No version defined" fi done # Check if there are multiple versions (potential ODR violation) count=$(find /usr -name "runtime_version.h" -type f 2>/dev/null | wc -l) if [ "$count" -gt 1 ]; then echo "WARNING: Multiple protobuf runtime_version.h files found, possible ODR violation risk" fiLength of output: 235
Confirm Protobuf header availability and version alignment
Our environment check didn’t locate any
runtime_version.hin the system include paths (and found no multiple versions), which means the build may either fail or rely on vendored headers. Please verify that:
- All CI/dev environments provide Protobuf 6.30.2 in their include paths (or vendor the exact headers),
- Or consider broadening the check to accept any 6.30.x patch version to reduce build fragility.
• agents/grpc/src/proto/command.pb.h (lines 14–19)
agents/grpc/src/proto/asset.pb.cc (12)
1-5: Successfully updated to Protobuf C++ 6.30.2The file has been properly regenerated with the new Protobuf version, as indicated by the version comment.
8-22: Updated includes and modern Protobuf headersThe includes have been properly updated to work with Protobuf 6.30.2, adding important headers like
generated_message_tctable_impl.hfor the table-driven parsing infrastructure.
24-27: Modernized namespace usageProperly switched from Protobuf namespace macros to explicit namespace references using aliases, improving code readability and maintainability.
29-149: Upgraded to modern Protobuf implementation architectureSuccessfully implemented the new Protobuf architecture with:
- Arena-aware constructors and internal Impl_ struct
- Constant initialization support
- Modern layout with has_bits for field presence tracking
- Thread sanitizer annotations
These changes improve memory management, threading safety, and performance.
232-272: Updated object lifecycle managementModern Protobuf method implementations for:
- PlacementNew_
- InternalNewImpl_
- InternalGenerateClassData_
These improvements provide better arena allocation and message lifecycle management.
274-354: Added table-driven parsing supportSuccessfully implemented the new table-driven parsing infrastructure with the TcParseTable, which significantly improves parsing performance in Protobuf 6.30.2.
355-383: Updated Clear() implementationThe Clear() method has been properly updated to use:
- Thread sanitizer annotations
- Presence bit checking
- Conditional field clearing based on has_bits
- Memory-efficient bulk clearing
This approach is more efficient and safer than the previous implementation.
384-477: Modernized serializationThe _InternalSerialize method has been properly updated to:
- Support both custom vtable and standard implementations
- Check presence bits before serializing fields
- Skip serializing zero-valued fields where appropriate
- Use absl::bit_cast for floating point zero checks
These changes optimize serialization by avoiding unnecessary work.
478-548: Optimized size calculationByteSizeLong has been updated with:
- Support for custom vtable implementations
- Prefetching hints for better cache utilization
- Presence bit checks for conditional size calculation
- Zero-value checks for numeric fields
This improves performance when calculating message sizes.
549-614: Enhanced message merging logicThe MergeImpl method is properly updated with:
- Arena-aware message field handling
- Conditional merging based on presence bits
- Proper handling of empty strings
- Proper updating of has_bits after merging
These changes ensure correct behavior when merging messages.
623-641: Updated swap implementationInternalSwap has been enhanced to:
- Check arena compatibility
- Swap has_bits to maintain field presence information
- Use arena-aware string pointer swaps
- Use efficient memory swapping for primitive fields
This provides better performance and correctness when swapping messages.
642-653: Modern metadata retrievalGetMetadata now uses the new class data infrastructure via GetMetadataImpl, which is more efficient than the previous approach.
agents/grpc/src/proto/nsolid_service.pb.cc (12)
1-5: Successfully updated to Protobuf C++ 6.30.2The file has been properly regenerated with the new Protobuf version, as indicated by the version comment.
8-22: Updated includes and modern Protobuf headersThe includes have been properly updated to work with Protobuf 6.30.2, adding important headers like
generated_message_tctable_impl.hfor the table-driven parsing infrastructure.
24-27: Modernized namespace usageProperly switched from Protobuf namespace macros to explicit namespace references using aliases, improving code readability and maintainability.
29-113: Upgraded to modern Protobuf implementation architectureSuccessfully implemented the new Protobuf architecture with:
- Arena-aware constructors and internal Impl_ struct
- Constant initialization support
- Modern layout with has_bits for field presence tracking
- Comprehensive descriptor tables for reflection
These changes improve memory management and performance.
209-250: Updated object lifecycle managementModern Protobuf method implementations for:
- PlacementNew_
- InternalNewImpl_
- InternalGenerateClassData_
These improvements provide better arena allocation and message lifecycle management.
251-286: Added table-driven parsing supportSuccessfully implemented the new table-driven parsing infrastructure with the TcParseTable, which significantly improves parsing performance in Protobuf 6.30.2.
287-300: Updated Clear() implementationThe Clear() method has been properly updated to use:
- Thread sanitizer annotations
- Presence bit checking for has_bits
- Conditional string clearing based on presence
This approach is more efficient and safer than the previous implementation.
302-334: Modernized serializationThe _InternalSerialize method has been properly updated to:
- Support both custom vtable and standard implementations
- Check presence bits before serializing fields
- Use proper stream writing for the error_message field
These changes optimize serialization by avoiding unnecessary work.
336-362: Optimized size calculationByteSizeLong has been updated with:
- Support for custom vtable implementations
- Proper presence bit checking for fields
- Conditional size calculation based on field presence
This improves performance when calculating message sizes.
364-384: Enhanced message merging logicThe MergeImpl method is properly updated with:
- Conditional merging based on presence bits
- Proper handling of empty strings
- Updating has_bits after merging
These changes ensure correct behavior when merging messages.
394-401: Updated swap implementationInternalSwap has been enhanced to:
- Check arena compatibility
- Swap has_bits to maintain field presence information
- Use arena-aware string pointer swaps
This provides better performance and correctness when swapping messages.
413-417: Added proper static initializationThe static initialization logic ensures descriptors are properly registered at startup, which is important for reflection and serialization.
agents/grpc/src/proto/metrics.pb.cc (13)
1-5: Successfully updated to Protobuf C++ 6.30.2The file has been properly regenerated with the new Protobuf version, as indicated by the version comment.
8-22: Updated includes and modern Protobuf headersThe includes have been properly updated to work with Protobuf 6.30.2, adding important headers like
generated_message_tctable_impl.hfor the table-driven parsing infrastructure.
24-27: Modernized namespace usageProperly switched from Protobuf namespace macros to explicit namespace references using aliases, improving code readability and maintainability.
29-79: Upgraded to modern Protobuf implementation architecture for both message typesSuccessfully implemented the new Protobuf architecture for both MetricsBody and MetricsEvent with:
- Arena-aware constructors and internal Impl_ structs
- Constant initialization support
- Modern memory layout
- Thread safety annotations
These changes improve memory management and threading safety.
215-239: Updated object lifecycle management for MetricsBodyModern Protobuf method implementations for:
- PlacementNew_
- InternalNewImpl_ with arena offset encoding
- InternalGenerateClassData_
These improvements provide better arena allocation and message lifecycle management.
269-303: Added table-driven parsing support for MetricsBodySuccessfully implemented the new table-driven parsing infrastructure with the TcParseTable, which significantly improves parsing performance in Protobuf 6.30.2.
304-313: Updated Clear() implementation for MetricsBodyThe Clear() method has been properly updated to use:
- Thread sanitizer annotations
- Proper clearing of the resource_metrics repeated field
- Proper clearing of metadata
This approach is more efficient and safer than the previous implementation.
489-519: Updated object lifecycle management for MetricsEventModern Protobuf method implementations for:
- PlacementNew_
- InternalNewImpl_
- InternalGenerateClassData_
These improvements provide better arena allocation and message lifecycle management.
530-572: Added table-driven parsing support for MetricsEventSuccessfully implemented the new table-driven parsing infrastructure with the TcParseTable, which significantly improves parsing performance in Protobuf 6.30.2.
573-593: Updated Clear() implementation for MetricsEventThe Clear() method has been properly updated to use:
- Thread sanitizer annotations
- Presence bit checking
- Conditional clearing of message fields based on has_bits
This approach is more efficient and safer than the previous implementation.
666-696: Enhanced message merging logic for MetricsEventThe MergeImpl method is properly updated with:
- Arena-aware message field handling
- Conditional merging based on presence bits
- Proper submessage merging or copy construction
- Proper updating of has_bits after merging
These changes ensure correct behavior when merging messages.
706-716: Updated swap implementation for MetricsEventInternalSwap has been enhanced to:
- Check for same arena requirement
- Swap has_bits to maintain field presence information
- Use efficient memory swapping for message pointers
This provides better performance and correctness when swapping messages.
728-732: Added proper static initializationThe static initialization logic ensures descriptors are properly registered at startup, which is important for reflection and serialization.
agents/grpc/src/proto/metrics.pb.h (13)
1-8: Successfully updated to Protobuf C++ 6.30.2The file has been properly regenerated with the new Protobuf version, as indicated by the version comment and updated include guard.
14-19: Added version compatibility checkAdded important version compatibility check that ensures the runtime version matches the generated code version, preventing subtle compatibility issues.
20-38: Updated includes and modern Protobuf headersThe includes have been properly updated to work with Protobuf 6.30.2, adding important headers like
generated_message_tctable_decl.hand explicit port definition handling.
39-66: Modernized namespace and descriptor declarationsUpdates include:
- Explicit namespace declarations
- Extern "C" linkage for descriptor table
- Modern class data declarations
- GetAnyMessageName template support
These changes improve compatibility and reflection capabilities.
79-111: Updated MetricsBody class declarationModern class declaration includes:
- Inheritance from google::protobuf::Message
- PROTOBUF_FINAL destructor
- Arena-aware constructors
- Custom vtable support
- Proper move and copy semantics
These changes improve memory management and provide better API safety.
112-120: Enhanced unknown fields handlingUpdated unknown fields accessors with:
- ABSL_ATTRIBUTE_LIFETIME_BOUND annotations
- Explicit nullability
- Modern template usage
This improves memory safety and forward compatibility.
135-149: Modernized swap methodsUpdated swap methods with:
- Arena compatibility checking via CanUseInternalSwap
- Explicit nullability annotations
- Safe arena checking in UnsafeArenaSwap
These changes prevent subtle memory errors when swapping messages.
152-167: Updated core Message interface methodsCore methods updated with:
- Arena-aware New implementation
- Modern MergeFrom/CopyFrom approach
- Simplified IsInitialized that always returns true
- ABSL_ATTRIBUTE_REINITIALIZES for Clear
These changes align with modern Protobuf best practices.
191-217: Updated internal class structure and lifecycle methodsModern implementation includes:
- Arena-aware SharedCtor/SharedDtor
- InternalSwap for efficient swapping
- Friend declarations for internal Protobuf templates
- Arena-aware constructors with const references
- PlacementNew_ and InternalNewImpl_ for allocation
These changes improve memory safety and performance.
241-268: Enhanced Impl_ struct with modern featuresThe internal Impl_ struct now includes:
- Constexpr constructors
- Arena visibility control
- cached_size field
- Thread sanitizer declarations
- Proper copy semantics
This provides better threading safety and memory management.
511-548: Updated MetricsBody field accessorsField accessors are modernized with:
- Thread sanitizer annotations
- ABSL_ATTRIBUTE_LIFETIME_BOUND annotations
- Explicit nullability
- Clear separation between internal and external accessors
These changes improve safety and memory management.
553-625: Enhanced MetricsEvent::common field accessors and mutatorsField accessors and mutators improved with:
- Presence bit checking with PROTOBUF_ASSUME
- Thread sanitizer annotations
- Arena-aware pointer management
- Safe handling of nullptr
- Proper lifetime annotations
These changes provide better memory safety and performance.
681-723: Enhanced MetricsEvent::body field accessors and mutatorsRelease and setter methods improved with:
- Proper presence bit clearing
- Conditional arena duplication
- Debug harness checking
- Thread sanitizer annotations
- Arena ownership transfer safety
These changes prevent memory leaks and use-after-free errors.
agents/grpc/src/proto/exit.pb.h (11)
1-19: Version update to Protobuf 6.30.2 looks goodThe file header now correctly includes the Protobuf C++ version declaration and appropriate version checks. The include guards have also been modernized to a simpler form.
20-36: Modern Protobuf headers included correctlyThe updated include directives now reference the latest Protobuf headers, including new ones like
generated_message_tctable_decl.handmessage_lite.h. The port definition is also properly included at the end as required by best practices.
40-73: Explicit namespace usage improves readabilityThe code now uses explicit
google::protobufnamespaces instead of macro-based namespace usage, which is more maintainable and less error-prone.
82-199: Enhanced class implementation with modern Protobuf patternsThe
Errorclass now properly implements:
- Thread sanitizer annotations for safety
- Arena-aware constructors and memory management
- Move semantics with
CanMoveWithInternalSwap- Explicit presence tracking via bitfields
- Modern reflection and metadata support
These changes improve memory safety and performance.
Also applies to: 205-219
225-290: Accessor methods modernized with presence trackingThe accessor methods for the
Errorclass fields now:
- Properly track presence bits
- Include thread sanitizer annotations
- Support forwarding references and variadic templates
- Use
PROTOBUF_NONNULL/PROTOBUF_NULLABLEannotations for better pointer safetyThese improvements ensure thread safety and memory correctness.
326-359: Class data structure modernizedThe implementation now includes:
- Parse tables for efficient parsing
- Internal friend classes for TcParser integration
- TSAN thread sanitizer declarations
- Arena-aware memory management structures
These changes align with modern Protobuf implementation practices.
749-876: String field handling improved with safety checksString accessors and mutators now:
- Set presence bits on mutation
- Include debug hardening for default strings
- Handle arena ownership correctly
- Add thread sanitizer annotations
These improvements enhance memory safety and thread safety for string fields.
882-904: Primitive type field handling modernizedThe code now properly tracks presence bits for primitive fields like
codeand includes thread sanitizer annotations for all internal accesses.
906-1002: Message field handling improved with better memory managementMessage field accessors and mutators now:
- Properly handle arena ownership transfers
- Use
PROTOBUF_ASSUMEfor consistency checks- Include debug hardening for release operations
- Set presence bits consistently
This ensures proper memory management for complex embedded message fields.
1073-1262: Message field handling consistent across complex typesThe implementation of message field handling for
commonandbodyfields is consistent with other message fields, ensuring uniform memory management throughout the codebase.
1274-1277: Include guard properly closed with undefThe file correctly includes
port_undef.incand closes the include guard, following Protobuf best practices.agents/grpc/src/proto/asset.pb.h (9)
1-19: Version update to Protobuf 6.30.2 consistent with other filesThe file header includes the correct Protobuf C++ version declaration (6.30.2) matching the version seen in exit.pb.h, ensuring version consistency across the codebase.
20-38: Required Protobuf headers included in consistent orderThe include directives follow the same pattern as in exit.pb.h, with proper ordering and inclusion of all necessary headers for the latest Protobuf version.
75-219: Asset class updated with consistent memory management patternsThe
Assetclass implementation follows the same modernization patterns seen in other classes:
- Arena-aware constructors and memory management
- Thread sanitizer annotations
- Modern reflection and metadata support
- Consistent class data structure
This ensures uniform implementation across the protobuf-generated codebase.
325-360: Parse table structure matches latest Protobuf practicesThe internal parse table structure is correctly defined with the appropriate parameters for the Asset message, consistent with other message definitions in the codebase.
380-471: Common field handling follows thread-safe patternsThe implementation of the
commonfield accessors and mutators includes all necessary thread safety annotations and arena-aware memory management, consistent with the implementation in exit.pb.h.
497-588: Metadata field handling implements proper memory ownership transferThe handling of the
metadatafield (Struct type) correctly implements:
- Proper arena ownership transfer
- Thread sanitizer annotations
- Presence bit tracking
- Memory leak prevention
This ensures safe interaction with the Google Protobuf Struct type.
590-653: String field handling consistent with other filesThe implementation of string field handling for the
datafield matches the patterns seen in exit.pb.h, ensuring consistent string management across the codebase.
654-750: Primitive field accessors consistently implement presence trackingAll primitive field accessors (complete, duration, start_ts, end_ts) consistently implement presence bit tracking and thread sanitizer annotations, matching the patterns in other fields.
761-764: Include guard properly closed with undefThe file correctly includes
port_undef.incand closes the include guard, following the same pattern as in exit.pb.h.
| #include "google/protobuf/descriptor.h" | ||
| #include "google/protobuf/generated_message_reflection.h" | ||
| #include "google/protobuf/reflection_ops.h" | ||
| #include "google/protobuf/wire_format.h" |
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.
💡 Verification agent
🧩 Analysis chain
Verify that exact version 6.30.2 is available in your build environment
The protobuf version check has been updated to require exactly version 6.30.2. This strict dependency could cause build issues if different versions are used.
Run the following to verify that the required protobuf version is available in your build environment:
🏁 Script executed:
#!/bin/bash
# Check if the protobuf version 6.30.2 is installed in the system
find /usr -name "runtime_version.h" -type f 2>/dev/null | xargs grep -l "PROTOBUF_VERSION" | xargs grep -l "6030002" || echo "Required version not found in standard locations"
# Check if the version in the vendored copy matches
find . -path "*/google/protobuf/runtime_version.h" -type f | xargs grep -l "PROTOBUF_VERSION" | xargs grep "6030002" || echo "Required version not found in vendored copy"Length of output: 359
Vendored Protobuf Version Confirmed
The vendored google/protobuf/runtime_version.h defines PROTOBUF_OSS_VERSION as 6030002 (6.30.2), whereas no matching version was found in /usr. To avoid build failures on environments that don’t have Protobuf 6.30.2 installed system-wide, please ensure that:
- Your build configuration (e.g., include-path ordering in CMake or Bazel) prioritizes the vendored
google/protobufheaders and library over any system installation. - The project documentation or README clearly states that Protobuf 6.30.2 is required and, if desired, how to install it system-wide.
No code changes are strictly necessary in exit.pb.cc, but updating build settings or docs will prevent surprises when a different Protobuf version is present.
| @@ -1,721 +1,894 @@ | |||
| // Generated by the protocol buffer compiler. DO NOT EDIT! | |||
| // NO CHECKED-IN PROTOBUF GENCODE | |||
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.
🛠️ Refactor suggestion
Consider dropping generated code or updating the banner
The comment "NO CHECKED-IN PROTOBUF GENCODE" suggests this generated file should not be checked into the repository. Consider either:
- Removing it from the repository and generating it during the build process, or
- Updating the banner if the project policy has changed to allow generated code
c360a9c to
b5c04ac
Compare
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.
Actionable comments posted: 1
♻️ Duplicate comments (9)
agents/grpc/src/proto/common.pb.cc (1)
2-2: Consider updating or removing the "NO CHECKED-IN PROTOBUF GENCODE" bannerThe comment on line 2 explicitly states that protobuf generated code should not be checked in, but this PR is updating numerous .pb.cc and .pb.h files. If project policy has changed to allow or require checking in generated protobuf code, consider updating the code generation templates to remove this banner or clarify the policy.
agents/grpc/src/proto/exit.pb.cc (1)
2-2: Same "NO CHECKED-IN PROTOBUF GENCODE" issue as previously identifiedAs noted in previous reviews, the protobuf generated files contain a banner indicating they shouldn't be committed, but project policy appears to have changed. Consider updating the protoc templates used in the build process to remove or update this banner.
agents/grpc/src/proto/common.pb.h (1)
2-2: Note regarding the checked-in generated codeThe comment "NO CHECKED-IN PROTOBUF GENCODE" suggests a policy against checking in generated protobuf code, yet this file is included in the PR. This is consistent with similar comments in other protobuf files.
agents/grpc/src/proto/nsolid_service.pb.cc (1)
2-2: Note regarding the checked-in generated codeThe comment "NO CHECKED-IN PROTOBUF GENCODE" suggests a policy against checking in generated protobuf code, yet this file is included in the PR.
agents/grpc/src/proto/metrics.pb.cc (1)
2-2: Note regarding the checked-in generated codeThe comment "NO CHECKED-IN PROTOBUF GENCODE" suggests a policy against checking in generated protobuf code, yet this file is included in the PR.
agents/grpc/src/proto/command.pb.cc (1)
2-2: Generated code comment contradicts inclusion in repository.The comment "NO CHECKED-IN PROTOBUF GENCODE" indicates these files should not be tracked in version control, yet they're being updated in this PR.
You should either:
- Remove this warning comment if these files must be committed (and document why)
- Remove these generated files from version control and generate them during build
This issue was previously raised in a review comment and should be addressed to maintain consistency in your codebase policies.
agents/grpc/src/proto/metrics.pb.h (1)
2-2: Same "NO CHECKED-IN PROTOBUF GENCODE" comment found in this generated file.Like the other protobuf files, this comment contradicts the file's inclusion in version control.
For consistency across the codebase, the same approach should be applied to all protobuf-generated files.
agents/grpc/src/proto/nsolid_service.pb.h (1)
2-2: Generated protobuf header still contains "NO CHECKED-IN PROTOBUF GENCODE" comment.This contradicts the inclusion of the file in the repository.
This issue was previously noted for this file as well, indicating a systematic inconsistency that should be addressed for all protobuf-generated files in the codebase.
agents/grpc/src/proto/exit.pb.h (1)
2-2: Same "NO CHECKED-IN PROTOBUF GENCODE" comment found in this file.This comment contradicts the practice of checking in and updating these generated files.
This inconsistency exists in all protobuf-generated files in this PR and should be addressed systematically. Please choose one approach (either remove the comments or remove the files from version control) and apply it consistently.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (23)
agents/grpc/src/grpc_agent.cc(2 hunks)agents/grpc/src/proto/asset.grpc.pb.h(1 hunks)agents/grpc/src/proto/asset.pb.cc(2 hunks)agents/grpc/src/proto/asset.pb.h(2 hunks)agents/grpc/src/proto/blocked_loop.grpc.pb.h(1 hunks)agents/grpc/src/proto/command.grpc.pb.h(1 hunks)agents/grpc/src/proto/command.pb.cc(5 hunks)agents/grpc/src/proto/command.pb.h(8 hunks)agents/grpc/src/proto/common.grpc.pb.h(1 hunks)agents/grpc/src/proto/common.pb.cc(4 hunks)agents/grpc/src/proto/common.pb.h(2 hunks)agents/grpc/src/proto/exit.grpc.pb.h(1 hunks)agents/grpc/src/proto/exit.pb.cc(4 hunks)agents/grpc/src/proto/exit.pb.h(3 hunks)agents/grpc/src/proto/info.grpc.pb.h(1 hunks)agents/grpc/src/proto/metrics.grpc.pb.h(1 hunks)agents/grpc/src/proto/metrics.pb.cc(3 hunks)agents/grpc/src/proto/metrics.pb.h(1 hunks)agents/grpc/src/proto/nsolid_service.grpc.pb.h(2 hunks)agents/grpc/src/proto/nsolid_service.pb.cc(2 hunks)agents/grpc/src/proto/nsolid_service.pb.h(2 hunks)agents/grpc/src/proto/packages.grpc.pb.h(1 hunks)agents/grpc/src/proto/packages.pb.cc(4 hunks)
✅ Files skipped from review due to trivial changes (1)
- agents/grpc/src/proto/command.grpc.pb.h
🚧 Files skipped from review as they are similar to previous changes (10)
- agents/grpc/src/proto/info.grpc.pb.h
- agents/grpc/src/proto/exit.grpc.pb.h
- agents/grpc/src/proto/metrics.grpc.pb.h
- agents/grpc/src/proto/packages.grpc.pb.h
- agents/grpc/src/proto/common.grpc.pb.h
- agents/grpc/src/proto/asset.grpc.pb.h
- agents/grpc/src/proto/blocked_loop.grpc.pb.h
- agents/grpc/src/grpc_agent.cc
- agents/grpc/src/proto/nsolid_service.grpc.pb.h
- agents/grpc/src/proto/packages.pb.cc
🧰 Additional context used
🧬 Code Graph Analysis (1)
agents/grpc/src/proto/nsolid_service.pb.cc (2)
agents/grpc/src/proto/asset.pb.cc (24)
Impl_(29-41)Impl_(29-30)Impl_(165-168)Impl_(203-205)Message(160-164)Message(179-202)_instance(53-53)_impl_(50-51)SharedCtor(209-217)SharedCtor(209-209)SharedDtor(222-230)SharedDtor(222-222)MergeImpl(550-614)MergeImpl(550-550)ByteSizeLong(480-643)ByteSizeLong(480-480)ByteSizeLong(483-548)ByteSizeLong(483-483)_InternalSerialize(391-477)_InternalSerialize(391-393)void(355-383)Clear(355-355)GetMetadata(639-641)GetMetadata(639-639)agents/grpc/src/proto/asset.pb.h (35)
Impl_(338-338)Impl_(339-341)Impl_(342-345)_impl_(185-185)_internal_metadata_(108-111)PROTOBUF_NONNULL(82-85)PROTOBUF_NONNULL(82-82)PROTOBUF_NONNULL(132-139)PROTOBUF_NONNULL(132-132)PROTOBUF_NONNULL(140-144)PROTOBUF_NONNULL(140-140)PROTOBUF_NONNULL(190-190)PROTOBUF_NULLABLE(188-188)PROTOBUF_NULLABLE(234-234)PROTOBUF_NULLABLE(248-248)PROTOBUF_NULLABLE(249-249)PROTOBUF_NULLABLE(263-263)PROTOBUF_NULLABLE(264-264)from(94-97)from(94-94)from(98-106)from(98-98)from(152-152)from(154-154)from(154-154)self(189-189)ByteSizeLong(173-173)_InternalSerialize(168-170)_InternalSerialize(174-178)_InternalSerialize(181-183)GetClassData(204-204)void(602-607)to_msg(157-158)swap(131-131)swap(131-131)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: test-tarball-linux
- GitHub Check: coverage-linux
- GitHub Check: coverage-linux-without-intl
- GitHub Check: test-linux (ubuntu-24.04-arm)
- GitHub Check: test-linux (ubuntu-24.04)
- GitHub Check: test-macOS
- GitHub Check: coverage-windows
🔇 Additional comments (42)
agents/grpc/src/proto/command.pb.h (1)
14-19:Details
❓ Verification inconclusive
Strict protobuf version check may impact build environments
The header now includes a strict version check that will cause compilation errors if the runtime doesn't match protobuf 6.30.2 exactly. Ensure that:
- Your build system prioritizes the vendored copy of protobuf headers and library over any system installation
- CI environments have the correct version installed
- Documentation clarifies this strict dependency for developers
This is standard practice with newer protobuf versions, but worth noting for compatibility across different build environments.
🏁 Script executed:
#!/bin/bash # Verify if vendor directories are included in include paths before system paths find . -name "*.gyp" -o -name "*.gypi" -o -name "CMakeLists.txt" | xargs grep -l "include" | xargs grep -A 5 -B 5 "protobuf\|deps" | head -20 # Check if there are any include path ordering specifications find . -name "*.gyp" -o -name "*.gypi" | xargs grep -l "include_dirs" | head -5 | xargs cat | grep -A 10 "include_dirs"Length of output: 4713
Verify vendored Protobuf include path ordering to satisfy strict version check
The header
agents/grpc/src/proto/command.pb.hnow enforces#if PROTOBUF_VERSION != 6030002 #error "Protobuf C++ gencode is built with an incompatible version of…" #endifwhich will fail if a mismatched runtime is picked up. I didn’t find any include path directives for the vendored Protobuf in your gyp/gypi or CMakeLists. Please:
- Add the vendored Protobuf include and library paths before any system installs
• In CMakeLists.txt, callbefore any system paths orinclude_directories("${PROJECT_SOURCE_DIR}/deps/protobuf/include") link_directories("${PROJECT_SOURCE_DIR}/deps/protobuf/lib")find_packagecalls.
• In your gyp/gypi files, add'deps/protobuf/include'toinclude_dirsand vendor the matching library in your link settings.- Pin CI and local dev environments to Protobuf 6.30.2
- Update your documentation/developer guide to note this strict dependency and how to configure the build
agents/grpc/src/proto/asset.pb.cc (10)
4-4: Correctly specifies Protobuf versionThe file properly indicates it was generated with Protobuf C++ version 6.30.2, matching the PR objective to update protobuf to version 30.2.
6-22: Well-structured includes with proper organizationThe includes have been properly organized with standard library headers first, followed by protobuf-specific headers. The "Must be included last" comment for port_def.inc follows best practices for protobuf.
24-26: Appropriate namespace aliases for better readabilityThe code uses concise namespace aliases (
_pb,_pbi,_fl) for the protobuf namespaces, which improves readability while maintaining the full namespace path.
28-41: Modern constexpr initialization patternThe implementation uses modern C++ constexpr initialization patterns for the Impl_ struct, which enables compile-time optimization and is consistent with protobuf 6.30.2 best practices.
145-207: Thread-safe field access with TSAN annotationsThe implementation properly uses Thread Sanitizer annotations (
TSanWrite) when clearing and modifying fields, which helps detect potential data races in multi-threaded environments.
231-272: Efficient compile-time class metadata generationThe code uses protobuf's modern class data generation pattern with
InternalGenerateClassData_()which improves compile-time optimization and type safety.
355-383: Memory-efficient Clear implementationThe Clear method efficiently handles the clearing of different field types by checking has_bits and clearing only those fields that are set, which optimizes performance for large messages.
385-477: Optimized serialization with presence checksThe serialization code properly checks field presence using cached_has_bits and only serializes fields that are set, with additional optimizations like zero-value checks for numeric fields.
550-643: Enhanced merge implementation with arena awarenessThe merge implementation correctly handles arenas for memory management and properly propagates presence bits, which is essential for correct protobuf semantics.
653-654: Proper port_undef.inc inclusionThe file correctly includes google/protobuf/port_undef.inc at the end, which is necessary to clean up any macros defined by port_def.inc.
agents/grpc/src/proto/common.pb.h (7)
14-30: Robust version compatibility checkThe code properly checks the Protobuf C++ version (6.30.2) and provides helpful error messages with a URL to learn about cross-version runtime guarantees, which is important for maintaining compatibility.
140-153: Internal has_bits tracking for field presenceThe implementation uses modern field presence tracking with explicit bit fields, which is more efficient than the older approach of using default values to determine field presence.
156-211: Arena-aware memory managementThe code implements proper arena allocation support through arena-aware constructors, which allows for efficient memory management with less overhead in high-throughput applications.
232-243: Thread-safe accessors for numeric fieldsProper thread sanitizer annotations (
TSanWrite,TSanRead) are used in the accessor methods, helping to prevent data races in multithreaded applications.
830-893: Comprehensive string field handlingThe string field accessors properly handle all edge cases including empty strings, default values, and arena ownership, with appropriate lifetime annotations for better memory safety.
1029-1125: Safe message field handling with arena awarenessThe implementation provides comprehensive message field management with proper arena-aware ownership transfer, deletion prevention, and null checks to avoid memory leaks or crashes.
1235-1237: Complete header guard patternThe file properly closes the include guard at the end, maintaining consistency with standard C++ practices.
agents/grpc/src/proto/nsolid_service.pb.cc (8)
21-22: Proper port_def.inc inclusionThe file correctly marks google/protobuf/port_def.inc to be included last, which is necessary for proper macro definitions and platform compatibility.
29-35: Efficient constexpr initialization of Impl_ structThe use of constexpr for the Impl_ constructor enables compile-time initialization and optimization, which is a good practice in modern C++.
127-143: Proper descriptor table initializationThe code correctly uses absl::once_flag for thread-safe lazy initialization of the descriptor table, which is important for efficient protobuf reflection.
209-240: Optimized message construction through PlacementNew_The implementation provides efficient message construction with PlacementNew_ and InternalNewImpl_, which supports both arena and heap allocation in a consistent way.
287-300: Efficient Clear() implementationThe Clear() method properly handles different field types, clearing only what's necessary based on the has_bits tracking.
355-362: Optimized ByteSizeLong() calculationThe ByteSizeLong implementation efficiently calculates message size by checking presence bits first, which avoids unnecessary work for unset fields.
394-401: Arena-aware InternalSwap implementationThe InternalSwap method properly verifies arena compatibility and uses efficient swapping of fields and has_bits, which is essential for correct protobuf semantics.
413-417: Proper static initializationThe code uses appropriate attributes for initialization priority and static initialization of descriptor tables, which ensures proper startup sequence.
agents/grpc/src/proto/metrics.pb.cc (8)
28-42: Modern initialization pattern for MetricsBody::Impl_The constexpr constructor implementation for Impl_ struct follows modern C++ best practices and enables compile-time optimization.
135-151: Thread-safe descriptor table initializationThe use of absl::once_flag ensures thread-safe lazy initialization of the descriptor table, which is important for reflection support in multithreaded environments.
159-162: Thread-safe clear_resource_metrics with TSanWriteThe clear_resource_metrics method properly uses Thread Sanitizer annotations for thread safety.
304-313: Comprehensive Clear implementationThe Clear method handles all fields and metadata appropriately, clearing only what's necessary.
364-375: Optimized repeated field ByteSizeLong calculationThe ByteSizeLong method efficiently calculates the size of repeated fields by first getting the size once and then iterating through the elements.
573-593: Efficient Clear implementation for MetricsEventThe MetricsEvent::Clear method properly checks and clears only set fields based on has_bits, improving performance.
666-696: Arena-aware MergeImpl implementationThe MergeImpl method correctly handles arena allocation, presence bits, and nested message merging, which is essential for proper protobuf semantics.
728-732: Proper descriptor registrationThe code correctly uses PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 for static initialization order and registers descriptors with AddDescriptors, ensuring reflection works correctly.
agents/grpc/src/proto/asset.pb.h (8)
4-19: Version compatibility checks properly implementedThe updated file correctly includes explicit version compatibility checks for Protobuf 6.30.2, providing clear error messages with documentation links. This ensures runtime version mismatches will be caught early.
20-37: Dependency includes properly updatedThe includes have been properly modernized to support the new Protobuf 6.30.2 APIs, including arena allocation, message tables, and reflection support.
75-90: Class inheritance and construction properly updatedThe Asset class has been correctly updated to inherit from
::google::protobuf::Messagewith proper arena-aware construction patterns and constant initialization support.
108-115: Unknown field support addedNew accessors for unknown fields have been added with appropriate lifetime attributes, improving interoperability with unknown message fields.
346-356: Implementation structure modernized with has-bits trackingThe implementation structure now correctly uses
_has_bits_for field presence tracking and includes thread sanitizer declarations for thread safety.
380-471: Submessage field accessors updated with thread safety annotationsThe accessors for the
commonfield have been appropriately updated with thread sanitizer annotations and explicit has-bit tracking for thread-safe field access.
590-653: String field accessors updated with arena supportThe string field accessors (for
data) have been properly updated to include arena allocation support and thread safety annotations.
761-763: Port definition properly enclosedThe file correctly includes the port undefinition at the end, ensuring platform compatibility macros are properly scoped.
| @@ -1,522 +1,616 @@ | |||
| // Generated by the protocol buffer compiler. DO NOT EDIT! | |||
| // NO CHECKED-IN PROTOBUF GENCODE | |||
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.
💡 Verification agent
🧩 Analysis chain
Note regarding the checked-in generated code
The comment "NO CHECKED-IN PROTOBUF GENCODE" suggests this should not be committed, but the PR objective explicitly mentions regenerating proto files with the updated protoc. Consider documenting this exception or establishing a clear policy for when generated protobuf code should be checked in.
🏁 Script executed:
#!/bin/bash
# Check if there's a documented policy about checking in protobuf generated code
cd "$(git rev-parse --show-toplevel)" || exit
echo "Searching for documentation about protobuf generated code policy..."
grep -r --include="*.md" --include="README*" "protobuf gen" .
grep -r --include="*.md" --include="README*" "generated code" .
grep -r --include="CONTRIBUTING*" "protobuf" .Length of output: 1648
Document exception for checked-in generated protobuf code
There isn’t an existing policy in the repo about when it’s OK to commit generated .pb.cc/.pb.h files, yet this PR explicitly checks in regenerated protobuf sources. To avoid confusion, please:
-
Update the comment at
agents/grpc/src/proto/asset.pb.cc:2to explain why this generated code is intentionally committed. e.g.:// NO CHECKED-IN PROTOBUF GENCODE
- // NOTE: This file is regenerated and checked in using protoc vX.Y.Z
- Add a “Protobuf codegen” section to the repository’s main README (or CONTRIBUTING.md) covering:
- When generated proto files should be committed.
- Which tools/versions to use (e.g. `protoc vX.Y.Z`).
- Any CI checks that verify up-to-date sources.
This ensures future contributors understand why these generated files live in source control.
<!-- suggestion_start -->
<details>
<summary>📝 Committable suggestion</summary>
> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
`````suggestion
// NO CHECKED-IN PROTOBUF GENCODE
// NOTE: This file is regenerated and checked in using protoc vX.Y.Z
b5c04ac to
bc52147
Compare
This is a major dependency update that includes: * Update Protocol Buffers (protobuf) from previous version to 30.2 * Update gRPC from previous version to 1.72.0 * Add new build targets in protobuf.gyp: - protoc: Protocol Buffer compiler executable - protoc-gen-cpp: C++ code generator plugin for protoc Infrastructure improvements: * Add helper functions in tools/dep_updaters/utils.sh: - setup_protoc_environment: Configure protoc build environment - regenerate_proto_otel: Regenerate OpenTelemetry proto files - regenerate_proto_agents: Regenerate NSolid agent proto files * Enhance updater scripts: - update-protobuf.sh: Improved handling of abseil-cpp dependency - update-grpc.sh: Streamlined update process - update-opentelemetry-cpp.sh: Automated proto regeneration * Regenerate all proto files in agents/grpc/src/proto/ with updated protoc: - Updated *.pb.cc, *.pb.h, and *.grpc.pb.h files - Ensures compatibility with new protobuf/gRPC versions This update ensures NSolid remains compatible with the latest protocol buffer and gRPC implementations, improving performance and security.
bc52147 to
f597dc8
Compare
This is a major dependency update that includes: * Update Protocol Buffers (protobuf) from previous version to 30.2 * Update gRPC from previous version to 1.72.0 * Add new build targets in protobuf.gyp: - protoc: Protocol Buffer compiler executable - protoc-gen-cpp: C++ code generator plugin for protoc Infrastructure improvements: * Add helper functions in tools/dep_updaters/utils.sh: - setup_protoc_environment: Configure protoc build environment - regenerate_proto_otel: Regenerate OpenTelemetry proto files - regenerate_proto_agents: Regenerate NSolid agent proto files * Enhance updater scripts: - update-protobuf.sh: Improved handling of abseil-cpp dependency - update-grpc.sh: Streamlined update process - update-opentelemetry-cpp.sh: Automated proto regeneration * Regenerate all proto files in agents/grpc/src/proto/ with updated protoc: - Updated *.pb.cc, *.pb.h, and *.grpc.pb.h files - Ensures compatibility with new protobuf/gRPC versions This update ensures NSolid remains compatible with the latest protocol buffer and gRPC implementations, improving performance and security. PR-URL: #303 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
|
Landed in dd81b6d |
This is a major dependency update that includes: * Update Protocol Buffers (protobuf) from previous version to 30.2 * Update gRPC from previous version to 1.72.0 * Add new build targets in protobuf.gyp: - protoc: Protocol Buffer compiler executable - protoc-gen-cpp: C++ code generator plugin for protoc Infrastructure improvements: * Add helper functions in tools/dep_updaters/utils.sh: - setup_protoc_environment: Configure protoc build environment - regenerate_proto_otel: Regenerate OpenTelemetry proto files - regenerate_proto_agents: Regenerate NSolid agent proto files * Enhance updater scripts: - update-protobuf.sh: Improved handling of abseil-cpp dependency - update-grpc.sh: Streamlined update process - update-opentelemetry-cpp.sh: Automated proto regeneration * Regenerate all proto files in agents/grpc/src/proto/ with updated protoc: - Updated *.pb.cc, *.pb.h, and *.grpc.pb.h files - Ensures compatibility with new protobuf/gRPC versions This update ensures NSolid remains compatible with the latest protocol buffer and gRPC implementations, improving performance and security. PR-URL: #303 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
This is a major dependency update that includes: * Update Protocol Buffers (protobuf) from previous version to 30.2 * Update gRPC from previous version to 1.72.0 * Add new build targets in protobuf.gyp: - protoc: Protocol Buffer compiler executable - protoc-gen-cpp: C++ code generator plugin for protoc Infrastructure improvements: * Add helper functions in tools/dep_updaters/utils.sh: - setup_protoc_environment: Configure protoc build environment - regenerate_proto_otel: Regenerate OpenTelemetry proto files - regenerate_proto_agents: Regenerate NSolid agent proto files * Enhance updater scripts: - update-protobuf.sh: Improved handling of abseil-cpp dependency - update-grpc.sh: Streamlined update process - update-opentelemetry-cpp.sh: Automated proto regeneration * Regenerate all proto files in agents/grpc/src/proto/ with updated protoc: - Updated *.pb.cc, *.pb.h, and *.grpc.pb.h files - Ensures compatibility with new protobuf/gRPC versions This update ensures NSolid remains compatible with the latest protocol buffer and gRPC implementations, improving performance and security. PR-URL: #303 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> PR-URL: #359 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
This is a major dependency update that includes:
Infrastructure improvements:
Add helper functions in tools/dep_updaters/utils.sh:
Enhance updater scripts:
Regenerate all proto files in agents/grpc/src/proto/ with updated protoc:
This update ensures NSolid remains compatible with the latest protocol
buffer and gRPC implementations, improving performance and security.
Summary by CodeRabbit