Skip to content

agents: on grpc add appVersion field to info msg#413

Closed
santigimeno wants to merge 1 commit intonode-v24.x-nsolid-v6.xfrom
santi/info_missing_appversion
Closed

agents: on grpc add appVersion field to info msg#413
santigimeno wants to merge 1 commit intonode-v24.x-nsolid-v6.xfrom
santi/info_missing_appversion

Conversation

@santigimeno
Copy link
Member

@santigimeno santigimeno commented Jan 15, 2026

It wasn't added when creating the gRPC agent. Improved tests to cover this specific issue so it doesn't happen again.

Summary by CodeRabbit

  • New Features

    • Applications can now report app version in agent telemetry, making appVersion visible alongside other system metrics.
  • Tests

    • Expanded and reworked tests to validate appVersion collection across configurations and TLS modes; added explicit assertions for expected appVersion values.
  • Chores

    • Added lightweight package manifests to support the new GRPC/ZMQ agent test setups.

✏️ Tip: You can customize this high-level summary in your review settings.

@santigimeno santigimeno requested a review from RafaelGSS January 15, 2026 18:00
@santigimeno santigimeno self-assigned this Jan 15, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 15, 2026

Walkthrough

Adds an optional string field appVersion to the InfoBody protobuf; updates generated C++ protobuf code, gRPC agent population logic, and tests to validate the new field across gRPC and ZMQ flows; adds minimal package manifests for test agents.

Changes

Cohort / File(s) Summary
Proto & Generated C++
agents/grpc/proto/info.proto, agents/grpc/src/proto/info.pb.h, agents/grpc/src/proto/info.pb.cc
Added optional appVersion (field 17) to InfoBody. Generated header and implementation updated with accessors, ArenaString storage, parse/serialize/size logic, descriptor/parse-table updates, and has-bit adjustments.
gRPC Agent Implementation
agents/grpc/src/grpc_agent.cc
Populate InfoBody.appVersion from info["appVersion"] when present.
gRPC Test Rework
test/agents/test-grpc-info.mjs
Replaced worker/child lifecycle with TestClient flow, added checkInfoData helper, expanded test matrix for default/custom configs × secure/insecure TLS, and assert appVersion where applicable.
ZMQ Test Update
test/agents/test-zmq-info.mjs
Added assertion that info.body.appVersion equals '1.0.0'.
Test Package Manifests
test/common/nsolid-grpc-agent/package.json, test/common/nsolid-zmq-agent/package.json
Added minimal package.json files (version metadata) for test agent packages.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through proto, code, and test,
A tiny field to join the rest.
appVersion snug in Info's nest,
From agent to client it will quest.
🥕📦

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding an appVersion field to the gRPC info message, which is reflected across proto definitions, implementation, and tests.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e8b3be4 and f46c610.

📒 Files selected for processing (4)
  • agents/grpc/proto/info.proto
  • agents/grpc/src/grpc_agent.cc
  • agents/grpc/src/proto/info.pb.cc
  • agents/grpc/src/proto/info.pb.h
🚧 Files skipped from review as they are similar to previous changes (1)
  • agents/grpc/src/grpc_agent.cc
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-12-03T14:31:33.011Z
Learnt from: CR
Repo: nodesource/nsolid PR: 0
File: deps/grpc/src/core/handshaker/endpoint_info/GEMINI.md:0-0
Timestamp: 2025-12-03T14:31:33.011Z
Learning: Applies to deps/grpc/src/core/handshaker/endpoint_info/**/endpoint_info.{h,cc,hpp,cpp} : The `grpc_core::EndpointInfo` class is a data structure that contains information about the local and remote endpoints of a connection

Applied to files:

  • agents/grpc/src/proto/info.pb.cc
📚 Learning: 2025-12-03T14:30:08.346Z
Learnt from: CR
Repo: nodesource/nsolid PR: 0
File: deps/grpc/src/core/ext/filters/http/server/GEMINI.md:0-0
Timestamp: 2025-12-03T14:30:08.346Z
Learning: Applies to deps/grpc/src/core/ext/filters/http/server/**/http_server_filter.{h,cc} : Configure HttpServerFilter to surface the `user-agent` header to the application via the GRPC_ARG_SURFACE_USER_AGENT channel argument

Applied to files:

  • agents/grpc/src/proto/info.pb.h
🧬 Code graph analysis (2)
agents/grpc/src/proto/info.pb.cc (1)
agents/grpc/src/proto/info.pb.h (16)
  • InfoBody (141-141)
  • InfoBody (142-143)
  • InfoBody (808-813)
  • InfoBody (858-870)
  • InfoBody (873-878)
  • InfoBody (923-935)
  • InfoBody (938-943)
  • InfoBody (948-952)
  • InfoBody (953-973)
  • InfoBody (975-980)
  • InfoBody (1013-1025)
  • InfoBody (1028-1033)
  • InfoBody (1078-1090)
  • InfoBody (1093-1098)
  • InfoBody (1143-1155)
  • InfoBody (1158-1163)
agents/grpc/src/proto/info.pb.h (1)
agents/grpc/src/proto/asset.pb.h (11)
  • string (597-615)
  • string (616-633)
  • protobuf (42-47)
  • protobuf (64-65)
  • protobuf (108-115)
  • protobuf (117-119)
  • protobuf (120-122)
  • protobuf (123-125)
  • internal (43-46)
  • google (41-48)
  • google (63-66)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: test-macOS
  • GitHub Check: lint-js-and-md
  • GitHub Check: coverage-windows
  • GitHub Check: test-linux (ubuntu-24.04-arm)
  • GitHub Check: coverage-linux
  • GitHub Check: coverage-linux-without-intl
  • GitHub Check: test-linux (ubuntu-24.04)
  • GitHub Check: build-tarball
🔇 Additional comments (3)
agents/grpc/proto/info.proto (1)

24-24: LGTM!

The new optional string appVersion field with field number 17 is correctly added. Using optional in proto3 is appropriate here to enable presence tracking (distinguishing between "not set" and "empty string"), which aligns with the PR objective of conditionally populating this field only when appVersion exists in the info map.

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

1-4: Auto-generated protobuf code - no manual changes required.

This file is generated by protoc from info.proto. The generated code correctly implements all the necessary infrastructure for the new appVersion field including initialization, serialization/deserialization, Clear(), MergeImpl(), InternalSwap(), and size calculations.

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

1-4: Auto-generated protobuf header - no manual changes required.

This file is generated by protoc from info.proto. The generated code correctly declares all public and internal accessors for the new appVersion field, following the same patterns used by existing string fields like app, arch, and platform.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@EHortua EHortua left a comment

Choose a reason for hiding this comment

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

Still not working
image
image

@santigimeno
Copy link
Member Author

Yeah, that's to be expected. The console needs to update the proto files.

It wasn't added when creating the gRPC agent. Improved tests to cover
this specific issue so it doesn't happen again.
@santigimeno santigimeno force-pushed the santi/info_missing_appversion branch from e8b3be4 to f46c610 Compare January 16, 2026 11:11
Copy link

@EHortua EHortua left a comment

Choose a reason for hiding this comment

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

Fix working fine
image

santigimeno added a commit that referenced this pull request Jan 19, 2026
It wasn't added when creating the gRPC agent. Improved tests to cover
this specific issue so it doesn't happen again.

PR-URL: #413
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
@santigimeno
Copy link
Member Author

Landed in c491885

@santigimeno santigimeno deleted the santi/info_missing_appversion branch January 19, 2026 14:25
santigimeno added a commit that referenced this pull request Feb 25, 2026
It wasn't added when creating the gRPC agent. Improved tests to cover
this specific issue so it doesn't happen again.

PR-URL: #413
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
santigimeno added a commit that referenced this pull request Feb 25, 2026
It wasn't added when creating the gRPC agent. Improved tests to cover
this specific issue so it doesn't happen again.

PR-URL: #413
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants