pipelineImpl: de-pointerize plugin interface fields#113
pipelineImpl: de-pointerize plugin interface fields#113tzaffi merged 8 commits intoalgorand:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #113 +/- ##
==========================================
+ Coverage 67.66% 70.38% +2.72%
==========================================
Files 32 37 +5
Lines 1976 2509 +533
==========================================
+ Hits 1337 1766 +429
- Misses 570 648 +78
- Partials 69 95 +26
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
conduit/pipeline/pipeline.go
Outdated
| return fmt.Errorf("Pipeline.Init(): could not make %s config: %w", p.cfg.Importer.Name, err) | ||
| } | ||
| err = (*p.importer).Init(p.ctx, *p.initProvider, pluginConfig, importerLogger) | ||
| err = (p.importer).Init(p.ctx, *p.initProvider, pluginConfig, importerLogger) |
There was a problem hiding this comment.
Are the parens still needed?
| err = (p.importer).Init(p.ctx, *p.initProvider, pluginConfig, importerLogger) | |
| err = p.importer.Init(p.ctx, *p.initProvider, pluginConfig, importerLogger) |
conduit/pipeline/pipeline.go
Outdated
|
|
||
| importer := importerBuilder.New() | ||
| pipeline.importer = &importer | ||
| pipeline.importer = importerBuilder.New() |
There was a problem hiding this comment.
This change and the ones below in this file aren't needed, but seem ok.
There was a problem hiding this comment.
Well, partially they're needed, but we don't really need to remove the extra variable assignment as I'm doing here.
There was a problem hiding this comment.
Not sure why this variable is named "Builder". This is the "Constructor" and "New" is the single function defined in the constructor interface. The function above should be importers.ImporterConstructorByName.
What you have here is correct, previously it had to be assigned separately so that we could get the pointer.
There was a problem hiding this comment.
I've made changes in this commit:
However, now the PR has evolved from a non-breaking change to a quasi-breaking change since it's possible that someone can attempt to use the renamed interfaces explicitly and their code will reference these no longer existing types.
LMK
There was a problem hiding this comment.
Thanks. Up to you, I don't feel very strongly. Was just calling out a possible reason for the discrepancy because you mentioned it in your top comment.
There was a problem hiding this comment.
Went ahead and merged. We should discuss how to communicate this for our next release.
conduit/pipeline/pipeline.go
Outdated
|
|
||
| importer := importerBuilder.New() | ||
| pipeline.importer = &importer | ||
| pipeline.importer = importerBuilder.New() |
There was a problem hiding this comment.
Not sure why this variable is named "Builder". This is the "Constructor" and "New" is the single function defined in the constructor interface. The function above should be importers.ImporterConstructorByName.
What you have here is correct, previously it had to be assigned separately so that we could get the pointer.
Co-authored-by: Will Winder <wwinder.unh@gmail.com>
Co-authored-by: Will Winder <wwinder.unh@gmail.com>
Summary
Non-breaking changes:
pipelineImplstruct to be "concrete" interface types.Quasi-breaking changes:
*Buildervariables and types to be*ConstructorConstructorinterface which was used for constructing Importers to beImporterConstructorin line with other such plugin related types.Test Plan
CI
Testing TODO's
Results of the local block generator run
It's working just as before. Below is a screen shot comparing the run's report with what's in the database. Additionally, the conduit-log had no errors.