Skip to content
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

Merged
merged 5 commits into from
Nov 2, 2023

Conversation

cedric-cordenier
Copy link
Contributor

No description provided.

@github-actions
Copy link
Contributor

I see that you haven't updated any CHANGELOG files. Would it make sense to do so?

@cedric-cordenier cedric-cordenier changed the title Start writing generic plugin type [BCF-2463] Add generic job type for lightweight OCR plugins Oct 23, 2023
@cedric-cordenier cedric-cordenier force-pushed the bcf-2463-add-generic-job-type branch 5 times, most recently from baada0f to 62735fa Compare November 1, 2023 11:55
@cedric-cordenier
Copy link
Contributor Author

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 :)

@cedric-cordenier cedric-cordenier marked this pull request as ready for review November 1, 2023 12:35
@jmank88
Copy link
Contributor

jmank88 commented Nov 1, 2023

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?

@cedric-cordenier
Copy link
Contributor Author

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?

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).

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) {
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@krehermann krehermann left a 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

@cedric-cordenier
Copy link
Contributor Author

@krehermann I agree: I've added a test which validates the generic job spec. Is that what you're after?

george-dorin
george-dorin previously approved these changes Nov 2, 2023
@@ -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:
Copy link
Contributor

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?

Copy link
Contributor Author

@cedric-cordenier cedric-cordenier Nov 2, 2023

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.

@cedric-cordenier cedric-cordenier force-pushed the bcf-2463-add-generic-job-type branch 2 times, most recently from 56ebd8f to 2248245 Compare November 2, 2023 14:46
@cl-sonarqube-production
Copy link

SonarQube Quality Gate

Quality Gate failed

Failed condition 11.5% 11.5% Coverage on New Code (is less than 75%)

See analysis details on SonarQube

@cedric-cordenier cedric-cordenier added this pull request to the merge queue Nov 2, 2023
Merged via the queue into develop with commit a08b705 Nov 2, 2023
83 of 84 checks passed
@cedric-cordenier cedric-cordenier deleted the bcf-2463-add-generic-job-type branch November 2, 2023 16:12
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.

4 participants