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

POC for how to avoid duplicating WithStart and WithShutdown #12466

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bogdandrutu
Copy link
Member

@bogdandrutu bogdandrutu commented Feb 24, 2025

This way, we allow in the future to add more options in the component that will automatically be picked by every component implementation, as well as we remove duplicate definition.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
@bogdandrutu bogdandrutu requested a review from a team as a code owner February 24, 2025 17:03
Copy link

codecov bot commented Feb 24, 2025

Codecov Report

Attention: Patch coverage is 74.19355% with 16 lines in your changes missing coverage. Please review.

Project coverage is 92.04%. Comparing base (cffb7b6) to head (0210d0f).

Files with missing lines Patch % Lines
component/component.go 0.00% 16 Missing ⚠️

❌ Your patch check has failed because the patch coverage (74.19%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12466      +/-   ##
==========================================
- Coverage   92.10%   92.04%   -0.06%     
==========================================
  Files         465      465              
  Lines       25180    25200      +20     
==========================================
+ Hits        23191    23195       +4     
- Misses       1592     1608      +16     
  Partials      397      397              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

StartFunc: bs.StartFunc,
ShutdownFunc: bs.ShutdownFunc,
Logs: logsConsumer,
Component: component.NewComponent(bs.componentOptions...),
Copy link
Contributor

Choose a reason for hiding this comment

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

tiny nit: The abbreviated name of this "bs" variable isn't clear entirely clear here (metrics.go and traces.go also use it). The other files use names that are clearer from context.

@mx-psi
Copy link
Member

mx-psi commented Feb 25, 2025

This looks alright to me, I think we can apply it everywhere

Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

i think this approach makes sense 👍🏻

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