-
Notifications
You must be signed in to change notification settings - Fork 25
trigger error generator changes #1753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
👋 ettec, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the trigger error handling mechanism by replacing standard Go error types with custom caperrors.Error types for trigger registration and unregistration methods. The changes involve updating both the generated code and the templates that produce it to use the new error type while maintaining compatibility with existing interfaces through adapter functions.
- Updated protoc-gen-go version from v1.36.8 to v1.36.10
- Changed trigger registration/unregistration method signatures to return
caperrors.Errorinstead oferror - Added adapter functions to bridge between the new
caperrors.Errorinterface and the existingerrorinterface expected bycapabilities.RegisterTrigger
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/capabilities/v2/triggers/cron/trigger.pb.go | Updated protoc-gen-go version comment |
| pkg/capabilities/v2/triggers/cron/server/trigger_server_gen.go | Generated code reflecting template changes with new error types and adapter functions |
| pkg/capabilities/v2/protoc/pkg/templates/server.go.tmpl | Template updated to generate trigger methods with caperrors.Error return types and adapter functions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {{ $hasTriggers = true }} | ||
| Register{{.GoName}}(ctx context.Context, triggerID string, metadata capabilities.RequestMetadata, input *{{ImportAlias .Input.GoIdent.GoImportPath}}.{{.Input.GoIdent.GoName}}) (<- chan capabilities.TriggerAndId[*{{ImportAlias .Output.GoIdent.GoImportPath}}.{{.Output.GoIdent.GoName}}], error) | ||
| Unregister{{.GoName}}(ctx context.Context, triggerID string, metadata capabilities.RequestMetadata, input *{{ImportAlias .Input.GoIdent.GoImportPath}}.{{.Input.GoIdent.GoName}}) error | ||
| Register{{.GoName}}(ctx context.Context, triggerID string, metadata capabilities.RequestMetadata, input *{{ImportAlias .Input.GoIdent.GoImportPath}}.{{.Input.GoIdent.GoName}}) (<- chan capabilities.TriggerAndId[*{{ImportAlias .Output.GoIdent.GoImportPath}}.{{.Output.GoIdent.GoName}}], caperrors.Error) |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The template references caperrors but doesn't include the import statement. Ensure the generated code includes caperrors \"github.com/smartcontractkit/chainlink-common/pkg/capabilities/errors\" in the imports section of the template.
|
|
Pusehd f |
|
from wrong branch |
Checkin work done so far on trigger error changes.