Skip to content

[Protobuf][2/n] Expand protoc-gen-yarpc-go to emit ActorUUID accessor for actor_uuid annotated fields - #2519

Merged
mark200 merged 6 commits into
yarpc:mainfrom
mark200:add-support-for-uuid-annotation-protobuf
Aug 17, 2026
Merged

[Protobuf][2/n] Expand protoc-gen-yarpc-go to emit ActorUUID accessor for actor_uuid annotated fields#2519
mark200 merged 6 commits into
yarpc:mainfrom
mark200:add-support-for-uuid-annotation-protobuf

Conversation

@mark200

@mark200 mark200 commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Plugin protoc-gen-yarpc-go is extended with uber.auth.annotations.actor_uuid annotation and emits a uniform ActorUUID accessor for every type that carries (via a method's args) an annotated field.
    For example, the following proto file

    message GetUserRequest {
      string requester_id = 1 [(uber.auth.annotations.actor_uuid) = true];
      string target_id = 2;
    }
    
    service UserService {
      rpc GetUser(GetUserRequest) returns (GetUserResponse);
    }

    generates the following method inside [proto_file].pb.yarpc.go

    func (t *GetUserRequest) ActorUUID() []string {
       return []string{t.GetRequesterId()}
    }

    Additionally, the following scenarios are accepted:

    • Cycles, nested requests, multiple annotations, repeated fields, map fields (look at withuuid.proto for reference)

Stacked PRs

  1. internal/protogen — shared descriptor-agnostic core PR#2535
  2. this PR — gogo converter + ActorUUID() emission in protoc-gen-yarpc-go PR#2519
  3. server-side validator wiring PR#2520

Test Plan

  1. Unit tested (here, inside yarpc-go)
  2. Changes pulled into monorepo - PR#214339
  3. E2E test - PR#214339

RELEASE NOTES:
Added support for protobuf annotation uber.auth.annotations.actor_uuid

@mark200 mark200 changed the title [Protobuf][1/2] Init ActorUUID accessor [Protobuf][1/n] Init ActorUUID accessor Jul 23, 2026
@mark200 mark200 changed the title [Protobuf][1/n] Init ActorUUID accessor [Protobuf][1/n] Expand protoc-gen-yarpc-go to emit ActorUUID accessor for actor_uuid annotated fields Aug 3, 2026
@mark200
mark200 force-pushed the add-support-for-uuid-annotation-protobuf branch 2 times, most recently from 5a5c7ec to 836dddc Compare August 3, 2026 16:51
Comment thread encoding/protobuf/protoc-gen-yarpc-go/internal/lib/uuid.go Outdated
@mark200
mark200 force-pushed the add-support-for-uuid-annotation-protobuf branch from d833ee4 to 23fe452 Compare August 11, 2026 13:11
@mark200 mark200 changed the title [Protobuf][1/n] Expand protoc-gen-yarpc-go to emit ActorUUID accessor for actor_uuid annotated fields [Protobuf][2/n] Expand protoc-gen-yarpc-go to emit ActorUUID accessor for actor_uuid annotated fields Aug 11, 2026
@mark200
mark200 force-pushed the add-support-for-uuid-annotation-protobuf branch from 23fe452 to d78a08c Compare August 11, 2026 14:42
@mark200
mark200 force-pushed the add-support-for-uuid-annotation-protobuf branch from d78a08c to 2ba0217 Compare August 17, 2026 13:51
@mark200
mark200 merged commit d16763e into yarpc:main Aug 17, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants