refactor(cloudevent): migrate catdogs runtime, proto, and codegen#61
Conversation
Adopt jobManager/interceptor architecture, split cloudeventoption extensions, and align protoc-gen-go-cloudevent2 output with catdogs conventions. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Code Review
This pull request refactors the cloudevent component to support publish and subscribe interceptors, structured options (PubOpt, RegisterOpt), and updated error handling using result.Error. It also separates the protobuf options into cloudeventoption and updates the code generator accordingly. The review feedback highlights critical stability issues, including missing panic recovery (result.Recovery) in doHandler and handlerDelayJob that could crash the application, and a potential nil pointer dereference in doPublish. Additionally, the reviewer noted a goroutine/memory leak from an unreleased ants.Pool, recommended making the hardcoded 5-minute AckWait configurable, and suggested using idiomatic jennifer AST nodes instead of raw string injection in the code generator.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Document the dual-proto layout, codegen, runtime APIs, and breaking changes from the pre-migration API. Co-authored-by: Cursor <cursoragent@cursor.com>
Include demo proto/codegen, NATS wiring, and package-level examples documented in README. Co-authored-by: Cursor <cursoragent@cursor.com>
Add panic recovery, release worker pools on stop, guard nil publish opts, derive AckWait from job timeouts, and clean up jennifer output. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
GitHub suggestion commit duplicated the function declaration and broke typecheck/lint CI. Co-authored-by: Cursor <cursoragent@cursor.com>
Apply golangci-lint import grouping across the cloudevent package. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
component/cloudeventto match catdogs:jobManager, pub/sub interceptors,ForceRetry,subscriber.gosplit, andresult.Resultpublish API.proto/cloudeventoptionand aligntypes.protofields (delay,sender,operation=2).protoc-gen-go-cloudevent2to catdogs conventions:CloudEventJobKey/CloudEventSubjectKey,Publisher{Opt, Interceptors}, andRegisterOpt.Breaking changes
cloudeventoption/options.protoinstead ofcloudevent/options.proto.Test plan
go test ./component/cloudevent/...go test ./cmds/protoc-gen-go-cloudevent2/....cloudevent.pb.goin consuming repos after mergeMade with Cursor