Skip to content

chore: migration trace - send transitive dependencies in server reflection#653

Closed
He-Pin wants to merge 1 commit intoapache:mainfrom
He-Pin:port/migration-trace-server-reflection
Closed

chore: migration trace - send transitive dependencies in server reflection#653
He-Pin wants to merge 1 commit intoapache:mainfrom
He-Pin:port/migration-trace-server-reflection

Conversation

@He-Pin
Copy link
Member

@He-Pin He-Pin commented Mar 8, 2026

Motivation

This PR tracks the migration of upstream akka/akka-grpc commit bf1e13c8 which adds transitive dependency tracking to the gRPC Server Reflection implementation.

The gRPC Server Reflection protocol requires that responses include not just the requested file descriptor but also all its transitive proto dependencies. Without this, clients using reflection (e.g., grpcurl, Postman gRPC) may fail to resolve types referenced in service definitions.

Note: This feature was independently ported to apache/pekko-grpc as PR #643 (merged as commit 7a954161). This PR exists solely for migration audit trail purposes.

Modification

  • Refactored ServerReflectionImpl.serverReflectionInfo to use statefulMap with a Set[String] state to track already-sent descriptors per stream, preventing duplicate sends
  • Added withTransitiveDeps helper to collect full transitive closure of proto dependencies
  • Added toFileDescriptorResponse helper to convert descriptors to reflection responses
  • Added 4 test proto files forming an import chain for testing
  • Added 2 new test cases verifying transitive deps are returned exactly once

Result

Server reflection correctly returns all transitive proto dependencies, enabling gRPC clients that rely on reflection to fully resolve complex proto type hierarchies.

References

This commit marks the migration of akka/akka-grpc@bf1e13c8 into pekko-grpc.
The feature was independently ported to apache/pekko-grpc as PR apache#643 (commit 7a95416).

Local migration commit: b5722812

Upstream: akka/akka-grpc@bf1e13c8

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@He-Pin He-Pin closed this Mar 8, 2026
@He-Pin He-Pin deleted the port/migration-trace-server-reflection branch March 8, 2026 11:46
@He-Pin
Copy link
Member Author

He-Pin commented Mar 8, 2026

Closing this PR as it contains no actual file changes — it was created purely as an audit trail marker noting that this feature was independently ported to pekko-grpc as PR #643 (commit 7a95416). Per our migration policy, PRs with no file changes provide no review value. The traceability information is preserved in migration-checklist.md and commits_detailed.csv in the local migration branch.

@He-Pin He-Pin restored the port/migration-trace-server-reflection branch March 8, 2026 11:56
@He-Pin He-Pin reopened this Mar 8, 2026
@He-Pin
Copy link
Member Author

He-Pin commented Mar 8, 2026

Local Investigation Results: Why This PR Has No File Changes

I've run a thorough local investigation to understand why this PR contains zero file changes.

Finding: The server reflection transitive dependencies feature (ported from akka/akka-grpc commit bf1e13c8, which is now Apache licensed) was independently implemented and merged into apache/pekko-grpc as PR #643 (commit 7a954161).

Verification — comparing our migration commit b5722812 against upstream/main shows zero diff in all affected files:

  • runtime/src/main/scala/org/apache/pekko/grpc/internal/ServerReflectionImpl.scala — identical
  • runtime/src/test/protobuf/pekko/grpc/internal/reflection_test_*.proto — identical
  • runtime/src/test/scala/org/apache/pekko/grpc/internal/ServerReflectionImplSpec.scala — identical

Since the feature is already present in main with identical code, there is no incremental value in merging this PR. Closing as the migration goal for this commit is already achieved via PR #643.

@He-Pin He-Pin closed this Mar 8, 2026
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.

1 participant