Skip to content

Conversation

@ettec
Copy link
Contributor

@ettec ettec commented Jan 5, 2026

Checkin work done so far on trigger error changes.

@ettec ettec requested a review from a team as a code owner January 5, 2026 15:50
Copilot AI review requested due to automatic review settings January 5, 2026 15:50
@github-actions
Copy link

github-actions bot commented Jan 5, 2026

👋 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!

Copy link
Contributor

Copilot AI left a 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.Error instead of error
  • Added adapter functions to bridge between the new caperrors.Error interface and the existing error interface expected by capabilities.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)
Copy link

Copilot AI Jan 5, 2026

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.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

github-actions bot commented Jan 5, 2026

⚠️ API Diff Results - Breaking changes detected

📦 Module: github-com-smartcontractkit-chainlink-common

🔴 Breaking Changes (14)

pkg/capabilities/v2/chain-capabilities/evm/server.ClientCapability (2)
  • RegisterLogTrigger — Type changed:
func(
  context.Context, 
  string, 
  github.com/smartcontractkit/chainlink-common/pkg/capabilities.RequestMetadata, 
  *github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/chain-capabilities/evm.FilterLogTriggerRequest
)
- (<-chan github.com/smartcontractkit/chainlink-common/pkg/capabilities.TriggerAndId[*github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/chain-capabilities/evm.Log], error)
+ (<-chan github.com/smartcontractkit/chainlink-common/pkg/capabilities.TriggerAndId[*github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/chain-capabilities/evm.Log], github.com/smartcontractkit/chainlink-common/pkg/capabilities/errors.Error)
  • UnregisterLogTrigger — Type changed:
func(
  context.Context, 
  string, 
  github.com/smartcontractkit/chainlink-common/pkg/capabilities.RequestMetadata, 
  *github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/chain-capabilities/evm.FilterLogTriggerRequest
)
- error
+ github.com/smartcontractkit/chainlink-common/pkg/capabilities/errors.Error
pkg/capabilities/v2/chain-capabilities/solana/server.ClientCapability (2)
  • RegisterLogTrigger — Type changed:
func(
  context.Context, 
  string, 
  github.com/smartcontractkit/chainlink-common/pkg/capabilities.RequestMetadata, 
  *github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/chain-capabilities/solana.FilterLogTriggerRequest
)
- (<-chan github.com/smartcontractkit/chainlink-common/pkg/capabilities.TriggerAndId[*github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/chain-capabilities/solana.Log], error)
+ (<-chan github.com/smartcontractkit/chainlink-common/pkg/capabilities.TriggerAndId[*github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/chain-capabilities/solana.Log], github.com/smartcontractkit/chainlink-common/pkg/capabilities/errors.Error)
  • UnregisterLogTrigger — Type changed:
func(
  context.Context, 
  string, 
  github.com/smartcontractkit/chainlink-common/pkg/capabilities.RequestMetadata, 
  *github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/chain-capabilities/solana.FilterLogTriggerRequest
)
- error
+ github.com/smartcontractkit/chainlink-common/pkg/capabilities/errors.Error
pkg/capabilities/v2/protoc/pkg/test_capabilities/actionandtrigger/server.BasicCapability (2)
  • RegisterTrigger — Type changed:
func(
  context.Context, 
  string, 
  github.com/smartcontractkit/chainlink-common/pkg/capabilities.RequestMetadata, 
  *github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/protoc/pkg/test_capabilities/actionandtrigger.Config
)
- (<-chan github.com/smartcontractkit/chainlink-common/pkg/capabilities.TriggerAndId[*github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/protoc/pkg/test_capabilities/actionandtrigger.TriggerEvent], error)
+ (<-chan github.com/smartcontractkit/chainlink-common/pkg/capabilities.TriggerAndId[*github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/protoc/pkg/test_capabilities/actionandtrigger.TriggerEvent], github.com/smartcontractkit/chainlink-common/pkg/capabilities/errors.Error)
  • UnregisterTrigger — Type changed:
func(
  context.Context, 
  string, 
  github.com/smartcontractkit/chainlink-common/pkg/capabilities.RequestMetadata, 
  *github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/protoc/pkg/test_capabilities/actionandtrigger.Config
)
- error
+ github.com/smartcontractkit/chainlink-common/pkg/capabilities/errors.Error
pkg/capabilities/v2/protoc/pkg/test_capabilities/basictrigger/server.BasicCapability (2)
  • RegisterTrigger — Type changed:
func(
  context.Context, 
  string, 
  github.com/smartcontractkit/chainlink-common/pkg/capabilities.RequestMetadata, 
  *github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/protoc/pkg/test_capabilities/basictrigger.Config
)
- (<-chan github.com/smartcontractkit/chainlink-common/pkg/capabilities.TriggerAndId[*github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/protoc/pkg/test_capabilities/basictrigger.Outputs], error)
+ (<-chan github.com/smartcontractkit/chainlink-common/pkg/capabilities.TriggerAndId[*github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/protoc/pkg/test_capabilities/basictrigger.Outputs], github.com/smartcontractkit/chainlink-common/pkg/capabilities/errors.Error)
  • UnregisterTrigger — Type changed:
func(
  context.Context, 
  string, 
  github.com/smartcontractkit/chainlink-common/pkg/capabilities.RequestMetadata, 
  *github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/protoc/pkg/test_capabilities/basictrigger.Config
)
- error
+ github.com/smartcontractkit/chainlink-common/pkg/capabilities/errors.Error
pkg/capabilities/v2/triggers/cron/server.CronCapability (4)
  • RegisterLegacyTrigger — Type changed:
func(
  context.Context, 
  string, 
  github.com/smartcontractkit/chainlink-common/pkg/capabilities.RequestMetadata, 
  *github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/triggers/cron.Config
)
- (<-chan github.com/smartcontractkit/chainlink-common/pkg/capabilities.TriggerAndId[*github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/triggers/cron.LegacyPayload], error)
+ (<-chan github.com/smartcontractkit/chainlink-common/pkg/capabilities.TriggerAndId[*github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/triggers/cron.LegacyPayload], github.com/smartcontractkit/chainlink-common/pkg/capabilities/errors.Error)
  • RegisterTrigger — Type changed:
func(
  context.Context, 
  string, 
  github.com/smartcontractkit/chainlink-common/pkg/capabilities.RequestMetadata, 
  *github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/triggers/cron.Config
)
- (<-chan github.com/smartcontractkit/chainlink-common/pkg/capabilities.TriggerAndId[*github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/triggers/cron.Payload], error)
+ (<-chan github.com/smartcontractkit/chainlink-common/pkg/capabilities.TriggerAndId[*github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/triggers/cron.Payload], github.com/smartcontractkit/chainlink-common/pkg/capabilities/errors.Error)
  • UnregisterLegacyTrigger — Type changed:
func(
  context.Context, 
  string, 
  github.com/smartcontractkit/chainlink-common/pkg/capabilities.RequestMetadata, 
  *github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/triggers/cron.Config
)
- error
+ github.com/smartcontractkit/chainlink-common/pkg/capabilities/errors.Error
  • UnregisterTrigger — Type changed:
func(
  context.Context, 
  string, 
  github.com/smartcontractkit/chainlink-common/pkg/capabilities.RequestMetadata, 
  *github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/triggers/cron.Config
)
- error
+ github.com/smartcontractkit/chainlink-common/pkg/capabilities/errors.Error
pkg/capabilities/v2/triggers/http/server.HTTPCapability (2)
  • RegisterTrigger — Type changed:
func(
  context.Context, 
  string, 
  github.com/smartcontractkit/chainlink-common/pkg/capabilities.RequestMetadata, 
  *github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/triggers/http.Config
)
- (<-chan github.com/smartcontractkit/chainlink-common/pkg/capabilities.TriggerAndId[*github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/triggers/http.Payload], error)
+ (<-chan github.com/smartcontractkit/chainlink-common/pkg/capabilities.TriggerAndId[*github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/triggers/http.Payload], github.com/smartcontractkit/chainlink-common/pkg/capabilities/errors.Error)
  • UnregisterTrigger — Type changed:
func(
  context.Context, 
  string, 
  github.com/smartcontractkit/chainlink-common/pkg/capabilities.RequestMetadata, 
  *github.com/smartcontractkit/chainlink-common/pkg/capabilities/v2/triggers/http.Config
)
- error
+ github.com/smartcontractkit/chainlink-common/pkg/capabilities/errors.Error

📄 View full apidiff report

@ettec
Copy link
Contributor Author

ettec commented Jan 5, 2026

Pusehd f

@ettec ettec closed this Jan 5, 2026
@ettec
Copy link
Contributor Author

ettec commented Jan 5, 2026

from wrong branch

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