-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[BCF-2463] Add generic job type for lightweight OCR plugins #10665
Conversation
befc2ff
to
4ba606f
Compare
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
4ba606f
to
307b336
Compare
307b336
to
f6e1635
Compare
baada0f
to
62735fa
Compare
I'm really struggling with how to test this: I could introduce a bunch of mocks at the boundaries, but it feels like that wouldn't actually be testing much. If you have any thoughts, please let me know :) |
Is there an existing test that we can repackage? |
62735fa
to
3c2dabb
Compare
Not that I can tell: ocr2/delegate.go is basically not covered by any tests, and for good reason given the architecture (a call to ServicesForSpec just returns a list of services, and doesn't produce much in the way of behaviour that is actually testable). |
8201380
to
9ce7fd3
Compare
if err != nil { | ||
return err | ||
} | ||
e.SendLog(payload) | ||
return nil | ||
} | ||
|
||
func (t *TelemetryAdapter) getOrCreateEndpoint(contractID string, telemetryType string, network string, chainID string) (commontypes.MonitoringEndpoint, error) { | ||
func (t *TelemetryAdapter) getOrCreateEndpoint(network string, chainID string, contractID string, telemetryType string) (commontypes.MonitoringEndpoint, error) { |
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.
perhaps out of scope for this change, but should the telemetry API be changed to take the relayer.ID struct (which is the network and chain id) rather than the individual components?
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.
Let me think about this and potentially address this in the follow up I mentioned to Jordan: https://smartcontract-it.atlassian.net/jira/software/c/projects/BCF/boards/49?assignee=712020%3A25361daa-6eb8-4a03-9963-0264ac70a192&selectedIssue=BCF-2750
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.
i'd like to see this change an example or test or template of generic job spec, something that other developers could use to bootstrap there own generic job. do you think that makes sense at this point?
perhaps this could be some kind of godoc example that is testable
@krehermann I agree: I've added a test which validates the generic job spec. Is that what you're after? |
60f51c5
to
2dfde73
Compare
@@ -114,6 +114,8 @@ func validateSpec(tree *toml.Tree, spec job.Job) error { | |||
return nil | |||
case types.Mercury: | |||
return validateOCR2MercurySpec(spec.OCR2OracleSpec.PluginConfig, *spec.OCR2OracleSpec.FeedID) | |||
case types.GenericPlugin: |
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.
Maybe we can change this from plugin
to generic
?
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.
I'll follow up with this since it's part of chainlink-relay.
56ebd8f
to
2248245
Compare
2248245
to
abb2385
Compare
No description provided.