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

Make MakeFactoryMap generic and move to otelcol #12220

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

jade-guiton-dd
Copy link
Contributor

@jade-guiton-dd jade-guiton-dd commented Jan 31, 2025

Description

At the moment, receiver, scraper, processor, exporter, and extension each have their own version of the MakeFactoryMap function, which takes a list of Factories and returns it as a map, with the component name as the key (and an error if there is overlap). Because all versions are near-identical except for the Factory type used, and this function is only used in tests and in the code generated by OCB (components.go), it was suggested to make it generic and move it to the otelcol package.

This PR does exactly that. The old MakeFactoryMap functions are deprecated (and may be removed alongside their tests in a future release). I also had to make a few other odd changes to fit the new dependency graph.

Link to tracking issue

Resolves #12222

Copy link

codecov bot commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.31%. Comparing base (8de90e7) to head (75da473).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12220      +/-   ##
==========================================
+ Coverage   91.23%   91.31%   +0.08%     
==========================================
  Files         466      467       +1     
  Lines       25656    25721      +65     
==========================================
+ Hits        23406    23486      +80     
+ Misses       1837     1827      -10     
+ Partials      413      408       -5     

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

@jade-guiton-dd
Copy link
Contributor Author

jade-guiton-dd commented Jan 31, 2025

Hm, CI says otelcorecol is out of date, but I get on my diff locally when running make genotelcorecol

Edit: The issue was that I was using a different version of Go from the CI, so the toolchain directive generated by ocb was different

@jade-guiton-dd
Copy link
Contributor Author

Okay I think we have an infinite loop of make crosslink adds a replace, make genotelcorecol removes it, will think about this harder next week

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.

[extension/receiver/exporter/connector/processor] Move MakeFactoryMap to otelcol
1 participant