You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "He-Pin (via GitHub)" <gi...@apache.org> on 2026/03/08 11:39:58 UTC

[PR] chore: migration trace - rich error model client API [pekko-grpc]

He-Pin opened a new pull request, #654:
URL: https://github.com/apache/pekko-grpc/pull/654

   ## Motivation
   
   This PR tracks the migration of upstream akka/akka-grpc commits `1c08d131` and `40fb2f2c` which together add first-class client-side support for the gRPC Rich Error Model.
   
   Previously, when a gRPC call failed with a `StatusRuntimeException` containing rich error details (as defined by Google's [API Design Guide error model](https://cloud.google.com/apis/design/errors)), there was no first-class API to access the structured `com.google.rpc.Status` from the client side. Users had to manually inspect trailers using grpc-java internals.
   
   > **Note:** This feature was independently ported to `apache/pekko-grpc` as **PR #645** (merged as commit `82300037`). This PR exists solely for migration audit trail purposes.
   
   ## Modification
   
   - Added `scaladsl.MetadataStatus` trait with `status`, `code`, `message`, `details`, `getParsedDetails[K]` methods
   - Added `javadsl.MetadataStatus` trait with Java-style getter methods
   - Added `RichGrpcMetadataImpl` (internal) that extracts `com.google.rpc.Status` from `StatusRuntimeException` trailers via `StatusProto.fromStatusAndTrailers`
   - Changed `GrpcServiceException.apply(StatusRuntimeException)` to wrap metadata in `RichGrpcMetadataImpl`
   - Added `GrpcServiceException.create()` Java API accepting `java.util.List`
   - Added `.recoverWith(richError)` / `.recoverWithRetries(1, richErrorStream)` to all `RequestBuilderImpl` invocation paths
   - New `RichErrorModelNativeSpec.scala` and `RichErrorModelNativeTest.java` integration tests
   - `RichErrorModelSpec` refactored from abstract to concrete
   
   ## Result
   
   Clients can pattern-match `GrpcServiceException.metadata` as `MetadataStatus` and call `getParsedDetails[LocalizedMessage]` (or similar) to access structured error details without touching grpc-java internals.
   
   ## References
   
   - Upstream commit 1 (**which is now Apache licensed**): https://github.com/akka/akka-grpc/commit/1c08d131
   - Upstream commit 2 (**which is now Apache licensed**): https://github.com/akka/akka-grpc/commit/40fb2f2c
   - Upstream PR: https://github.com/akka/akka-grpc/pull/1665 and https://github.com/akka/akka-grpc/pull/1740
   - Already merged in pekko-grpc as: https://github.com/apache/pekko-grpc/pull/645
   - Our local migration commit: `7fe45e6b`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] chore: migration trace - rich error model client API [pekko-grpc]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on PR #654:
URL: https://github.com/apache/pekko-grpc/pull/654#issuecomment-4018918542

   ## Investigation: Why this PR has no file changes
   
   After investigation, this PR contains **zero file changes** because the Rich Error Model client API feature was **already independently merged** into apache/pekko-grpc as [PR #645](https://github.com/apache/pekko-grpc/pull/645) (commit `82300037`).
   
   Our migration commit `7fe45e6b` on branch `port-2.3.0` implements the same feature ported from akka/akka-grpc commits `1c08d131` and `40fb2f2c`. Since PR #645 was already merged before we could submit our migration PR, there are no new changes to contribute.
   
   Closing this PR as the feature is already available in `main`. The migration is tracked in our `migration-checklist.md` for audit purposes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] chore: migration trace - rich error model client API [pekko-grpc]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin closed pull request #654: chore: migration trace - rich error model client API
URL: https://github.com/apache/pekko-grpc/pull/654


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] chore: migration trace - rich error model client API [pekko-grpc]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin closed pull request #654: chore: migration trace - rich error model client API
URL: https://github.com/apache/pekko-grpc/pull/654


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org