Skip to content

Add DeclarativeConfigContext#7293

Merged
jack-berg merged 2 commits intoopen-telemetry:mainfrom
jack-berg:declarative-config-context
May 6, 2025
Merged

Add DeclarativeConfigContext#7293
jack-berg merged 2 commits intoopen-telemetry:mainfrom
jack-berg:declarative-config-context

Conversation

@jack-berg
Copy link
Member

Refactor declarative config to encapsulate config context and state into a new carrier object, DeclarativeConfigContext.

Benefits:

  • Cleans up Factory interface by reducing number of arguments
  • Makes it easier to test because SPI loading and closeables tracking is encapsulated in an instance which can be mocked and spied. Previously these were managed via static helper methods.
  • Abstracts SPI loading to a single place, making Move declarative config to permanent home #7292 easier
  • ~200 fewer lines of code
@jack-berg jack-berg requested a review from a team as a code owner April 22, 2025 21:32
@codecov
Copy link

codecov bot commented Apr 22, 2025

Codecov Report

Attention: Patch coverage is 91.26214% with 9 lines in your changes missing coverage. Please review.

Project coverage is 89.86%. Comparing base (b468a2e) to head (11c7098).
Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
...incubator/fileconfig/DeclarativeConfigContext.java 70.96% 8 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7293      +/-   ##
============================================
- Coverage     90.04%   89.86%   -0.19%     
+ Complexity     6916     6890      -26     
============================================
  Files           787      786       -1     
  Lines         20864    20771      -93     
  Branches       2023     2024       +1     
============================================
- Hits          18788    18666     -122     
- Misses         1439     1463      +24     
- Partials        637      642       +5     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
}

/**
* Find a registered {@link ComponentProvider} which {@link ComponentProvider#getType()} matching
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Find a registered {@link ComponentProvider} which {@link ComponentProvider#getType()} matching
* Find a registered {@link ComponentProvider} with {@link ComponentProvider#getType()} matching
@jack-berg jack-berg merged commit eec2120 into open-telemetry:main May 6, 2025
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants