Workflow event capability#19
Merged
Merged
Conversation
ferglor
commented
Sep 24, 2024
ferglor
commented
Sep 24, 2024
23a40e2 to
c8c75a6
Compare
ferglor
commented
Oct 8, 2024
DeividasK
reviewed
Oct 15, 2024
806a161 to
634a4ff
Compare
| c.lggr.Errorw("missing payload", "workflowID", rawRequest.Metadata.WorkflowID, "executionID", rawRequest.Metadata.WorkflowExecutionID, "workflowName", rawRequest.Metadata.WorkflowName, "workflowOwner", rawRequest.Metadata.WorkflowOwner) | ||
| return capabilities.CapabilityResponse{}, errors.New("missing payload") | ||
| } | ||
| payloadMap, ok := payload.(*values.Map) |
Contributor
There was a problem hiding this comment.
You could simplify this with:
myStruct := &struct{Payload: *values.Map}{}
err := request.Inputs.UnwrapTo(myStruct)
DeividasK
reviewed
Oct 16, 2024
pkcll
reviewed
Oct 29, 2024
| } | ||
|
|
||
| if err := c.beholderClient.Emitter.Emit(ctx, bytes, | ||
| "beholder_data_schema", "/custom-message/versions/1", // required |
There was a problem hiding this comment.
Please add beholder_domain, beholder_entity attributes
For more context https://chainlink-core.slack.com/archives/C06QQCU1SGH/p1729618194371929
ferglor
commented
Nov 5, 2024
| "beholder_data_schema", "/custom-message/versions/1", // required | ||
| "beholder_data_type", "custom_message", | ||
| "beholder_domain", "keystone", | ||
| "beholder_entity", "values", |
Contributor
Author
There was a problem hiding this comment.
@pkcll Are these values correct for domain and entity? From the slack thread, it seems that the entity name is derived from the name of the .proto file that defines the type; the type used here (Map) is defined in this file: https://github.com/smartcontractkit/chainlink-common/blob/main/pkg/values/pb/values.proto#L30
07c6e0e to
e3f8869
Compare
DeividasK
reviewed
Nov 6, 2024
DeividasK
reviewed
Nov 6, 2024
DeividasK
reviewed
Nov 6, 2024
DeividasK
reviewed
Nov 6, 2024
DeividasK
reviewed
Nov 6, 2024
DeividasK
left a comment
Contributor
There was a problem hiding this comment.
A few minor comments, but overall LGTM. Happy to approve when Sonar is fixed (already pinged Alex).
chudilka1
requested changes
Nov 6, 2024
Co-authored-by: Deividas Karžinauskas <deividas.karzinauskas@gmail.com>
Co-authored-by: chudilka1 <yepishevsanya@gmail.com>
DeividasK
approved these changes
Nov 7, 2024
61e926c to
a55fca2
Compare
chudilka1
approved these changes
Nov 12, 2024
cedric-cordenier
pushed a commit
that referenced
this pull request
Nov 19, 2024
* WIP add a beholder capability Regenerate Refactor Add test coverage Clean up project.json goimports Add generate task Nx tidy Regenerate beholder capability Update tests Use proto maps Use proto marshal and unmarshal Switch to google.golang.org/protobuf/proto Clean up generated code Nx generate go mod tidy WIP update cap Bump common Use the test config to disable batch, specify attributes WIP update beholder settings Update tests Update test Add readme with nx commands Please the linter * Use a non test config * Update build commands * Update the initialise function signature to allow for an OracleFactory * go mod tidy * Cast to values.Map and use values.ProtoMap * goimports * Add more logs * Update tests, remove logs * Please the linter * Add example payloads to the schema * Add attributes to the emitted message * Rename the beholder capability to the workflowevent capability * Fix tests * Add beholder domain and entity, TBD * Update tests * Update workflowevent/project.json Co-authored-by: Deividas Karžinauskas <deividas.karzinauskas@gmail.com> * Use the loopserver lib * Extract capability info * Update workflowevent/project.json Co-authored-by: chudilka1 <yepishevsanya@gmail.com> * Goimports * Use testutils * Goimports * go mod tidy * Rename schema json * Exclude main.go from coverage reports * Make domain and entity configurable * Use platform and values as domain and entity --------- Co-authored-by: Sri Kidambi <1702865+kidambisrinivas@users.noreply.github.com> Co-authored-by: Deividas Karžinauskas <deividas.karzinauskas@gmail.com> Co-authored-by: chudilka1 <yepishevsanya@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The idea with this capability is that we want to be able to define custom events at the workflow level, using outputs of other capabilities in the event body. Some pseudo code to highlight what we think we'd need:
Currently, I'm not able to define a structure in the schema that would let me construct an arbitrary map for the event data in this way; should I instead be using a compute capability to tie the event data together and feed that into the beholder capability?Update
After some discussion with @nolag, we're now able to use an "any map" as input to the capability. This capability has been tested based on the steps outlined in this doc: https://smartcontract-it.atlassian.net/wiki/spaces/CAP/pages/1048478592/Testing+the+beholder+capability
Example workflow definition:
Example use in integration/unit tests: