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

Conduit: Dynamic on complete #1285

Merged
merged 7 commits into from
Oct 25, 2022
Merged

Conversation

winder
Copy link
Contributor

@winder winder commented Oct 20, 2022

Summary

It seemed like this function is useful to any plugin, so I have implemented it in a dynamic way.

Any plugin can now add an OnComplete callback if they need it, and do not need to provide it if they do not.

Test Plan

Update tests.

@winder winder marked this pull request as ready for review October 20, 2022 14:21
@@ -158,6 +160,20 @@ func (p *pipelineImpl) setError(err error) {
p.err = err
}

func (p *pipelineImpl) registerLifecycleCallbacks() {
if v, ok := (*p.importer).(Completed); ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

neat.

Comment on lines 143 to 146
importer *importers.Importer
processors []*processors.Processor
exporter *exporters.Exporter
completeCallback []Completed
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if this needs to be []*Completed or not. I think all of our plugins use pointer receivers, so they are already pointers, but maybe that isn't always the case.

@winder winder force-pushed the will/dynamic-on-complete branch from 9777d4a to 4b1ca63 Compare October 20, 2022 18:26
@Eric-Warehime
Copy link
Contributor

Looks like the lint is failing, but otherwise really cool refactoring!

@winder winder force-pushed the will/dynamic-on-complete branch from 92ce73c to c9c4cee Compare October 25, 2022 13:51
@codecov
Copy link

codecov bot commented Oct 25, 2022

Codecov Report

Merging #1285 (c9c4cee) into conduit (c5fb831) will increase coverage by 0.07%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           conduit    #1285      +/-   ##
===========================================
+ Coverage    60.24%   60.31%   +0.07%     
===========================================
  Files           76       76              
  Lines        10034    10042       +8     
===========================================
+ Hits          6045     6057      +12     
+ Misses        3463     3459       -4     
  Partials       526      526              
Impacted Files Coverage Δ
processors/blockprocessor/block_processor.go 64.19% <ø> (ø)
processors/filterprocessor/filter_processor.go 78.57% <ø> (+2.18%) ⬆️
processors/noop/noop_processor.go 14.28% <ø> (+1.78%) ⬆️
conduit/pipeline.go 55.36% <100.00%> (+1.87%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@winder winder merged commit ace1808 into algorand:conduit Oct 25, 2022
@winder winder deleted the will/dynamic-on-complete branch October 25, 2022 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants