Skip to content

refactor(cloudevent): migrate catdogs runtime, proto, and codegen#61

Merged
kooksee merged 7 commits into
v2from
feat/cloudevent-migration
Jun 16, 2026
Merged

refactor(cloudevent): migrate catdogs runtime, proto, and codegen#61
kooksee merged 7 commits into
v2from
feat/cloudevent-migration

Conversation

@kooksee

@kooksee kooksee commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Refactor component/cloudevent to match catdogs: jobManager, pub/sub interceptors, ForceRetry, subscriber.go split, and result.Result publish API.
  • Split protobuf extensions into proto/cloudeventoption and align types.proto fields (delay, sender, operation=2).
  • Update protoc-gen-go-cloudevent2 to catdogs conventions: CloudEventJobKey/CloudEventSubjectKey, Publisher{Opt, Interceptors}, and RegisterOpt.

Breaking changes

  • Import cloudeventoption/options.proto instead of cloudevent/options.proto.
  • Generated constants and publisher/register APIs changed (no backward compatibility).

Test plan

  • go test ./component/cloudevent/...
  • go test ./cmds/protoc-gen-go-cloudevent2/...
  • Regenerate service .cloudevent.pb.go in consuming repos after merge

Made with Cursor

Adopt jobManager/interceptor architecture, split cloudeventoption extensions,
and align protoc-gen-go-cloudevent2 output with catdogs conventions.

Co-authored-by: Cursor <cursoragent@cursor.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread component/cloudevent/subscriber.go
Comment thread component/cloudevent/subscriber.go
Comment thread component/cloudevent/subscriber.go
Comment thread component/cloudevent/publisher.go
Comment thread cmds/protoc-gen-go-cloudevent2/internal/gen.go Outdated
Comment thread cmds/protoc-gen-go-cloudevent2/internal/gen.go Outdated
Comment thread component/cloudevent/client.go Outdated
kooksee and others added 6 commits June 17, 2026 00:04
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>
@kooksee kooksee merged commit 47d8e70 into v2 Jun 16, 2026
2 checks passed
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