Skip to content

Conversation

@santigimeno
Copy link
Member

@santigimeno santigimeno commented Aug 18, 2025

Summary by CodeRabbit

  • Chores

    • Upgraded Protobuf codegen/runtime to 6.32.0 and refreshed related build configs and metadata.
    • Updated third-party dependencies (Abseil sources) and project wiring.
  • Refactor

    • Standardized unsigned literal suffixes and fully qualified std types across generated APIs.
    • Added optional debug-time integrity checks for message state (no impact in release builds).
    • Minor signature qualifications (e.g., destroying_delete_t) without behavioral changes.
  • Tests

    • Expanded conformance and unit tests, added new test protos and utilities.
    • Adjusted test infrastructure and dependencies for broader coverage.

@santigimeno santigimeno self-assigned this Aug 18, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 18, 2025

Walkthrough

The PR regenerates protobuf code to 6.32.0, adding conditional has-bit consistency checks, normalizing unsigned literal suffixes, and annotating internal constructors with [[maybe_unused]]. Headers switch operator delete to ::std::destroying_delete_t; some map key/value types are fully qualified (::std::string). Protobuf build files are substantially reorganized.

Changes

Cohort / File(s) Summary
Generated .pb.cc: Debug hardening and table/layout updates
agents/grpc/src/proto/asset.pb.cc, .../blocked_loop.pb.cc, .../command.pb.cc, .../common.pb.cc, .../exit.pb.cc, .../info.pb.cc, .../metrics.pb.cc, .../nsolid_service.pb.cc, .../packages.pb.cc, .../profile.pb.cc, .../reconfigure.pb.cc, .../source_code.pb.cc, .../startup_times.pb.cc
Bump to Protobuf 6.32.0; add if constexpr DebugHardenVerifyHasBitConsistency checks in destructors, serialize, merge, size/clear paths; normalize has-bit masks to U; expand field/parse tables to 4-tuple entries; add [[maybe_unused]] to Impl_ ctor params; select files adjust map helpers to ::std::string.
Generated .pb.h: Namespace and literal updates
agents/grpc/src/proto/asset.pb.h, .../blocked_loop.pb.h, .../command.pb.h, .../common.pb.h, .../exit.pb.h, .../info.pb.h, .../metrics.pb.h, .../nsolid_service.pb.h, .../packages.pb.h, .../profile.pb.h, .../reconfigure.pb.h, .../source_code.pb.h, .../startup_times.pb.h
Version guard to 6032000; operator delete takes ::std::destroying_delete_t; switch has-bit literals from u to U; no field additions.
Map API type qualification
agents/grpc/src/proto/info.pb.h, agents/grpc/src/proto/info.pb.cc, agents/grpc/src/proto/startup_times.pb.h, agents/grpc/src/proto/startup_times.pb.cc
Public map types now use ::std::string (and ::uint64_t in StartupTimes); MapEntry/MapField aliases updated; accessors’ signatures reflect fully qualified types.
Protobuf deps/build system updates
deps/protobuf/src/file_lists.cmake, deps/protobuf/src/google/protobuf/BUILD.bazel, deps/protobuf/abseil.gyp
Reworks upb sources/headers (decoder/reader, decode_fast select), adds conformance/test wiring, splits minitable generators, adjusts public headers; updates Abseil sources list (replace pool_urbg with entropy_pool; remove several sources).
Protobuf repo metadata and header cleanup
deps/protobuf/.bcr/metadata.template.json, deps/protobuf/src/google/protobuf/any.h
Add maintainer entry in metadata; drop unused absl/strings/cord.h include from any.h.

Sequence Diagram(s)

sequenceDiagram
  participant App
  participant Msg as Protobuf Message
  participant Guard as DebugHarden flag
  participant Ver as VerifyHasBitConsistency
  participant Ser as Serializer

  App->>Msg: _InternalSerialize()
  Msg->>Guard: if constexpr(DebugHardenVerifyHasBitConsistency)
  alt Harden enabled
    Guard->>Ver: VerifyHasBitConsistency()
    Ver-->>Msg: return
  end
  Msg->>Ser: Serialize fields (has_bits, tables)
  Ser-->>App: bytes
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • juanarbol
  • RafaelGSS

Poem

I nibble bytes with careful cheer,
New proto seeds have sprouted here.
A U on masks, a guard to see—
Are has-bits tidy? Verified by me.
With paws on build and headers neat,
I thump approval—changes complete. 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch santi/update_protocol_buffers_32

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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

🔭 Outside diff range comments (3)
agents/grpc/src/proto/exit.pb.cc (1)

209-216: Generated code requires C++20, not just C++17

The operator delete(..., ::std::destroying_delete_t) in the generated *.pb.h headers is a C++20-only feature whenever PROTOBUF_CUSTOM_VTABLE is enabled. You must either bump the project’s minimum standard to C++20 or disable custom vtables to retain C++17 compatibility.

Attention required in your build configurations:

  • Update your GYP/Bazel/Makefile flags (e.g. common_node.gypi, deps/grpc/.bcr/presubmit.yml, Makefile, etc.) to include -std=c++20.
  • Or explicitly disable PROTOBUF_CUSTOM_VTABLE during protobuf code generation to avoid pulling in std::destroying_delete_t.
deps/protobuf/src/file_lists.cmake (1)

1189-1189: Remove misspelled entry in file_lists.cmake

The typoged line is redundant—the correct def_to_proto_weak_import_test.proto is already listed just above. Remove the bad entry to prevent build failures.

• File: deps/protobuf/src/file_lists.cmake (around line 1189)

Proposed diff:

--- a/deps/protobuf/src/file_lists.cmake
+++ b/deps/protobuf/src/file_lists.cmake
@@ -1189
-  ${protobuf_SOURCE_DIR}/upb/util/def_to_proto_wweak_import_test.proto

Verified that upb/util/def_to_proto_weak_import_test.proto exists under the vendored subtree (deps/grpc/third_party/upb/upb/util).

deps/protobuf/src/google/protobuf/BUILD.bazel (1)

1061-1122: Add missing protobuf_test_proto_library macro
The BUILD rule at deps/protobuf/src/google/protobuf/BUILD.bazel invokes protobuf_test_proto_library, but I couldn’t find any protobuf_test_proto_library.bzl under bazel/tests (or elsewhere) defining that symbol. Without it, Bazel loads will fail.

• Create bazel/tests/protobuf_test_proto_library.bzl (or update the vendored macros) and export:

def protobuf_test_proto_library(name, srcs, option_deps=None, strip_import_prefix=None, visibility=None, deps=None):
    # …implementation including option_deps handling…

• Ensure your BUILD files load it correctly:

load("//bazel/tests:protobuf_test_proto_library.bzl", "protobuf_test_proto_library")
🧹 Nitpick comments (2)
deps/protobuf/src/file_lists.cmake (1)

1128-1158: Conformance test wiring: verify opt-in

Conformance targets are now listed. Ensure your build doesn’t unintentionally pull these into default build pipelines unless desired.

If these are not used in your build, consider guarding them in higher-level CMake to avoid needless build graph expansion.

agents/grpc/src/proto/info.pb.cc (1)

141-164: Descriptor tables updated — include only .pb.cc/.pb.h (exclude gRPC files) in the version‐banner check and run a quick smoke build

The gRPC‐plugin outputs (*.grpc.pb.cc/.grpc.pb.h) don’t include the “Protobuf C++ Version” banner, so narrow the grep to true protobuf-only files. Then verify all .pb.cc/.pb.h advertise 6.32.0 and kick off a smoke build:

# Check banner in .pb.cc/.pb.h (excluding *.grpc.pb.*)
rg -nP --include='*.pb.cc' --include='*.pb.h' \
   --glob='agents/grpc/src/proto/**/*.pb.*' \
   'Protobuf C\+\+ Version:\s*6\.32\.0' -S

# List any .pb.cc/.pb.h missing the banner
fd -e cc -e h '.*\.pb\.(cc|h)$' agents/grpc/src/proto \
  | grep -v '\.grpc\.pb\.' \
  | xargs -I{} sh -c \
    "rg -q 'Protobuf C\\+\\+ Version:\\s*6\\.32\\.0' '{}' || echo '{}'" \
  && echo "All true protobuf files advertise 6.32.0"

• Ensure no .pb.cc/.pb.h (outside of *.grpc.pb.*) are missing the banner
• Run a targeted smoke build on Linux/macOS/Windows to catch any ODR or header/runtime mismatches early

Comment on lines +697 to 702
${protobuf_SOURCE_DIR}/upb/wire/decode_fast/select.c
${protobuf_SOURCE_DIR}/upb/wire/encode.c
${protobuf_SOURCE_DIR}/upb/wire/eps_copy_input_stream.c
${protobuf_SOURCE_DIR}/upb/wire/internal/decode_fast.c
${protobuf_SOURCE_DIR}/upb/wire/internal/decoder.c
${protobuf_SOURCE_DIR}/upb/wire/reader.c
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Upb wire decoder/reader migration: verify files exist and no stale references remain

Swapping in:

  • upb/wire/decode_fast/select.c
  • upb/wire/internal/decoder.c
  • upb/wire/reader.c

and removing the older upb/wire/internal/decode_fast.c aligns with upstream refactors. Please verify the new files exist in the vendored tree and that the removed path isn’t referenced elsewhere.


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "1) Verify new upb sources exist"
for f in \
  'upb/wire/decode_fast/select.c' \
  'upb/wire/internal/decoder.c' \
  'upb/wire/reader.c' \
  'upb/wire/internal/decoder.h' \
  'upb/wire/internal/reader.h' \
  'upb/wire/reader.h' \
  'upb/wire/writer.h' \
  'upb/wire/decode_fast/combinations.h' \
  'upb/wire/decode_fast/data.h' \
  'upb/wire/decode_fast/select.h'
do
  if ! fd -a "$(basename "$f")" | rg -n "$f" -n -C0; then
    echo "MISSING: $f"
  fi
done

echo
echo "2) Ensure the removed file is not referenced"
if rg -n 'upb/wire/internal/decode_fast\.c' -g '!**/node_modules/**'; then
  echo "Stale reference to decode_fast.c found."
  exit 1
else
  echo "OK: no stale references to decode_fast.c"
fi

Length of output: 5197


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "1) Verify new upb sources/headers in protobuf vendored tree"
for f in \
  "deps/protobuf/src/upb/wire/decode_fast/select.c" \
  "deps/protobuf/src/upb/wire/internal/decoder.c" \
  "deps/protobuf/src/upb/wire/reader.c" \
  "deps/protobuf/src/upb/wire/internal/decoder.h" \
  "deps/protobuf/src/upb/wire/internal/reader.h" \
  "deps/protobuf/src/upb/wire/reader.h" \
  "deps/protobuf/src/upb/wire/writer.h" \
  "deps/protobuf/src/upb/wire/decode_fast/combinations.h" \
  "deps/protobuf/src/upb/wire/decode_fast/data.h" \
  "deps/protobuf/src/upb/wire/decode_fast/select.h"
do
  if [ -f "$f" ]; then
    echo "FOUND: $f"
  else
    echo "MISSING: $f"
  fi
done

echo
echo "2) Stale references to decode_fast.c in protobuf vendored tree"
if rg -n 'upb/wire/internal/decode_fast\.c' -g 'deps/protobuf/**/*'; then
  echo "Stale reference(s) found in protobuf vendored tree."
else
  echo "No stale references in protobuf vendored tree."
fi

Length of output: 6904


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "1) Locate any vendored upb directories under deps/protobuf"
fd -t d upb deps/protobuf

echo
echo "2) Search for decode_fast files in the protobuf tree"
rg -n 'decode_fast' -g 'deps/protobuf/**/*' -C1

echo
echo "3) Search for reader.c in the protobuf tree"
rg -n 'reader\.c' -g 'deps/protobuf/**/*' -C1

echo
echo "4) Search for writer.h in the protobuf tree"
rg -n 'writer\.h' -g 'deps/protobuf/**/*' -C1

Length of output: 7349


Add missing uPB source/header files & remove stale decode_fast.c references

The CMake list in deps/protobuf/src/file_lists.cmake now references the new uPB paths but those files aren’t present in the vendored tree, and the old upb/wire/internal/decode_fast.c is still referenced in the gRPC build files. You’ll need to:

• Vend the new uPB files under deps/protobuf/src/upb/wire/... so that CMake can find:
– decode_fast/select.c
– decode_fast/combinations.h
– decode_fast/data.h
– decode_fast/select.h
– internal/decoder.c & internal/decoder.h
– internal/reader.h
– reader.c & reader.h
– writer.h

• Remove any remaining references to the deleted upb/wire/internal/decode_fast.c in:
– deps/grpc/Makefile (line 1758)
– deps/grpc/grpc.gyp (line 1203)

This will align the vendored tree with the updated file_lists.cmake and eliminate build errors.

🤖 Prompt for AI Agents
In deps/protobuf/src/file_lists.cmake around lines 697-702 the CMake list
references new uPB source/header files that are not present in the vendored tree
and there are still stale references to upb/wire/internal/decode_fast.c in the
gRPC build files; add the missing files under deps/protobuf/src/upb/wire/
(decode_fast/select.c, decode_fast/combinations.h, decode_fast/data.h,
decode_fast/select.h, internal/decoder.c, internal/decoder.h, internal/reader.h,
reader.c, reader.h, writer.h) so CMake can locate them, and remove the remaining
reference to upb/wire/internal/decode_fast.c from deps/grpc/Makefile (line 1758)
and deps/grpc/grpc.gyp (line 1203).

Comment on lines +904 to +938
# @//pkg:protoc-gen-upb_minitable
set(protoc-gen-upb_minitable_srcs
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/code_generator.cc
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/code_generator_lite.cc
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/plugin.cc
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/plugin.pb.cc
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/retention.cc
${protobuf_SOURCE_DIR}/upb_generator/common.cc
${protobuf_SOURCE_DIR}/upb_generator/common/names.cc
${protobuf_SOURCE_DIR}/upb_generator/file_layout.cc
${protobuf_SOURCE_DIR}/upb_generator/minitable/generator.cc
${protobuf_SOURCE_DIR}/upb_generator/minitable/main.cc
${protobuf_SOURCE_DIR}/upb_generator/minitable/names.cc
${protobuf_SOURCE_DIR}/upb_generator/minitable/names_internal.cc
${protobuf_SOURCE_DIR}/upb_generator/plugin.cc
)

# @//pkg:protoc-gen-upb_minitable
set(protoc-gen-upb_minitable_hdrs
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/code_generator.h
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/code_generator_lite.h
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/plugin.h
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/plugin.pb.h
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/retention.h
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/scc.h
${protobuf_SOURCE_DIR}/upb_generator/common.h
${protobuf_SOURCE_DIR}/upb_generator/common/names.h
${protobuf_SOURCE_DIR}/upb_generator/file_layout.h
${protobuf_SOURCE_DIR}/upb_generator/minitable/generator.h
${protobuf_SOURCE_DIR}/upb_generator/minitable/names.h
${protobuf_SOURCE_DIR}/upb_generator/minitable/names_internal.h
${protobuf_SOURCE_DIR}/upb_generator/plugin.h
${protobuf_SOURCE_DIR}/upb_generator/plugin_bootstrap.h
)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

New protoc-gen-upb_minitable source/header lists: sanity check

The new minitable generator groups look correct. Please confirm these sets map to actual source files in the vendor tree to avoid CMake file-not-found errors.


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Verifying protoc-gen-upb_minitable files exist"
files=(
  'upb_generator/minitable/generator.cc'
  'upb_generator/minitable/main.cc'
  'upb_generator/minitable/generator.h'
  'upb_generator/minitable/names.cc'
  'upb_generator/minitable/names_internal.cc'
)
for f in "${files[@]}"; do
  if ! fd -a "$(basename "$f")" | rg -n "$f" -n -C0; then
    echo "MISSING: $f"
  fi
done

Length of output: 1537


Invalid file references in protoc-gen-upb_minitable lists

The following entries in deps/protobuf/src/file_lists.cmake (lines 904–938) do not exist in the protobuf vendor tree and will cause CMake “file not found” errors:

  • upb_generator/minitable/generator.cc
  • upb_generator/minitable/main.cc
  • upb_generator/minitable/generator.h
  • upb_generator/minitable/names.cc
  • upb_generator/minitable/names_internal.cc

Please update or remove these paths so they exactly match the actual files under ${protobuf_SOURCE_DIR}/upb_generator/minitable.

🤖 Prompt for AI Agents
In deps/protobuf/src/file_lists.cmake around lines 904–938, the
protoc-gen-upb_minitable source/header lists reference several non-existent
files under ${protobuf_SOURCE_DIR}/upb_generator/minitable (generator.cc,
main.cc, generator.h, names.cc, names_internal.cc); update these entries to
exactly match the real filenames in that vendor directory or remove them if they
don’t exist: inspect ${protobuf_SOURCE_DIR}/upb_generator/minitable, replace
each incorrect path with the correct filename (and path) or delete the entry
from both protoc-gen-upb_minitable_srcs and protoc-gen-upb_minitable_hdrs so
CMake no longer references missing files.

santigimeno added a commit that referenced this pull request Aug 19, 2025
PR-URL: #356
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
@santigimeno
Copy link
Member Author

Landed in ef5a0be.

@santigimeno santigimeno deleted the santi/update_protocol_buffers_32 branch August 19, 2025 09:03
santigimeno added a commit that referenced this pull request Aug 25, 2025
PR-URL: #356
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
santigimeno added a commit that referenced this pull request Aug 26, 2025
PR-URL: #356
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
PR-URL: #359
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants